Code Monkey home page Code Monkey logo

Comments (2)

2bndy5 avatar 2bndy5 commented on September 22, 2024

I took a swing at this and it was really easy to re-use the same directive class from our rst-example directive for a myst-example directive. So, that is a first step. There are some MyST examples that can't be used with this though (eg. section headings and markup representing <hr> elements).

My original vision was to feed a single directive multiple code-blocks with the language set, then render them in a set of tabs whose labels correspond to the code-block's language. I was imagining something like

.. doc-example::

    .. code-block:: rst

        Some ``syntax``.

    .. code-block:: md

        Some `syntax`.

Alternatively, it would be more ideal to have rST content converted to MyST syntax and render both syntaxes as a set of tabs (whose labels correspond to the syntax name "rST" and "MyST") sharing a single rendered result. I think this would be better as a derivative of the rst-example directive. I'm not sure if it should be done the other way around though (take MyST content and convert it to rST).

This will take me some time as the parser used by the state machine seems to be automatically determined based on the source file's suffix.

from sphinx-immaterial.

2bndy5 avatar 2bndy5 commented on September 22, 2024

Damn. It looks like the rst2myst tool (still in beta) doesn't support the latest docutils.

I'll just submit a patch for what I have and put my original vision (a bit zealous even for me) on the back burner (again) till we have a feasible tool/lib to convert rST to MyST.

from sphinx-immaterial.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.