Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

doc: split modules into separate pages #873

Merged
merged 12 commits into from
Feb 23, 2025
Merged

doc: split modules into separate pages #873

merged 12 commits into from
Feb 23, 2025

Conversation

danth
Copy link
Owner

@danth danth commented Feb 17, 2025

This splits the generated option documentation into an separate page for each module, which makes it easier for users to browse and discover what is supported. Home Manager and NixOS options for each module are shown alongside each other, which makes it easier to notice when a module is available in both.

The current reference pages for Home Manager and NixOS now only show global options such as stylix.base16Scheme. The URL for these pages has also changed.

This pull request also makes it possible to add hand written documentation about a module, which can be done by creating a file modules/«module»/README.md. The file should follow the format:

# Module Name

Consider describing the application the module targets (if this is not obvious from the name),
how the application needs to be installed for the module to work correctly, which theming items
it supports (colors, fonts, wallpaper, ...), and any caveats the user should be aware of.

<!-- Automatically generated option documentation will be inserted below. -->

@danth danth added the documentation Improvements or additions to documentation label Feb 17, 2025
@danth danth linked an issue Feb 17, 2025 that may be closed by this pull request
@danth danth force-pushed the docs-split-modules branch from 8af267d to 1f3b46a Compare February 17, 2025 18:57
@danth danth changed the title docs: split modules into separate pages doc: split modules into separate pages Feb 17, 2025
@danth danth marked this pull request as ready for review February 17, 2025 20:28
@danth
Copy link
Owner Author

danth commented Feb 17, 2025

Follow-up tasks once this is merged:

  • Write content for the toplevel Platforms and Modules pages, potentially taken from the current Configuration page
  • Support rendering Nix Darwin options
  • Support rendering the list of testbeds for each module
  • Improve performance by reducing the number of times we call pkgs.nixosOptionsDoc

Copy link
Collaborator

@trueNAHO trueNAHO left a comment

Choose a reason for hiding this comment

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

Can we collapse long categories to avoid scalability issues, similar to NixVim's documentation?

Follow-up tasks once this is merged:

  • Support rendering Nix Darwin options

Also the future nixOnDroidModules.stylix options.

  • Support rendering the list of testbeds for each module

That would be neat.

  • Improve performance by reducing the number of times we call pkgs.nixosOptionsDoc

Yes, generating the documentation takes over one minute to build now.

@danth
Copy link
Owner Author

danth commented Feb 17, 2025

Can we collapse long categories to avoid scalability issues, similar to NixVim's documentation?

Do you mean collapsing the platforms and modules sections? Or separating NixOS/Home Manager options for each target into sub-pages?

Copy link
Collaborator

@trueNAHO trueNAHO left a comment

Choose a reason for hiding this comment

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

Can we collapse long categories to avoid scalability issues, similar to NixVim's documentation?

Do you mean collapsing the platforms and modules sections? Or separating NixOS/Home Manager options for each target into sub-pages?

The current section structure looks good. However, potential future sections following the "Modules" section might be hard to spot with such a large "Modules" index. To resolve this, we might want to treat the "Modules" section differently and collapse it in one of the following ways:

  • - Modules
      - *modules* (collapse)
    
  • - *Modules* (collapse)
    

If possible, the second approach seems simpler and better.

@danth danth force-pushed the docs-split-modules branch from 56183d3 to cdfc920 Compare February 18, 2025 14:34
@danth danth force-pushed the docs-split-modules branch from cdfc920 to 2719a5d Compare February 18, 2025 14:38
@danth
Copy link
Owner Author

danth commented Feb 18, 2025

I squashed most of the fixups into the original commits, so this should be suitable to merge with a merge commit to preserve the history.

@danth danth requested a review from trueNAHO February 18, 2025 15:13
This has two benefits:

1. It will be displayed when browsing the module source code on
   GitHub.
2. It prevents the documentation inadvertently disappearing if the
   module directory is renamed.
@danth danth force-pushed the docs-split-modules branch from 55108dc to 02f69d4 Compare February 19, 2025 13:46
@danth
Copy link
Owner Author

danth commented Feb 19, 2025

I think everything has been addressed, excluding the follow up tasks.

Copy link
Collaborator

@trueNAHO trueNAHO left a comment

Choose a reason for hiding this comment

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

LGTM, except for some nitpicks.

Feel free to merge after resolving these nitpicks.

danth and others added 4 commits February 23, 2025 15:20
Collapsing is only possible for pages, not headings, so I had to
combine platforms and modules into a single section and nest them
under draft pages.

Later, we could migrate some content from the configuration page to
these draft pages to make the flow of the book more natural.
@danth danth force-pushed the docs-split-modules branch from 3f99b28 to 1398fc4 Compare February 23, 2025 15:20
@danth danth dismissed trueNAHO’s stale review February 23, 2025 15:49

Requested changes have been addressed and another review is not required.

@danth danth merged commit f403ca1 into master Feb 23, 2025
57 checks passed
@danth danth deleted the docs-split-modules branch February 23, 2025 15:50
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.

doc: separate page for each target
2 participants