about summary refs log tree commit diff
path: root/nixos/doc/manual/default.nix
AgeCommit message (Collapse)AuthorFilesLines
2023-08-16nixos/doc: small rephrase in documentation of documentationDoron Behar1-1/+1
Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
2023-08-12nixos/doc: Improve documentation of documentationDoron Behar1-1/+1
- Move contents of README.md from nixos/modules/installer/tools/manpages/ to nixos/doc/manual/contributing-to-this-manual.chapter.md. - Don't mention DocBook as its obsolete and too specific. - Rename derivation attribute name of configuration.nix(5) manual page, both on the `contributing-to-this-manual.chapter.md`, and in other places.
2023-08-12nixos/install-tools: Add manpages to packages instead of seperating themDoron Behar1-4/+2
Since each such `nixos-*` tool has it's own derivation, exposed in pkgs, There is no point in separating the manuals from the packages. If someone wishes to have the tools without the manuals, they can use meta.outputsToInstall to disable the installation of the manpages of these packages. This Fixes #244450.
2023-07-25nixos manual: extract some build pathsAlejandro Sanchez Medina1-7/+9
Co-authored-by: Shahar "Dawn" Or <mightyiampresence@gmail.com>
2023-07-10integration test driver: Auto-generate integration test driver's machineJacek Galowicz1-0/+5
method documentation of nixos docs from python doc strings
2023-06-16nixos/doc: set meta generator for html manuals properlypennae1-3/+1
we no longer have to look like docbook-xslt generates our manuals exclusively, so let's put something useful in there instead.
2023-06-16nixos/manual: remove docbook intermediatespennae1-116/+1
they're no longer used for anything.
2023-06-13nixos/make-options-doc: deprecate docbook outputspennae1-1/+1
they're no longer necessary for us and will almost definitely start to rot now (like commonmark and asciidoc outputs did previously). most existing users seem to take the docbook output and run it through pandoc to generate html, those can easily migrate to use commonmark instead. other users will hopefully pipe up when they notice that things they rely on are going away. optionsUsedDocbook has only been around for one release and only exposed to allow other places to generate warnings, so that does not deserve such precautions.
2023-06-13nixos/doc: remove docbook options compatibilitypennae1-62/+24
no longer needed or useful, and may even produce false positives now that markdown is the default language for option docs.
2023-06-13nixos/manual: disallow docbook option docspennae1-1/+2
it's been long in the making, and with 23.05 out we can finally disable docbook option docs and default to markdown instead. this brings a massive speed boost in manual and manpage builds, so much so that we may consider enabling user module documentation by default. we don't remove the docbook support code entirely yet because it's a lot all over, and probably better removed in multiple separate changes.
2023-06-12nixos/doc: stub out epub manualpennae1-4/+26
epub manuals are holding back the transition away from docbook, and cursory research does not suggest that they are used very much. it's still very early in the 23.11 release cycle, so if we're going to find out just how many people do use the epub manuals it should be now. this need not be the end of epub manuals. nixos-render-docs could be extended to also export epubs, but that has not been done yet since it's going to be some effort with unknown real-world usefulness.
2023-04-05nixos/manual: fix cross-compilationSergey1-1/+1
Remove absolute reference to xsltproc. This reference breaks cross-compilation: instead of host version builder tries to execute binary for target and fails.
2023-03-19nixos/manual: apply options preprocessing to full manualpennae1-1/+5
the conversion to the markdown-based workflow missed that generating the manual as docbook also generates the option docs with nixos-specific wrapper elements that require postprocessing before the document is real, valid docbook. restore this processing to the full manual. it's not the prettiest thing, done like this, but we only need it for one release so it doesn't have to be.
2023-02-21nixos/manual: render html with nixos-render-doc if !allowDocBookpennae1-29/+61
this reproduces the docbook-generated html manual exactly enough to appease the compare workflows while we still support both toolchains. it's also a lot faster than the docbook toolchain, rendering the entire html manual in about two seconds on this machine (while docbook needs about 20).
2023-02-18nixos-render-docs: use multiprocessing for optionspennae1-2/+2
options processing is pretty slow right now, mostly because the markdown-it-py parser is pure python (and with performance pessimizations at that). options parsing *is* embarassingly parallel though, so we can just fork out all the work to worker processes and collect the results. multiprocessing probably has a greater benefit on linux than on darwin since the worker spawning method darwin uses is less efficient than fork() on linux. this hasn't been tested on darwin, only on linux, but if anything darwin will be faster with its preferred method.
2023-02-12nixos-render-docs: add structural includes, use for manualpennae1-28/+19
this adds support for structural includes to nixos-render-docs. structural includes provide a way to denote the (sub)structure of the nixos manual in the markdown source files, very similar to how we used literal docbook blocks before, and are processed by nixos-render-docs without involvement of xml tooling. this will ultimately allow us to emit the nixos manual in other formats as well, e.g. html, without going through docbook at all. alternatives to this source layout were also considered: a parallel structure using e.g. toml files that describe the document tree and links to each part is possible, but much more complicated to implement than the solution chosen here and makes it harder to follow which files have what substructure. it also makes it much harder to include a substructure in the middle of a file. much the same goes for command-line arguments to the converter, only that command-lined arguments are even harder to specify correctly and cannot be reasonably pulled together from many places without involving another layer of tooling. cli arguments would also mean that the manual structure would be fixed in default.nix, which is also not ideal.
2023-02-12nixos/manual: clean up default.nix a bitpennae1-59/+33
- inline copySources into single user - remove `inherit sources` where it's not necessary - inline generatedSources. this will go away completely soon so we may as well. - inline modulesDoc into manual-combined. this too will go away soon. - inline sources into manual-combined. this too will go away soon.
2023-02-12nixos/manual: split manpages-combined from manual-combinedpennae1-39/+55
once we generate the entire manual-combined.xml with a single nixos-render-docs invocation we will no longer need any options xml files. likewise we do not need the test options xml in the manpage build. splitting manpages-combined from manual-combined also allows these two to run in parallel, slightly improving build times.
2023-02-10nixos/manual: remove md-to-dbpennae1-1/+0
with manual chapters no longer needing pandoc for their conversion to xml we can get rid of this source of confusion, and its huge cache of xml files.
2023-02-10nixos-render-docs: render manual chapters during manual buildpennae1-1/+24
render all manual chapters to docbook from scratch every time the manual is built. nixos-render-docs is quick enough at this to not worry about the cost (needing only about a second), and it means we can remove md-to-db.sh in the next commit. no changes to the rendered html manual except for replacements and smartquotes.
2023-02-10nixos-render-docs: rename manual docbook converter to docbook-sectionpennae1-1/+1
we'll soon add another docbook converter that does not emit a section as a collection of chapters, but sections or chapters on their own. this should clarify naming a bit before there can be any confusion.
2023-02-10nixos/manual: remove sources input from manpages drvpennae1-2/+1
it's not used. holdover from when manpages were written in docbook.
2023-02-08nixos-render-docs: add options manpage converterpennae1-10/+25
mdoc is just too slow to render on groff, and semantic markup doesn't help us any for generated pages. this produces a lot of changes to configuration.nix.5, but only few rendering changes. most of those seem to be place losing a space where docbook emitted roff code that did not faithfully represent the input text, though a few places also gained space where docbook dropped them. notably we also don't need the compatibility code docbook-xsl emitted because that problem was fixed over a decade ago. this will handle block quotes, which the docbook stylesheets turned into a mess of roff requests that ended up showing up in the output instead of being processed.
2023-02-06Merge pull request #206773 from SuperSandro2000/cleanup-unused-bindingsfigsoda1-1/+1
treewide: cleanup some unused bindings
2023-02-07treewide: cleanup some unused bindingsSandro Jäckel1-1/+1
2023-02-03nixos/manual: translate manpages to mdocpennae1-2/+7
since we want to move away from docbook and having docbook manpages around is going to block further progress we have to translate the current nixos manpages from docbook it *something* else. mdoc seems the most appropriate choice since markdown can't represent all the things manpages can differentiate with even more extensions. if we ever need html manpages we can render them using troff, like many of the online manpage viewers, or rewrite them again. since we haven't had html manpages for any of these in many years that seems unlikely to happen. unlike most of the recent markdown conversions this comes with a lot of minor rendering changes, mostly in spacing. docbook-xslt creates manual pages in a very different dialect than mdoc (which is used here).
2023-01-27nixos/manual: render module chapters with nixos-render-docspennae1-6/+9
this converts meta.doc into an md pointer, not an xml pointer. since we no longer need xml for manual chapters we can also remove support for manual chapters from md-to-db.sh since pandoc converts smart quotes to docbook quote elements and our nixos-render-docs does not we lose this distinction in the rendered output. that's probably not that bad, our stylesheet didn't make use of this anyway (and pre-23.05 versions of the chapters didn't use quote elements either). also updates the nixpkgs manual to clarify that option docs support all extensions (although it doesn't support headings at all, so heading anchors don't work by extension).
2023-01-26nixos/manual: remove olinkdbpennae1-33/+0
as far as we can tell nixos has only ever had a total of one olink, and currently has no olinks at all. we can't currently represent olinks in markdown docs, and if we re-add support for cross-document links they will take a different form (and not use docbook, which will have to be phased out before we re-add anything). the olinkdb is thus unused and takes 10 seconds on our machine to build, holding up the rest of the manual for no benefit.
2023-01-22nixos/documentation: deprecate docbook option docspennae1-1/+1
following the plan in https://github.com/NixOS/nixpkgs/pull/189318#discussion_r961764451 also adds an activation script to print the warning during activation instead of during build, otherwise folks using the new CLI that hides build logs by default might never see the warning.
2022-12-12doc: Remove all section numbersRobert Hensing1-3/+6
Simplicity. We use anchors nowadays. Nobody should be printing this.
2022-09-29nixos/doc: Disambiguate test option idsRobert Hensing1-0/+1
Changing this later on would break external links into the manual.
2022-09-24nixos/doc: Wire up the test options referenceRobert Hensing1-0/+28
2022-09-24nixos/testing: Improve option docsRobert Hensing1-0/+2
2022-09-10lib/options: deprecate docbook text and literalDocBookpennae1-1/+2
deprecate literalDocBook by adding a warning (that will not fire yet) to its uses and other docbook literal strings by adding optional warning message to mergeJSON.
2022-06-27nixos/doc: Make nixos-manual-combined fail easy to inspectRobert Hensing1-3/+3
By writing the unchecked outputs before checking them, they will be written to a store path, which appears in the log, and which sticks around even if the build fails. Eventually it is GCed, but until then, you can open the file. If you run it in a terminal+editor combination like VSCode, the failure location is just one Ctrl+click away.
2022-04-03nixos/man: prevent duplication of optionsJan Tojnar1-0/+4
libxslt 1.1.35 fixed conflict resolution for templates to match the specification. This uncovered a bug in docbook-xsl (https://github.com/docbook/xslt10-stylesheets/issues/240), which causes option names to be duplicated into the option descriptions. Let’s resolve the conflict by patching the stylesheets. Fixes: https://github.com/NixOS/nixpkgs/issues/166304
2022-01-08nixos/documentation: fix docs cross buildpennae1-1/+1
a few things should've used buildPackages/nativeBuildInputs to not not require the host architecture for building docs. tested by building aarch64-linux docs on x86_64-linux, and the result looks good.
2022-01-02nixos/make-options-doc: treat missing descriptions as errors by defaultpennae1-2/+11
this partially solves the problem of "missing description" warnings of the options doc build being lost by nix build, at the cost of failing builds that previously ran. an option to disable this behaviour is provided.
2022-01-02nixos/documentation: split options doc buildpennae1-4/+4
most modules can be evaluated for their documentation in a very restricted environment that doesn't include all of nixpkgs. this evaluation can then be cached and reused for subsequent builds, merging only documentation that has changed into the cached set. since nixos ships with a large number of modules of which only a few are used in any given config this can save evaluation a huge percentage of nixos options available in any given config. in tests of this caching, despite having to copy most of nixos/, saves about 80% of the time needed to build the system manual, or about two second on the machine used for testing. build time for a full system config shrank from 9.4s to 7.4s, while turning documentation off entirely shortened the build to 7.1s.
2021-12-06nixos/doc/manual: remove non-matching optionsXML inheritpennae1-1/+1
2021-01-26treewide: fold -> foldrBen Siraphob1-1/+1
2020-10-31nixos/manual: make reproducible (#102234)zimbatm1-0/+1
2019-10-30nixos manual: have a toc for each part and chapterFrederik Rietdijk1-1/+0
to be inline with the Nixpkgs manual. This makes navigating to particular sections easier.
2019-10-30nixos manual: reduce toc depthFrederik Rietdijk1-1/+1
to reduce the amount of information presented.
2019-08-08Extract NixOS options documentation generation to a functionDomen Kožar1-97/+9
Motivation is to support other repositories containing nixos modules that would like to generate options documentation: - nix-darwin - private repos - arion - ??
2019-03-09Merge pull request #55436 from layus/warn-manual-idsGraham Christensen1-1/+4
Nixos manual: error out on missing IDs
2019-03-05nixos: doc: increase maxdepth for xsltprocJan Malakhovski1-0/+1
See https://github.com/NixOS/nixpkgs/issues/37903#issuecomment-376618117 for details. With the previous patch and some custom modules included in `configuration.nix` the above bug is very easy to trigger. This is a simplest workaround I have. A proper solution would look like https://github.com/NixOS/nixpkgs/issues/37903#issuecomment-376980838.
2019-02-08nixos/manual: error out on missing IDsGuillaume Maudoux1-1/+4
2019-02-07nixos/manual: warn on missing xml:idGuillaume Maudoux1-0/+1
2018-09-23nixos: doc: rename `manual` to `manualHTML`, cleanup referencesJan Malakhovski1-1/+6
Because when I see "config.system.build.manual.manual" after I forgot what it means I ask "Why do I need that second `.manual` there again?". Doesn't happen with `config.system.build.manual.manualHTML`.