MyST-NB icon indicating copy to clipboard operation
MyST-NB copied to clipboard

Add a prolog option in the config

Open adamgayoso opened this issue 3 years ago • 3 comments

Context

I'm trying to convert from nbsphinx to myst-nb, but am impeded by a few features that we have come to rely on for nbsphinx.

One important one is the prolog. We use this to inject code into the notebooks that adds a colab link (see here for the tutorial and here for the prolog)

Proposal

Add a prolog option to the configuration to allow code injection like nbsphinx.

Tasks and updates

No response

adamgayoso avatar Sep 14 '22 15:09 adamgayoso

Hi @adamgayoso have you considered looking at https://github.com/executablebooks/sphinx-book-theme, which we designed specifically to have these kind of features at the theme level, i.e. as shown in the documentation here https://myst-nb.readthedocs.io/en/latest/render/format_code_cells.html

image

this is certainly the approach that I would encourage. (and was playing before about how this could be added to furo 😉 https://furo-topbar.readthedocs.io/en/latest/#top)

chrisjsewell avatar Sep 29 '22 13:09 chrisjsewell

Its not out of the question, thinking about a prolog feature, but I don't really like the way it is in nbsphinx, it just adds a lot of bloat to top of every page

chrisjsewell avatar Sep 29 '22 13:09 chrisjsewell

have you considered looking at https://github.com/executablebooks/sphinx-book-theme, which we designed specifically to have these kind of features at the theme leve

I would like to switch to this theme, but am waiting for dark mode to be added!

adamgayoso avatar Oct 05 '22 03:10 adamgayoso