docs
docs copied to clipboard
Improve appended toctrees for children
🦟 Bug fix
No issue oppened
Summary
When creating a doc file with children, if the user writing forgets to add a break at the end of the file, the toctree is not separated from the text.
Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining Signed-off-by messages.
Sure! I will exemplify the steps to reproduce here:
- If the .md of a
pagethat has children has a break at the end as in this example: https://github.com/gazebosim/docs/blob/a574980d6aa853ac52af0a03f02f2e08d345fa89/harmonic/tutorials.md?plain=1#L49
The end of the intermediate file generated in the .tmp/harmonic/tutorials.md will look like this (without the \ before the `):
[Rest of the file]
- [Utils](/api/utils/2/tutorials.html){.external}
- [Sdformat](/api/sdformat/13/){.external} <- Here there is a break in the original tutorials.md file
\```{toctree}
:hidden:
:maxdepth: 1
:titlesonly:
Building your own robot <building_robot>
Moving the robot <moving_robot>
SDF worlds <sdf_worlds>
Sensors <sensors>
Actors <actors>
Understanding the GUI <gui>
Manipulating Models <manipulating_models>
Model Insertion from Fuel <fuel_insert>
Keyboard Shortcuts <hotkeys>
Spawn URDF <spawn_urdf>
\```
- However, if the .md has not a break at the end, the generated file looks like:
[Rest of the file]
- [Utils](/api/utils/2/tutorials.html){.external}
- [Sdformat](/api/sdformat/13/){.external} \```{toctree}
:hidden:
:maxdepth: 1
:titlesonly:
Building your own robot <building_robot>
Moving the robot <moving_robot>
SDF worlds <sdf_worlds>
Sensors <sensors>
Actors <actors>
Understanding the GUI <gui>
Manipulating Models <manipulating_models>
Model Insertion from Fuel <fuel_insert>
Keyboard Shortcuts <hotkeys>
Spawn URDF <spawn_urdf>
\```
which messes up the whole toctree affecting the resulting web template.
Leaving additional spaces is not a problem.