Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Notify users in case output syntax requires myst extensions #15

Closed
mbercx opened this issue May 15, 2021 · 3 comments · Fixed by #18
Closed

Notify users in case output syntax requires myst extensions #15

mbercx opened this issue May 15, 2021 · 3 comments · Fixed by #18
Labels
bug Something isn't working

Comments

@mbercx
Copy link

mbercx commented May 15, 2021

When converting to myst syntax that requires extensions, it would be good in case the user was made aware of these required extensions somehow.

The description below was my original post, which thought the conversion was buggy because I wasn't aware of the extension colon_fence.


Describe the bug

When converting e.g. a figure directive

.. _fig_intro_workchain_graph:
.. figure:: include/images/basics_workchain_graph.png
    :scale: 30
    :align: center

    Provenance Graph of a basic AiiDA WorkChain.

This gets converted into

(fig-intro-workchain-graph)=
:::{figure} include/images/basics_workchain_graph.png
:scale: 30
:align: center

Provenance Graph of a basic AiiDA WorkChain.

:::

Expected behavior

Doesn't myst-nb need backticks for the directives? I.e. if I convert this into

(fig-intro-workchain-graph)=

```{figure} include/images/basics_workchain_graph.png
:scale: 30
:align: center

Provenance Graph of a basic AiiDA WorkChain.
```#

This works fine for me.

Similar issues arise for note and important directives (and possibly others that are not in the file I'm converting).

Environment

  • Python Version [e.g. 3.7.1]: 3.8.6
  • Package versions or output of jupyter-book --version:
    $ pip freeze | grep myst
    myst-nb==0.13.0a1
    myst-parser==0.14.0a2
    rst-to-myst==0.1.2
  • Operating System: macOS Big Sur 11.3.1
@mbercx mbercx added the bug Something isn't working label May 15, 2021
@mbercx mbercx changed the title Some directives convert into :::{<directive>}, not {<directive>} ` Some directives convert into :::{<directive>}, not {<directive>}` May 15, 2021
@mbercx
Copy link
Author

mbercx commented May 15, 2021

Title should be:

Some directives convert into :::{<directive>}, not ```{<directive>}

But if I copy paste this into the Title and save it, it doesn't work. 🤨

This is seriously triggering my OCD. 😅

@chrisjsewell
Copy link
Member

See https://myst-parser.readthedocs.io/en/latest/using/syntax-optional.html, you can add colon_fence to the myst extensions to also allow for colons.
(But yeh I intend to make it clearer with this tool when it is outputting syntax that requires extensions)

@mbercx mbercx changed the title Some directives convert into :::{<directive>}, not {<directive>}` Notify users in case output syntax requires myst extensions May 30, 2021
@mbercx
Copy link
Author

mbercx commented May 30, 2021

Updated title and OP, can't change label unfortunately 😭

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants