Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: style guide: add hints about section ordering ...
and information of differences between inlcude and toctree. Renamed file to circumwent sphinx problems with include.
- Loading branch information
1 parent
65d02f9
commit 6e8af2e
Showing
4 changed files
with
56 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,3 +17,4 @@ Bareos Style Guide | |
seldom_text | ||
images | ||
releases | ||
trouble |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
Trouble | ||
======= | ||
|
||
toctree vs include | ||
------------------ | ||
|
||
include | ||
""""""" | ||
|
||
If a source file add another file via **include**, | ||
it will be integrated into the original source file (and not handled as a seperate file). | ||
|
||
As sphinx-build scans all matchin files during the build process, it takes toctree inclusion into account, but not plain **include** statements. As result, it will see the content of the included file twice: one as included file as part of the source file, once by the scan process during the build. Sphinx will then complain about double defined heading and references. | ||
|
||
To avoid this, included files should use a different extension as the normal files (included by toctree). | ||
|
||
* Extention of the master file and files included by **toctree**: ``*.rst`` | ||
* Extention of files included by **include**: ``*.rst.inc`` | ||
|
||
.. | ||
does include keep the document structre as toctree does? | ||
|
||
|
||
toctree | ||
""""""" | ||
|
||
* When using (nested) toctrees, make sure to define a section header above it. Otherwise the header line of the result document will show **<no title>** in the hierarchie of headings. | ||
|
||
* All files included by toctree start at the same section level. If the sections of a document should start at a lower level, a nested toctree element is needed. | ||
|
||
* **Important**: files names of files included via toctree are part of the URL of the document. That means, they are also part of the URL of the references/sections. And the URL will change when a section is moved to another place. Therefore inclusion via **toctree should be avoided**! |