jupyterlab-myst icon indicating copy to clipboard operation
jupyterlab-myst copied to clipboard

Better rendering of unknown directives

Open nthiery opened this issue 8 months ago • 0 comments

Currently, an undefined directive such as:

:::{foo} A title
Lorem ipsum etc ...
:::

is rendered as such:

Image

It's indeed important to warn the user about such an unknown directive which may result from a typo. Yet on many occasions the user needs to edit notebooks which legitimately include such unknown directives. Typically because this is a custom directive defined in a Jupyter-Book or MySTmd extension that is not yet supported in JupyterLab-Myst. This includes fairly standard directives such as todo, etc.

In that case the current rendering is very obtrusive, requiring user interaction to see the actual content.

Proposal

Render the directive as a standard admonition (including the support for classes etc.), with just (foo: undefined directive) added at the end of the title in warning style. Typically:

Image

nthiery avatar Apr 09 '25 06:04 nthiery