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

Add a directive for previewing MyST + rST with tabs for Sphinx docs #25

Open
choldgraf opened this issue Jul 8, 2021 · 2 comments
Open
Labels
enhancement New feature or request

Comments

@choldgraf
Copy link
Member

choldgraf commented Jul 8, 2021

One challenge of us introducing MyST to the Sphinx world is that almost all of the documentation is written in rST, not MyST Markdown, and many folks will likely want to keep rST in their documentation rather than switch to MyST entirely.

For that group, it would be great if there were a way to display MyST syntax without requiring them to re-write their example usage.

So I wonder if we could use this tool to provide a directive like:

.. rst-myst-demo::
   .. admonition::
      My admonition!

That would effectively mimic the following behavior:

.. tabbed:: reStructuredText
   .. code-block:: rst
      .. admonition::
         My admonition `with a link <https://google.com>`_!

.. tabbed:: MyST Markdown
   .. code-block:: md
      ```{admonition}
      My admonition [with a link](https://google.com).
      ```

.. admonition::
   My admonition!

This way, people could take their pre-existing rST examples, and simply wrap them in .. rst-myst-demo:: and they'd get MyST generated for their examples as well.

An example of what this could look like in practice is @pradyunsg's excellent reference material for Furo here:

https://pradyunsg.me/furo/reference/admonitions/

where he shows "split" views of rST and MyST markdown for all of the directives.

(ideally, it would be possible to do this for MyST markdown -> rst as well, but I don't believe that functionality exists currently)

@choldgraf choldgraf added the enhancement New feature or request label Jul 8, 2021
@chrisjsewell
Copy link
Member

Already planned in executablebooks/MyST-Parser#267 (comment)

@choldgraf
Copy link
Member Author

choldgraf commented Jul 8, 2021

ah nice - I will close this one since it already exists there

edit: actually, I'll leave it open and you can decide if you'd like to close it. This issue is a bit more specific, since it focuses around the Directive, whereas that issue is more about the end-product documentation (the "rosetta stone"). I'm happy to leave this open or not.

@choldgraf choldgraf reopened this Jul 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants