master_doc variable doesn't influence html/latex builders

32 views
Skip to first unread message

Dessus Ph.

unread,
Sep 1, 2017, 8:15:49 AM9/1/17
to sphinx-users
dear all,

I'm currently working on a large set of sphinx files of which I want to produce different subsets with different outputs (mainly HTML/PDF). 
So I've written different index files to be compiled.

My problem is that putting the index file name in the master_doc variable only affects, AFAIK, the singlehtml output, both html and latex make commands don't use the master_doc specified index (they compile indifferently all the files in the folder whatever the index name is).

I'm aware that intersphinx would fix this problem but with a too complicated folder structure (it's more convenient to me to have all the files in a same folder).

Any ideas on how to specify the compilation of a given set of files as an index?

best and thx!
philippe

Peter Burdine

unread,
Sep 1, 2017, 10:39:35 AM9/1/17
to sphinx-users
We do the same thing here, produce a bunch of documents from a common set of files.  We are on Windows, which makes it a little difficult, so we run Sphinx from a Cygwin environment.  Then we create individual document directories.  To get the common content we create links from within Cygwin to make the common content appear under each document directory.  This way each document can be built the way we want it.

--Peter

Dessus Ph.

unread,
Sep 1, 2017, 11:32:02 AM9/1/17
to sphinx-users
thx Peter,
1. Sphinx can run pretty well on Windows, AFAIK. Follow the install instructions.
2. Good idea; a bit tricky, but I'll try it. No more elegant solution ? ;-)
best,
ph

Peter Burdine

unread,
Sep 5, 2017, 7:01:12 PM9/5/17
to sphinx...@googlegroups.com
Creating the links and scripting it is much easier with a Cygwin env because it has all of the utilities built in (find, make, etc).  If we had to create our management scripts using ps/bat, I would probably just give up.

To expand on what we do, we actually create a file with a listing of all the link source/target pairs (that gets checked into SVN), then have a Python script to looks for all the links in the project and deletes the incorrect ones and makes the correct ones, then adds them to the SVN ignore list.  This is a pain on Windows because it doesn't understand relative links, it is actually an absolute link, so depending on where people check their SVN repo out, their links are different.  Also, SVN on windows doesn't understand links (because windows...), hence the bit about adding them to the ignore list and not checking them in.

This approach solves two of our problems:
1) Getting content from outside of the source directory
2) The ability to include a file more than once.   We are also using the jinja extension and a modified toctree directive so the files can get rendered in a different context depending on the path to the file.

--
You received this message because you are subscribed to a topic in the Google Groups "sphinx-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/sphinx-users/enM8GeHc680/unsubscribe.
To unsubscribe from this group and all its topics, send an email to sphinx-users+unsubscribe@googlegroups.com.
To post to this group, send email to sphinx...@googlegroups.com.
Visit this group at https://groups.google.com/group/sphinx-users.
For more options, visit https://groups.google.com/d/optout.

Dessus Ph.

unread,
Sep 18, 2017, 5:42:31 PM9/18/17
to sphinx-users
dear Peter,
Thx for this comprehensive description. I've tried your first advice and its surprisingly doable ; and since I've a bulk of docs to manage separately, no need to use specific scripts.
I've hard linked all the rst files, but not the conf.py, the index (to do specific tweaks), and all the images (so need to change them individually if any change occur).
I generated LaTeX files smoothly.
thx!
best,
ph
To unsubscribe from this group and all its topics, send an email to sphinx-users...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages