OpenNTI / sphinxcontrib-programoutput

Sphinx extension for capturing program output
BSD 3-Clause "New" or "Revised" License
38 stars 18 forks source link

[Request] Interpret output instead of inserting it #40

Closed DexterMagnific closed 4 years ago

DexterMagnific commented 4 years ago

Dear developer,

I was searching for an extension that inserts program output to rst document and found yours exactly matching my needs. Thanks a lot.

Now I have a feature request. Instead of inserting the program output, I'd like the output to be interpreted as ReST content. Usage is the following: We have some transform programs that extract data from custom file formats and turn them into ReST content. We would like to insert that content into our documentation while generating the doc. Something like this would be nice:

.. program-interpret-output: mytransform.py mydata.bin

The mytransform.py would be searched in a location stored in a custom program-output variable in conf.py.

Thanks a lot.

jamadden commented 4 years ago

Thanks for the request. That's not what this extension is for, though, and I'd prefer not to add the complication necessary to make it do that.

You may find another extension that already does that. Or, very simply, you can just .. include:: a file you generate. I've launched programs that generate files inside Sphinx's conf.py file — it's imported each time Sphinx starts, so anything you do at the top-level of that file will be run each time Sphinx is.