summary refs log tree commit diff
path: root/nixos/lib/make-options-doc
Commit message (Collapse)AuthorAge
* nixos/make-options-doc: deprecate docbook outputspennae2023-06-13
| | | | | | | | | | | | | 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.
* nixos/doc: remove docbook options compatibilitypennae2023-06-13
| | | | | no longer needed or useful, and may even produce false positives now that markdown is the default language for option docs.
* nixos/make-options-doc: remove options postprocessingpennae2023-06-13
| | | | | | | with everything being rendered from markdown now we no longer need to postprocess any options.xml that may be requested from elsewhere. we'll don't need to keep the module path check either since that's done by optionsJSON now.
* nixos/make-options-doc: check for manual paths in options.jsonpennae2023-06-13
| | | | | since we no longer use the docbook path the check there will no longer fire. add one to optionsJSON to not lose this functionality.
* nixos-render-docs: default to markdown for optionspennae2023-06-13
| | | | | | docbook is now gone and we can flip the defaults. we won't keep the command line args around (unlike the make-options-docs argument) because nixos-render-docs should not be considered an exposed API.
* nixos/make-options-doc: force markdownByDefaultpennae2023-06-13
| | | | | | | with docbook no longer supported we can default to markdown option docs. we'll keep the parameter around for a bit to not break external users who set it to true. we don't know of any users that do, so the deprecation period may be rather short for this one.
* nixos/manual: disallow docbook option docspennae2023-06-13
| | | | | | | | | | 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.
* nixos-render-docs: add options asciidoc converterpennae2023-02-21
| | | | same reasoning as for the earlier commonmark converter.
* nixos-render-docs: add options commonmark converterpennae2023-02-21
| | | | | | | the old method of pasting parts of options.json into a markdown document and hoping for the best no longer works now that options.json contains more than just docbook. given the infrastructure we have now we can actually render options.md properly, so we may as well do that.
* nixos-render-docs: use multiprocessing for optionspennae2023-02-18
| | | | | | | | | | | | | 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.
* nixos/make-options-doc: fix related packages link labelpennae2023-02-08
| | | | the pkgs path literal surely shouldn't include the title, right?
* nixos-render-docs: add some better CLI infrastructurepennae2023-01-27
| | | | | | using environment variables isn't great once multiple input or output formats get involved (which will happen soon). now is a good time to set a pattern for future converters.
* nixos-render-docs: init from optionsToDocbook.pypennae2023-01-27
| | | | | | this new package shall eventually contain the rendering code necessary to produce the entirety of the nixos (not nixpkgs) manual, in all of its various output formats.
* nixos/make-options-doc: enable smartquotes and replacementspennae2023-01-26
| | | | | | | | | | the rest of the nixos manual has them enabled, so we should enable them here too for consistency. this changes rendered output pervasively. changes also include quotes in types (eg in `strings concatenated with "\n"`), but since those are not code this is probably fine. if not we can probably add a myst role to inhibit replacements.
* nixos/make-options-doc: render option types through mdpennae2023-01-26
| | | | no changes to rendered output, but options.xml loses a few spaces.
* nixos/make-options-doc: disable inline htmlpennae2023-01-26
| | | | | we target not only html, but also manpages. inline html is not helpful for the latter.
* nixos/make-option-docs: wrap md parser+renderer into Converterpennae2023-01-26
| | | | | the new rendering tool will consist of a number of different Converters, each with a possibly specialized Renderer.
* nixos/make-options-doc: don't use inspect for optionsToDocbookpennae2023-01-26
| | | | | | the rules are fixed, and we want to support all of them (or throw a useful error message). this will also become the base for a generic renderer system, so let's just list all the rules statically.
* nixos/optionsToDocbook.py: Add docbook ns for when the appendix tag is omittedRobert Hensing2023-01-26
|
* nixos/make-options-doc: split docbook conversion from mergeJSONpennae2023-01-26
| | | | | | | | | | | | | | | | | | | this restores mergeJSON to its former glory if…merging json, and extracts the MD rendering into a new script that will run instead of the py+nix+xslt pipeline we previously ran to convert options.json to docbook. this change alone gives a noticable performance boost when building docs (18s instead of 27s to build optionsDocBook). no changes to rendered output, except for a single example in the rsnapshot module that uses hard tabs for indentation instead of spaces. this probably isn't important. docbook warnings remain with mergeJSON since the other processing steps output single files instead of directories. since we'll only keep the check until 23.11 this is probably also not important to fix. also contains a few improvements to error reporting in the MD renderers.
* nixos/make-options-doc: remove program argument to xsltpennae2023-01-26
| | | | | this doesn't seem to be set anywhere, not from make-options-doc nor anywhere else.
* nixos/make-options-doc: use markdown-it-py for renderingpennae2023-01-22
| | | | | | only whitespace changes (mostly empty descriptions rendered as literal line breaks and trailing space toPretty generates, but that were dropped by mistune).
* nixos/make-options-doc: render related packages with mdpennae2023-01-22
| | | | | | | don't generate docbook for related packages, generate markdown instead. this could be extended further to not even generate markdown but have mergeJSON handle all of the rendering. markdown will work fine for now though.
* nixos/make-options-doc: deprecate \n\n parbreakpennae2023-01-22
| | | | | | | only whitespace changes to rendered outputs, all in the vicinity or body of admonitions. previously admonitions would not receive paragraph breaks even when they should have because the description postprocessing did not match on their contents.
* nixos/make-options-doc: rearrange paras in related packages/defaults/examplespennae2023-01-22
| | | | | this mirrors what we will be able to create with markdown. no change to rendered outputs.
* nixos/make-options-doc: render default/example contents through MDpennae2023-01-22
| | | | removes some trailing whitespaces from the html output, no other changes.
* nixos/make-options-doc: make whitespace more md-compatiblepennae2023-01-22
| | | | | | | markdown-it-py creates different whitespace leaders/trailers than are currently emitted, and when we convert examples and defaults to render via markdown the spacing will change too. this has no effect on rendered output.
* nixos/make-options-doc: don't escape link urls twicepennae2023-01-22
| | | | | | mistune already does escaping. it does escaping for html, but the difference is small enough that can just ignore that we're actually targeting docbook here.
* nixos/make-options-doc: remove trailing whitespace from stringspennae2023-01-22
| | | | | | | | this was done only to make the conversion to MD easier to verify. we no longer need it, and not keeping whitespace does not affect rendered outputs. stripping will have to stay for now because description postprocessing would add empty paragraphs otherwise.
* nixos/documentation: deprecate docbook option docspennae2023-01-22
| | | | | | | | 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.
* Merge pull request #208762 from ncfavier/link-manpages-options-docNaïm Favier2023-01-09
|\
| * nixos/make-options-doc: link manpagesNaïm Favier2023-01-03
| | | | | | | | | | | | Add links to manpages without a link using the mapping defined in `doc/manpage-urls.json`, as is already done for the nixpkgs and NixOS manuals.
* | lib/modules: make `mkAliasOptionModule` emit DocBookNaïm Favier2023-01-08
| | | | | | | | | | | | Follow-up to https://github.com/NixOS/nixpkgs/pull/208407 Removing `mdDoc` isn't enough, we need to emit actual DocBook.
* | Merge pull request #209501 from sandydoo/improve/fix-commonmark-doc-isuesDomen Kožar2023-01-08
|\ \ | | | | | | nixos/make-options-doc: skip re-escaping literal expressions
| * | nixos/make-options-doc: skip re-escaping stringssandydoo2023-01-08
| | |
* | | modules: add mkPackageOptionMDpennae2023-01-05
| | | | | | | | | | | | another transitional option factory, like mkAliasOptionModuleMD.
* | | modules: add mkAliasOptionModuleMDpennae2023-01-05
| |/ |/| | | | | | | | | | | mkAliasOptionModule should not default to mdDoc descriptions because that can break out-of-tree users of documentation infrastructure. add an explicitly-MD variant for now, to be removed some time after the MD transition is complete.
* | Revert "treewide: use nativeBuildInputs with runCommand instead of inlining"K9002022-12-26
| |
* | Merge pull request #206775 from SuperSandro2000/runCommand-nativeBuildInputsSandro2022-12-25
|\ \ | |/ |/|
| * treewide: use nativeBuildInputs with runCommand instead of inliningSandro Jäckel2022-12-18
| |
* | nixos: fix typosfigsoda2022-12-17
|/
* nixos/make-options-doc: remove dead codeNaïm Favier2022-12-08
| | | | | The logic for pretty-printing Nix values isn't needed any more because `optionAttrSetToDocList` returns already rendered values.
* nixos/doc: render option values using `lib.generators.toPretty`Naïm Favier2022-12-08
| | | | | | | | | | | | | | | Render un`_type`d defaults and examples as `literalExpression`s using `lib.generators.toPretty` so that consumers don't have to reinvent Nix pretty-printing. `renderOptionValue` is kept internal for now intentionally. Make `toPretty` print floats as valid Nix values (without a tilde). Get rid of the now-obsolete `substSpecial` function. Move towards disallowing evaluation of packages in the manual by raising a warning on `pkgs.foo.{outPath,drvPath}`; later, this should throw an error. Instead, module authors should use `literalExpression` and `mkPackageOption`.
* nixos/make-options-doc: improve CommonMark formattingsandydoo2022-12-07
| | | | | Render the `type` attribute in a code block to match the rest of the attributes.
* nixos/make-options-doc: pretty-print literalssandydoo2022-12-07
| | | | | | | | | | | Unlike the XML doc renderer, the AsciiDoc and CommonMark renderers don't pretty-print certain complex types, like literal expressions, DocBook literals, and derivations. These types are dumped into the documentation as JSON. This commit parses and unwraps these types when loading the JSON-formatted NixOS options. The AsciiDoc and CommonMark renders have also been combined into a single script to allow code reuse.
* nixosOptionsDoc: Report in which option an error occursRobert Hensing2022-11-11
|
* nixosOptionsDoc: Add markdownByDefault parameterRobert Hensing2022-11-11
|
* nixos options markdown: fix html escapingDomen Kožar2022-11-05
| | | | | | | \<foo\> will often be displayed like \<foo>, for example by mkdocs. I've tested a number of markdown renderers and they render html escape sequences fine.
* nixos/make-options-doc: fix JSON generation on DarwinWinter2022-10-25
|
* Merge branch 'master' into staging-nextJan Tojnar2022-10-19
|\ | | | | | | | | | | | | | | ; Conflicts: ; pkgs/development/tools/codespell/default.nix codespell 2.2.2 switched to pyproject & setuptools_scm: https://github.com/codespell-project/codespell/pull/2523