Yes, see the sphinx-jinja extension. It requires a yaml configuration for to load the context. However, IIRC, JSON is a subset of YAML so it should load directly.
Note that jinja is a pretty limited language and doing somethings in it is difficult (no loop control [break/continue]). If you find the sphinx-jinja extension github project, see my PR, it has that adds some features to the extension which make it more useful. https://github.com/tardyp/sphinx-jinja You can get the extension as is from pypi. --Peter On Friday, August 5, 2016 at 8:52:50 AM UTC-7, Markus wrote: > > Hello group, > > I need to create documentation containing a dynamic and large number of > sections, where the structure of each section basically is the same. It > contains some descriptive text and one or more tables. > > Both the data for the sections and the data for the tables basically comes > from a big JSON file. > > Now, if I understand things correctly, I need to dynamically create one or > more reST files which are then processed into static HTML pages. > > Is there a way I can use the Jinja template engine to generate those reST > files from a template and the JSON file? As far as I know Jinja should be > able to generate the reST files from a template just fine. Am I right? > > What I have no idea is how to integrate the generation of the reST files > into the normal Sphinx workflow, meaning that when I type e.g. "make html" > Sphinx first invokes Jinja to generate the reST sources and then processes > the generated sources along with other static reST documents into the final > HTML format. > > Do I need to write an extension for this? Is there any existing extension > I can use? Am I totally off the track with my approach? > > Thanks in advance for any advice, > Markus > -- You received this message because you are subscribed to the Google Groups "sphinx-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/sphinx-users. For more options, visit https://groups.google.com/d/optout.
