sphinx-contrib/datatemplates

Multiple pages from one template possible?

cdeil opened this issue · 5 comments

cdeil commented

Is it possible to generate multiple RST pages if a have a JSON or YAML file with a list of datasets?
Or is it only possible to insert content into one page?

If you have time to respond, I think that might be a pretty common question you could explain in the docs?

The directive works by inserting rst into an existing document. You could create separate rst files by hand, but the template would somehow need to get some instructions about which part of the dataset to include in each location. Maybe the body of the directive could include some Python code to set up context variables for the template rendering. I'll give that some thought.

cdeil commented

You could create separate rst files by hand

What is the common way to do this?
Add steps to Makefile? Add code to conf.py? Add Sphinx extensions?

I realise that is a newbie question, but if you have a short answer on what good practices or examples are to generate Sphinx website from multiple datasets, that would be much appreciated.

I don't commonly generate rst files during the build process. I meant to literally create separate files using your text editor and put them in version control system with the other content you have. That wouldn't be useful to you until the features I mentioned are implemented, like running Python code from the directive to pre-process the data.

#45 and #56 are related to this issue.

I think this question has been answered. Please reopen it if you still need help.