executablebooks / MyST-NB

Parse and execute ipynb files in Sphinx
https://myst-nb.readthedocs.io
BSD 3-Clause "New" or "Revised" License
209 stars 83 forks source link

Writing algorithms in myst-nb / defining new directives in myst #339

Open NelleV opened 3 years ago

NelleV commented 3 years ago

I need to write an algorithm in a myst notebook:

algorithm

In Rmd, there are several options which are mostly based on adding a new directive.

Is it possible to add a new directive to myst to support algorthims? (or any other way to support such feature).

Many thanks!

chrisjsewell commented 3 years ago

Hey @NelleV you might want to check out https://sphinx-proof.readthedocs.io/en/latest/syntax.html

myst-parser/myst-nb utilise sphinx as the underlying documentation engine, which allows for extension plugins, of which sphinx-proof is an example

chrisjsewell commented 3 years ago

I guess this would be the starting point, if you wanted to dive more into what an extension is and how to write your own: https://www.sphinx-doc.org/en/master/development/tutorials/helloworld.html