Skip to content

DOC Improve nested_sections#1326

Merged
lucyleeow merged 14 commits intosphinx-gallery:masterfrom
lucyleeow:doc_nest
Jun 20, 2024
Merged

DOC Improve nested_sections#1326
lucyleeow merged 14 commits intosphinx-gallery:masterfrom
lucyleeow:doc_nest

Conversation

@lucyleeow
Copy link
Copy Markdown
Contributor

Closes #1323

I find that I am confused whenever a nested_section issue comes up, so hopefully this doc improvement will jog my memory.

cc @alexisthual

should be move to a new subfolder, otherwise the sidebar
When ``nested_sections=True``, gallery examples located in the gallery's root
folder should be moved to a new subfolder, otherwise the sidebar
might not behave as expected (due to the fuzzy toctree structure).
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@alexisthual what do you mean by 'fuzzy' toctree structure?

Also do you know exactly what problem not moving examples to their own sub-folder causes?

Indeed Sphinx-Gallery has root gallery example files and this seems to play well with PST theme,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think I may have a better idea of the problem, it seems that having 2 toctrees in the index.rst may cause duplication (??) in the sidebar? Regardless, I think that putting all examples in their own sub-folder and none in the root gallery folder results in a single toctree in the gallery root index.rst.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Hopefully the change I made is correct, let me know @alexisthual !

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I am sorry, I don't remember what I exactly meant by 'fuzzy toctree structure', but I think your second comment here gives the right intuition.

@larsoner
Copy link
Copy Markdown
Contributor

@lucyleeow I would say feel free to merge once you're happy and we can always improve the wording later if @alexisthual gets back to us!

@lucyleeow lucyleeow enabled auto-merge (squash) June 20, 2024 01:16
@lucyleeow lucyleeow merged commit 2bd7410 into sphinx-gallery:master Jun 20, 2024
@lucyleeow lucyleeow deleted the doc_nest branch June 20, 2024 01:22
larsoner added a commit to jschueller/sphinx-gallery that referenced this pull request Jun 20, 2024
* upstream/master:
  MNT: Refactor `generate_dir_rst` and `generate_gallery_rst` (sphinx-gallery#1332)
  MNT: Refactor `generate_file_rst` (sphinx-gallery#1335)
  MNT: Refactor `_fill_gallery_conf_defaults` (sphinx-gallery#1334)
  MNT Use `os.sep` everywhere (sphinx-gallery#1333)
  DOC Improve `nested_sections` (sphinx-gallery#1326)
@alexisthual
Copy link
Copy Markdown
Contributor

Sorry, I am a bit late in the game, but this PR looks great to me, and I think @lucyleeow did a wonderful job in addressing #1323

@lucyleeow
Copy link
Copy Markdown
Contributor Author

Thanks @alexisthual , I am still curious though, what does 'fuzzy toctree structure' mean?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Navigation bar TOC rendering for nested galleries

3 participants