Skip to content

docs: structure docs out of flat dir into tree#1662

Open
leondz wants to merge 2 commits intoNVIDIA:mainfrom
leondz:docs/add_dir_tree
Open

docs: structure docs out of flat dir into tree#1662
leondz wants to merge 2 commits intoNVIDIA:mainfrom
leondz:docs/add_dir_tree

Conversation

@leondz
Copy link
Copy Markdown
Collaborator

@leondz leondz commented Mar 31, 2026

Flat structure isn't working for docs any more. This PR structures them into a tentative dir setup.

  • Subdirs for categories having 3+ entries
  • File naming removes garak. prefix (they're all about garak)
  • category index files prefixed index_

This is a rough structure, feedback welcome

To test:

  • make -C docs/source

@leondz leondz added the documentation Improvements or additions to documentation label Mar 31, 2026
@leondz leondz requested review from mikemckiernan and removed request for patriciapampanelli March 31, 2026 16:40
Copy link
Copy Markdown
Collaborator

@jmartin-tech jmartin-tech left a comment

Choose a reason for hiding this comment

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

Sorry scope creep comment, should we match code structure file name convention, ex: detectors/always.rst instead of detectors/detectors.always.rst?

@leondz
Copy link
Copy Markdown
Collaborator Author

leondz commented Apr 1, 2026

Very in scope. I thought the same. Landed on this format (type.module) because some plugin modules of different have the same name, so including the type deconflicts the individual filename. On the other hand, the path is enough of a descriptor, and it works fine for the plugins themselves..

Actually, having now said that, maybe it would make sense to mirror the source dir structure??

@jmartin-tech
Copy link
Copy Markdown
Collaborator

I agree matching the source dir structure seems intuitive.

@mikemckiernan
Copy link
Copy Markdown
Member

I was just thinking about you folks a few hours ago!

The downside to directories--unless you cooked up something different--is that typically the directories beg for an index.md file in the directory so that a human at generators/generators.nim.html figures removing the page part of the URL should go to some navigation. An example of that navigation approach is at https://docs.nvidia.com/nemo/microservices/latest/audit/targets/index.html.

Also, you can make the navigation in the TOC more manageable without the directories, in case that was the true goal.

@leondz
Copy link
Copy Markdown
Collaborator Author

leondz commented Apr 2, 2026

Thanks @mikemckiernan for the tips!

Also, you can make the navigation in the TOC more manageable without the directories,

This wasn't the primary goal but would appreciate input/guidance here, there's room for improvement for sure

@mikemckiernan
Copy link
Copy Markdown
Member

Thanks @mikemckiernan for the tips!

Also, you can make the navigation in the TOC more manageable without the directories,

This wasn't the primary goal but would appreciate input/guidance here, there's room for improvement for sure

Sorry for commenting and then silence for > 24hrs. I just took another look and what's in main is what I meant to recommend:

image

It requires folks to click to discover content, but the information is available without expanding the TOC enormously.

Copy link
Copy Markdown
Member

@mikemckiernan mikemckiernan left a comment

Choose a reason for hiding this comment

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

Another disadvantage to the directories is consideration for any bookmarked content or current references to these docs. (I'm fairly sure that I made a few.) Please consider using sphinx-reredir if you truly prefer the directories.

@@ -0,0 +1,34 @@
Detectors
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Apologies for the lack of clarity about the index files. I meant to suggest that if you want the directories, that it is kindest to make a docs/source/detectors/index.rst with contents like this, but with revised local paths.

The point is that you'd want something to appear if someone types their way to https://reference.garak.ai/en/latest/detectors/.

@jmartin-tech jmartin-tech modified the milestone: 0.14.1 Apr 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants