I’m a big fan of Jupyter Notebooks. They’re a great way to document and explain code, and even better, you can run this code when connected to an appropriate kernel.
What if you want to work on something larger than a notebook? Say a chapter or even a whole book, with Python, R, Observable JS, or Julia code? Enter Quarto. You can combine Jupyter notebooks and/or plain text markdown to publish production quality articles, presentations, dashboards, website, blogs and books in HTML, PDF, Microsoft Word, ePub, and other formats. Quarto can also connect to publishing platforms like Posit Connect, Confluence Cloud, and others.
You can also use Pandoc, the universal document converter, to write using Pandoc markdown, while including equations, citations, cross references, figures, callouts, and other advanced layouts. You can learn more about Pandoc markdown basics; it even supports Mermaid and GraphViz diagrams.
You can use Jupyter Lab (with the Quarto JupyterLab extension) or VS Code to author content, too. If you’re working with R in RStudio (v2022.07 or later), you can create Quarto documents in RStudio using “File > New File > Quarto Document…”.
Once you’re ready to convert a Jupyter notebook, you can use quarto on the command line to ‘render’ into a different format, e.g. to output a Word document:
quarto render notebook.ipynb --to docx