[sphinx-users] Re: parse generated output from program

2020-01-17 Thread Peter Burdine
Make your own directive that runs your command. You can probably use the programoutput extension code as a reference for how to make the directive. Then use the nested_parse_with_titles function: from docutils import nodes from docutils.statemachine import ViewList def run(self): new_

[sphinx-users] External substitutions file

2020-01-17 Thread Olivier Carrere
Hi, How can I put all my substitutions in a dedicated, external file, and include them in my conf.py? I tried to insert an external substitutions file with via literalinclude with rst_prolog or rst_epilog, but then, substitions are not evaluated at build time and appear literally in the HTML

[sphinx-users] parse generated output from program

2020-01-17 Thread DexterMagnific
Dear all, I have some script that generates ReST content. I'd like to call this script from inside the rst document: blah blah blah .. execute-program:: generate-content.py myfile.bin I know there is sphinxcontrib.programoutput, but this extension inserts the output of the program. What i'd l

[sphinx-users] Custom command line variables and rst substitution

2020-01-17 Thread DexterMagnific
Dear all, I'd like to pass custom variables through the command line with -D. For this I use the following code: def setup(app): app.add_config_value('myVar', value, True) Now I'd like to reference them in my .rst file using |myVar|, just like for |version| but I cannot make it work.