VirtualiZarr icon indicating copy to clipboard operation
VirtualiZarr copied to clipboard

Executable code examples in docs

Open TomNicholas opened this issue 1 year ago • 2 comments

The main usage docs revolve around code examples, but these are currently just hard-coded in. It would be good to generate these results automatically, and even better if the docs would display the lovely xarray HTML repr instead of the boring string repr.

I'm not sure what the best way to set that up with myst-markdown is. Do I need to rewrite the usage.md page as a jupyter notebook?

TomNicholas avatar Apr 13 '24 23:04 TomNicholas

Yes, if you use jupyter notebook files they will show the xarray HTML output. They can also be auto executed on compilation: https://jupyterbook.org/en/stable/content/execute.html

ayushnag avatar Apr 15 '24 17:04 ayushnag

If we use mkdocs (#500), we can use https://pawamoy.github.io/markdown-exec/ to execute code blocks in markdown.

maxrjones avatar May 26 '25 13:05 maxrjones

The usage guide includes executed codeblocks after #701

maxrjones avatar Jul 19 '25 23:07 maxrjones