The "only" directive might be useful too, depending on your use case.
Kevin Horn On Mon, Aug 1, 2011 at 4:03 AM, Alastair Dent <alastair.d...@imgtec.com>wrote: > Hi, > I found I could do this using ifconfig extension and the exclusion list in > config.py. > > The ifconfig extension allows you to conditionally include text. The > exclusion takes a list of rst files and excludes them from the build. > > The syntax of exclude_patterns is: > > exclude_patterns = ['anrstfile.rst', 'directorypath/'] > > There is one niggle with this exclude; if there is a relative link to any > excluded file, then exclude_patterns is ignored and the file is included. > > > > -----Original Message----- > From: sphinx-dev@googlegroups.com [mailto:sphinx-dev@googlegroups.com] On > Behalf Of Koen > Sent: 30 July 2011 13:30 > To: sphinx-dev > Subject: [sphinx-dev] Re: conditional exclusion of rst files > > I was having the same type of question: > > I have a documentation project for division x and I would like to have the > same documentation for division Y but only some files are different. > > So question is, what is the best approach to setup a correct structure for > this? > (both should have a different build html) > > What I would think as a structure: > > top_dir > | > |---- MakeFile > |---- build > |---------divisionx > |---------doctrees > |---------html_div_x > |---------divisiony > |---------doctrees > |---------html_div_x > |---- sources > |------ conf.py > |------ index_division_x.rst > |------ index_division_y.rst > |------ general sources > |------ all general rst files > |------ divisionXspecific > |------- Specific rst files for x > |------ divisionYspecific > |------- specific rst files for y > > So goal would be to reuse the general files and add the specific files for > every division. > > At the moment I dont directly see how I could do this. > An exclude based on a build parameter would be nice. > > Problem now is that the conf.py is linked to one index masterfile. > > Only possibility I see now is to create two different sphinx projects for > each division and symlink the general rst files but this does not feels as > the proper way to do it? > > If somebody has some pointers on this would be nice to hear your opinion on > this. > > > On Jul 20, 12:39 pm, "Alastair Dent" <alastair.d...@imgtec.com> wrote: > > I need to be able to exclude specific rst files, depending on a built > > parameter. > > > > Is there an extension that will enable this? > > -- > You received this message because you are subscribed to the Google Groups > "sphinx-dev" group. > To post to this group, send email to sphinx-dev@googlegroups.com. > To unsubscribe from this group, send email to > sphinx-dev+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/sphinx-dev?hl=en. > > > -- > You received this message because you are subscribed to the Google Groups > "sphinx-dev" group. > To post to this group, send email to sphinx-dev@googlegroups.com. > To unsubscribe from this group, send email to > sphinx-dev+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/sphinx-dev?hl=en. > > -- You received this message because you are subscribed to the Google Groups "sphinx-dev" group. To post to this group, send email to sphinx-dev@googlegroups.com. To unsubscribe from this group, send email to sphinx-dev+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sphinx-dev?hl=en.