Overwrite default ipynb entrypoint for my_st-nb (like nb_custom_formats
only for ipynb)
#613
-
I've originally posted the issue in executablebooks/jupyter-book issue1586. nb_custom_formats = {
'.ipynb': ['nbformat.reads', {'as_version': 4}],
} But this triggers sphinx to re-register the extension and raises an error. def add_nb_custom_formats(app: Sphinx, config):
"""Add custom conversion formats."""
for suffix in config.nb_custom_formats:
app.add_source_suffix(suffix, "myst-nb") from here I am not very familiar with sphinx and mainly use jupyter-book. Any help would be greatly appreciated. :) |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
I would think that by simply checking if |
Beta Was this translation helpful? Give feedback.
-
Heya, sorry you beat me to a reply lol, but I've literally just added this in https://github.com/executablebooks/MyST-NB/blob/3e54270c2252ebfd119ea7b80460765fe5693d0d/myst_nb/sphinx_.py#L119, plus the requisite logic for choosing the format reader in https://github.com/executablebooks/MyST-NB/blob/3e54270c2252ebfd119ea7b80460765fe5693d0d/myst_nb/read.py#L61 This is a big refactor of myst-nb, but nearly there, so hopefully in jupyter-book in a reasonable time |
Beta Was this translation helpful? Give feedback.
Heya, sorry you beat me to a reply lol, but I've literally just added this in https://github.com/executablebooks/MyST-NB/blob/3e54270c2252ebfd119ea7b80460765fe5693d0d/myst_nb/sphinx_.py#L119, plus the requisite logic for choosing the format reader in https://github.com/executablebooks/MyST-NB/blob/3e54270c2252ebfd119ea7b80460765fe5693d0d/myst_nb/read.py#L61
This is a big refactor of myst-nb, but nearly there, so hopefully in jupyter-book in a reasonable time