qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v3 08/12] docs: Provide separate conf.py for eac


From: Cleber Rosa
Subject: Re: [Qemu-devel] [PATCH v3 08/12] docs: Provide separate conf.py for each manual we want
Date: Thu, 7 Mar 2019 07:14:17 -0500
User-agent: NeoMutt/20180716

On Thu, Mar 07, 2019 at 09:49:44AM +0000, Peter Maydell wrote:
> On Thu, 7 Mar 2019 at 01:40, Cleber Rosa <address@hidden> wrote:
> > I have the impression that this can be simplified by making use of
> > "only" tags:
> >
> > https://www.sphinx-doc.org/en/master/usage/restructuredtext/directives.html#directive-only
> >
> > So, conf.py could detect if it's being run on readthedocs.org:
> >
> >   ON_RTD = os.environ.get('READTHEDOCS', None) == 'True'
> >
> > And manipulate the "tags" variable accordingly:
> >
> >   if ON_RTD:
> >      tags.add('devel')
> >      tags.add('interop')
> >
> > Then, on an index.rst, it could be a simple matter of:
> >
> > .. only:: devel
> > ================
> > Developers Guide
> > ================
> > .. toctree::
> >    docs/devel
> >
> > .. only:: interop
> > =============
> > Interop Guide
> > =============
> > .. toctree::
> >    docs/interop
> >
> > .. only:: devel and interop
> > ===============
> > QEMU Full Guide
> > ===============
> > .. toctree::
> >    docs/devel
> >    docs/interop
> 
> Thanks for pointing out the tags functionality. That said,
> this won't do what we want, will it?
>  * building the docs gives all the docs in the build tree
>  * but we only install via 'make install' the ones the user wants
>

It should be doable.  I put a PoC here:

  https://github.com/clebergnu/sphinx-conditional-project/tree/master

I'm understanding that the `make install` step is nothing but a copy
of the produced build.  For this PoC, I used an HTML builder.

> thanks
> -- PMM

Regards,
- Cleber.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]