[Techtalk] sphinx rst-- generate 2 different HTML index pages from one source file

Carla Schroder carla at bratgrrl.com
Sat Mar 7 01:03:28 UTC 2015


Certain people at my company are quite sure that there is a way for
Sphinx to build a single index.rst into two versions: one with .org
URLs, built with 'make html', and one with .com URLs, built with 'make
html-com'. Of course they're rather shy on the details. First Sphinx
builds the docs, and then Jenkins does some kind of voodoo and uploads
them to the Web sites.

What puzzles me is figuring out some kind of attribute to create any
conditionals on-- there is no user input, like Y or N, or any other
external action other than the make commands, so I'm starting to think
they're full of hooey. 

Carla

On Fri, 6 Mar 2015 16:44:54 -0800
Carla Schroder <carla at bratgrrl.com> wrote:

> Sorry, I am not getting it! How will that edit the contents of the
> file? Look at my examples again-- one index.html has .org URLs, and
> the other has .com URLs. If all I needed was the exact same file for
> both sites there would be no problem :)
> 
> 
> Carla
> 
> On Sat, 07 Mar 2015 09:17:25 +1000
> Miriam English <mim at miriam-english.org> wrote:
> 
> > Hi Carla,
> > 
> > I may be barking up the wrong tree completely and misunderstanding
> > what you want, but it sounds like a symbolic link is all that's
> > required. So you could, for instance make the .htm a link to
> > the .html file. That way when you update the .html file nothing
> > needs to be done for the .htm one because when fetched it will still
> > actually be the .html one.
> > 
> > Cheers,
> > 
> > 	- Miriam
> > 
> > 
> > On 07/03/15 04:20, Carla Schroder wrote:
> > >
> > > Hola techtalkers,
> > >
> > > I have been assigned the task of creating a single source .rst
> > > file, index.html, to create a documentation index for two domains,
> > > one .com and one .org. The doc index is the same except for the
> > > domains, so the output needs to look like this:
> > >
> > >
> > > http://doc.example.com/admin_manual < print this link in
> > > index.html only for the .com site
> > >
> > > http://doc.example.org/admin_manual < print this link in
> > > index.html only for the .org site
> > >
> > > The site builder (Jenkins) automatically builds the manuals from a
> > > single repo to both sites. That part is easy, because Sphinx' Make
> > > targets automatically build both .com and .org versions, and then
> > > there are two separate Jenkins jobs, one for .com and one
> > > for .org.
> > >
> > > One option is to create two documentation index pages: one html
> > > and one htm. But my overlords really want a single source page
> > > all full of conditionals for html only, and I'm pretty sure it
> > > can be done. I know how to to do simple subsitutions with ..
> > > ifconfig:: , but I haven't a clue how to write conditionals that
> > > parse URLs for specific domains.
> > >
> > > Sphinx is abundantly-documented, but unfortunately not in a very
> > > helpful way.
> > >
> > > TIA,
> > > Carla
> > >
> > 
> 
> 
> 



-- 
++++++++++++++++++++++++++++++++++++++++
Ace Linux guru                         +
carlaschroder.com                      +
There's a dance in the old dame yet    +
++++++++++++++++++++++++++++++++++++++++


More information about the Techtalk mailing list