Skip to content

Improve appended toctrees for children #581

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dvdmc
Copy link

@dvdmc dvdmc commented Mar 28, 2025

🦟 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.

Ensure that the appended toctree for childrens .md are separated from the parent .md text

Signed-off-by: David Morilla Cabello <davidmorillacabello@gmail.com>
Copy link
Contributor

@ahcorde ahcorde left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HI @dvdmc, thank you for your contribution.

Can you add two picture with the before and after of this patch.

Thank you

@github-project-automation github-project-automation bot moved this from Inbox to In review in Core development Mar 28, 2025
@dvdmc
Copy link
Author

dvdmc commented Mar 29, 2025

Sure! I will exemplify the steps to reproduce here:

  • If the .md of a page that has children has a break at the end as in this example:
    - [Sdformat](/api/sdformat/13/){.external}

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.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
🎵 harmonic Gazebo Harmonic
Projects
Status: In review
Development

Successfully merging this pull request may close these issues.

2 participants