spacemanspiff2007 / sphinx-exec-code

Run python code in sphinx and display the output
Apache License 2.0
12 stars 1 forks source link

Running code from python files. #1

Closed GrandMoff100 closed 2 years ago

GrandMoff100 commented 2 years ago

I understand that this plugin runs python code that is hard coded into the documentation. But in my use case I have example python files implementing my project that I would like run dynamically when building the documentation. Similar plugins have the option of doing something like the following:

.. exec-code::
   :filename: examples/hex_codes.py
   :linenos:

Do you think you could implement this for this project? Thanks!

GrandMoff100 commented 2 years ago

If you would rather not implement yourself, just say the word and I can open a PR for it.

spacemanspiff2007 commented 2 years ago

Available in 0.4.

You can also set the path to the example folder so you don't have to specify it with every exec-code directive.

Could you please report back to me if it works as intended?

GrandMoff100 commented 2 years ago

It works perecectly! Thank you!