Slightly off topic, but I wonder if Quarto would work for you (https://quarto.org, disclaimer, I work for the company that maintains it). You write Markdown files with code blocks, and they're rendered into nice looking documents in a surprising range of possible form factors (see https://quarto.org/docs/gallery/).
You can also use .ipynb files as input instead of Markdown files and output to those same formats.
Traditionally, Quarto executes Python code at render time, but there's an extension called Quarto Live that lets you also incorporate Pyodide code blocks for the reader to use. https://r-wasm.github.io/quarto-live/ (I have not used Quarto Live before and have no idea what the limitations are.)