Commit Graph

29 Commits

Author SHA1 Message Date
Johannes Kirschbauer
f34ca9940a pkgs/nixos-render-docs: add prepend content via 'experimental-config'
This new mode is supposed to absorb content that is currently added via --infile and recursive {=include=}
As we restructure the nixpkgs manual we are going to add pages to this file
As a result we end up with a config file that describes the sidebar structure and what files map to which entry
This is needed for 'docs.nixos.org' navigation cutover; which will consume this file along with the .md files and render it into the portal
2026-08-05 15:14:08 +02:00
Johannes Kirschbauer
4388cd791a doc/doc-support: inject custom header via nixos-render-docs --header 2026-07-13 14:30:39 +02:00
Johannes Kirschbauer
e4f7bfed18 pkgs/nixos-render-docs: add sidebar-open and popover for mobile support 2026-07-02 17:17:25 +02:00
Johannes Kirschbauer
ad97f5573d pkgs/nixos-render-docs: replace inlince tocs with collapsible sidebar
tables of contents disconnect headings from body text.
decouples heading levels from include type (part,chapter,part etc.)
structure of the sidebar is derived from the include type for now.
Can be changed to a meta file later.

sidebar now uses proper ol-, li-, span-, a-tags
definition tables are not ideal for navigation and accessibility

