Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

idea: create a sphinx extension to insert output of flux commands in examples directly into docs #126

Open
grondo opened this issue Jan 21, 2022 · 1 comment

Comments

@grondo
Copy link
Contributor

grondo commented Jan 21, 2022

This is just an idea -- I'm unsure if it could work in practice, but it would be neat if we could develop a sphinx extension that could substitute output of flux command examples in the docs directly during the docs build.

There already exists a sphinxcontrib-programoutput extension that can substitute program output into docs at build time, e.g.:

.. command-output:: python -V

Output:

$ python -V
Python 2.7.1

Perhaps starting from this implementation, someone clever could create an extension that was capable of interacting with a Flux instance and would substitute output of commands. Perhaps our deployed docker images could be used in the Readthedocs build (not sure if that is possible).

@vsoch
Copy link
Member

vsoch commented Jan 30, 2023

This actually would work if we just had them generated in a running container, e.g., I do it with the flux-restful-api (although it's using python and interacting with flux via REST, see this tutorial: https://flux-framework.org/flux-restful-api/auto_examples/api_tutorial.html#sphx-glr-auto-examples-api-tutorial-py. That's possible with sphinx gallery which (typically) you run Python for - could you elaborate if you are just interested in running flux python examples or something else?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants