executablebooks / jupyter-book

Create beautiful, publication-quality books and documents from computational content.

Home Page:http://jupyterbook.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot generate tab-sets, tab items or anything from myst from within python code cell

kboom opened this issue · comments

Describe the bug

context
I'm using v0.15.1.
I'm trying to generate content dynamically from within python cell.
Usually what works well, and does, in the case of normal markdown, is just calling display(Markdown("# Hello")).
However, if you're trying to display things like the following:

display(Markdown("""````{tab-set}

{tab-item} Basics

::::{{grid}}
:gutter: 3

:::{{grid-item-card}} Title
Description
Mitigate by {{ref}}`recycle-ats`.
:::
::::

\```

\````
"""

it won't work, throws unknown lexer tab-set problem.

expectation
Since the ability to generate dynamic content from jupyter notebook is quite essential, I cannot understand why this does not work. Moreover, using the non-ipynb format is not an option as it has its own huge disadvantages (if your notebooks are complex - code wise - for instance).

bug
It won't work, throws unknown lexer tab-set problem. Tried zillion things, none worked.

$ jupyter-book build mybook

myst v0.18.1: MdParserConfig(commonmark_only=False, gfm_only=False, enable_extensions=['colon_fence', 'dollarmath', 'linkify', 'substitution', 'tasklist'], disable_syntax=[], all_links_external=False, url_schemes=['mailto', 'http', 'https'], ref_domains=None, highlight_code_blocks=True, number_code_blocks=[], title_to_header=False, heading_anchors=None, heading_slug_func=None, footnote_transition=True, words_per_minute=200, sub_delimiters=('{', '}'), linkify_fuzzy_links=True, dmath_allow_labels=True, dmath_allow_space=True, dmath_allow_digits=True, dmath_double_inline=False, update_mathjax=True, mathjax_classes='tex2jax_process|mathjax_process|math|output_area')
myst-nb v0.17.2: NbParserConfig(custom_formats={}, metadata_key='mystnb', cell_metadata_key='mystnb', kernel_rgx_aliases={}, execution_mode='force', execution_cache_path='', execution_excludepatterns=[], execution_timeout=180, execution_in_temp=False, execution_allow_errors=False, execution_raise_on_error=False, execution_show_tb=False, merge_streams=False, render_plugin='default', remove_code_source=False, remove_code_outputs=False, code_prompt_show='Show code cell {type}', code_prompt_hide='Hide code cell {type}', number_source_lines=False, output_stderr='show', render_text_lexer='myst-ansi', render_error_lexer='ipythontb', render_image_options={}, render_figure_options={}, render_markdown_format='commonmark', output_folder='build', append_css=True, metadata_to_fm=False)
Using jupyter-cache at: /reports/_build/.jupyter_cache


problem
People are unable to generate dynamic content in jupyter-book from *.ipynb files. This seriously limits the usefulness.

Reproduce the bug

Create a jupyter notebook (*.ipynb) and a python code cell.
Generate markdown which contains some admonitions.
This error will appear during generation WARNING: Pygments lexer name '{tab-set}' is not known
The jupyter book will be generated, but the cell will display as code block quote rather than a nice content it supposed to generate.

List your environment

Jupyter Book : 0.15.1
External ToC : 0.3.1
MyST-Parser : 0.18.1
MyST-NB : 0.17.2
Sphinx Book Theme : 1.0.1
Jupyter-Cache : 0.6.1
NbClient : 0.7.4

Thanks for opening your first issue here! Engagement like this is essential for open source projects! 🤗

If you haven't done so already, check out EBP's Code of Conduct. Also, please try to follow the issue template as it helps other community members to contribute more effectively.

If your issue is a feature request, others may react to it, to raise its prominence (see Feature Voting).

Welcome to the EBP community! 🎉