On Fri, Aug 5, 2016 at 8:07 AM, Markus <[email protected]> wrote:

>
> Is there a way I can use the Jinja template engine to generate those reST
> files from a template and the JSON file?
>

sure -- I can't say I've done it, but Jinja should work fine with RST.


> 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.
>

"make html" is simply invoking the Makefile that spinx helpfully created
for you. Here is part of one of mine:

html:
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."

This is the part that gets invoked when you type "make html" -- you cansee
there isn't much to it -- all it's doing is calling shpinx with the
variables set up above, and then giving you a message.

you could any an command line before the sphinx call there.

So what command to add?

I'd write a hacked together python script that loads up your JSON and runs
it through Jinja to generate your rst. If it's purpose specific, it should
be a pretty small and quick script to write.

-CHB


-- 

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

[email protected]

-- 
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.

Reply via email to