breaking change:
--toc-depth, --chunk-toc-depth, --section-toc-depth is
now collapsed into --sidebar-depth
2026-07-02 15:44:56 +02:00
jopejoe1
58c1ec779f treewide: replace lib.trivial.version with lib.trivial.release 2026-02-16 09:45:06 +01:00
Hythera
a49f171236 nixpkgs-manual: set pname and version 2026-02-06 17:02:11 +01:00
Silvan Mosberger
91ff1ffa45 ci: Don't run non-reproducible doc urls check
Causes non-reproducible CI failures: https://github.com/NixOS/nixpkgs/actions/runs/21102527291/job/60688698991?pr=480436
2026-01-20 20:51:55 +01:00
Valentin Gagarin
14699ab9b6 fix escaping in documentation helper shell 2025-12-15 09:26:47 +01:00
Wolfgang Walther
91a8fee3aa treewide: remove redundant parentheses
Auto-fixed by nixf-diagnose.
2025-10-05 10:52:03 +02:00
Robert Hensing
e9f9e2dab1 doc: Add Modules, modules.generic.meta-maintainers 2025-08-17 20:46:22 +02:00
Wolfgang Walther
a7b3b2584a ci/treefmt: add markdown-code-runner
This was run as a test in `doc/tests/check-nix-code-blocks.nix` before,
but its DX can be improved: By including it in `treefmt` we get better
error reporting and auto-fixing, as well as running it on *all* markdown
files (including READMEs etc.) for free.
2025-08-05 17:30:41 +02:00
Philip Taron
b3b4fccfea doc: do-nothing change to trigger a nixpkgs-manual rebuild 2025-06-10 16:37:54 -07:00
anthony
b5bd640a92 doc: fix nixpkgs-manual not being built under index.html (#400816)
This fixes the anchor links referencing `index.html` while being in `manual.html`.
2025-05-20 13:10:36 +02:00
Matt Sturgeon
4c638c2735 doc/packages/treefmt: add option reference docs
Add a `treefmt.optionsDoc` passthru, which is included on the treefmt
section of the nixpkgs manual.

This generates reference docs for options declared in
`treefmt.evalConfig`.
2025-05-20 07:52:11 +02:00
Matt Sturgeon
301824d216 doc/packages/treefmt: add function reference docs
Add a `treefmt.functionsDoc` passthru, which is included on the treefmt
section of the nixpkgs manual.

This generates reference docs for functions defined in
`pkgs/by-name/tr/treefmt/lib.nix`, using `nixdoc`.
2025-05-20 07:52:11 +02:00
Marcell Tóth
c11863f1e9 doc, nixos/doc: include roboto font
Roboto was already set as the font for the manuals,
but without a way to get it, so people who didn't
happen to have it installed saw their default font
2025-04-21 13:18:05 +02:00
Pol Dellaiera
47f000d991 doc: add missing phase hooks 2025-04-21 07:02:49 +02:00
Pol Dellaiera
58cdd4e315 {nixpkgs-manual, nixos-manual}: add new test check-nix-code-blocks 2025-04-17 01:30:34 +02:00
Valentin Gagarin
61235d4471 docs: fix devmode for manuals
hard-coding a relative path will use the calling process's working
directory, but we want the path relative to the Nix expression.
2025-01-24 18:05:03 +01:00
Emily
2eae7d63e2 nixpkgs-manual: avoid lib.fileset
I don’t love this, and I’m not convinced it doesn’t have the
same pitfalls as filesets, but see the `flattenReferencesGraph`
commit for reasoning.

It may be better to ban the relevant builtins entirely and just move
things into subdirectories when needed, but I didn’t want to do
more surgery to this part of the tree than necessary to solve the
immediate problem.
2024-12-31 02:30:18 +00:00
Priyanshu Tripathi
836d207c6c nixos-render-docs-redirects: init (#357383)
Co-authored-by: Valentin Gagarin <valentin@gagarin.work>
2024-11-29 15:03:08 +01:00
GetPsyched
5b8a714968 nixos-render-docs: init redirects system
Co-authored-by: Valentin Gagarin <valentin@gagarin.work>
2024-11-15 14:09:21 +01:00
Valentin Gagarin
50ff833cd8 devmode: move to pkgs/by-name
now one can use `devmode` from anywhere Nixpkgs is available:

    devmode = pkgs.devmode.override {
      buildArgs = toString ./.;
      open = "/index.html";
    };
2024-11-12 10:16:58 +01:00
Valentin Gagarin
b94f54b7a0 devmode: make reusable
the `devmode` helper made for the Nixpkgs/NixOS manual was exposed wrapped
in `mkShell`, which made it impossible to reuse.

this change strips that wrapper and reproduces it at the call site.

now one can use `devmode` from anywhere Nixpkgs is available:

    devmode = pkgs.callPackage "${pkgs.path}/pkgs/tools/nix/web-devmode.nix" {
      buildArgs = toString ./.;
      open = "/index.html";
    };
2024-11-12 10:16:58 +01:00
Philip Taron
587f64a264 nixpkgs-manual: use injected revision only
`lib.trivial.revisionWithDefault` will change with every Git commit, which causes the manual to be rebuilt on every since PR.

Using `nixpkgs.rev` (or the dummy value "master" if it's not present) means that the manual will contain the revision if built on Hydra, but will not otherwise.

Why?

1. https://hydra.nixos.org/jobset/nixos/trunk-combined#tabs-configuration shows that `pkgs/top-level/release.nix` is passed the `nixpkgs` attrset, which is a "Git checkout".
2. Git checkouts come from [`builtins.fetchGit`](https://nix.dev/manual/nix/2.18/language/builtins#builtins-fetchGit) and include the `rev` attribute.
3. The `rev` attribute is what `lib.trivial.revisionWithDefault` would have returned.

So, using `nixpkgs.rev or "master"` exclusively will cause the rebuilds on every commit to cease, but will allow "official" nixpkgs manual built on Hydra to continue to reference a specific commit.
2024-07-29 11:29:15 -07:00
Philip Taron
b846df0a2e nixpkgs-manual: inline common.nix 2024-07-26 13:46:13 -07:00
Philip Taron
eaa7811104 nixpkgs-manual: move shell to package 2024-07-26 13:46:12 -07:00
Philip Taron
b5dc82844f nixpkgs-manual: init 2024-07-26 13:46:12 -07:00
Philip Taron
4252286f21 doc: extract nixpkgs-manual into its own package
Also, use `finalAttrs` style and pass through all the helper derivations.
2024-07-26 13:44:04 -07:00