-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
'only' directive exhibits strange behavior with headers #1115
Comments
From Takayuki Shimizukawa on 2013-02-21 14:53:10+00:00 I think that is sphinx (and docutils') limitation.
There is no As one way of the solutions to share the headlines throughout the file that means only directive did not include any headings. Another way to separate the directory for every platform and specify which directory you want to build in the |
From Jon Waltman on 2013-02-24 15:15:24+00:00 This behavior of the "only" directive has been changed since Sphinx 1.1.3 was released (see issue #886). It now works as expected in most cases and you can use higher level headings than those of the surrounding section. It appears that your example is one of the cases where it doesn't work as expected though. The section with the higher level heading "=" is treated as a subection of the first section "-". This is how your example would be processed:
Which generates the following pseodoxml:
You can work around this so long as the first section in the "only" directive is not lower than any other sections within the "only" directive. Eg:
The resulting pseodoxml is
|
From Ernst Haagsman on 2013-02-25 10:06:05+00:00 Confirmed, when I use the current development version it works as expected. Thanks for helping. |
From Takayuki Shimizukawa on 2013-02-26 06:11:04+00:00 fixed at #886 (after 1.1.3) |
When a heading inside an only block is of the same level of any heading present outside of the only block, that heading won't be displayed and neither will any content after that heading inside the only block.
Please see this reST for an example
The bug was reproduced on a clean VM with Xubuntu 12.10, Sphinx 1.1.3, Python 2.7.3 and no extensions enabled. Furthermore, the bug was reproduced by user 'nesv' on the #pocoo IRC channel.
Use case: I am documenting software which is tailored to user preferences. And for example, if the user wants the software without PostgeSQL support (as MongoDB is standard for our product) it is unnecessary to clutter, for example, the configuration documentation with many sections about PostgreSQL. So we would like to make these sections conditional depending on if the user chooses this.
The text was updated successfully, but these errors were encountered: