diff options
author | pennae <github@quasiparticle.net> | 2023-02-11 08:48:06 +0100 |
---|---|---|
committer | pennae <github@quasiparticle.net> | 2023-02-12 13:02:42 +0100 |
commit | 1229e735ac51dbe79724f7648655a2089c9c67b9 (patch) | |
tree | ba4f6a33e11574bde4108f67928b3f24ccfee901 /nixos/doc/manual/development | |
parent | 8b7f0e559ad9419815d0a4c8d231e2bf464c0ad2 (diff) | |
download | nixpkgs-1229e735ac51dbe79724f7648655a2089c9c67b9.tar nixpkgs-1229e735ac51dbe79724f7648655a2089c9c67b9.tar.gz nixpkgs-1229e735ac51dbe79724f7648655a2089c9c67b9.tar.bz2 nixpkgs-1229e735ac51dbe79724f7648655a2089c9c67b9.tar.lz nixpkgs-1229e735ac51dbe79724f7648655a2089c9c67b9.tar.xz nixpkgs-1229e735ac51dbe79724f7648655a2089c9c67b9.tar.zst nixpkgs-1229e735ac51dbe79724f7648655a2089c9c67b9.zip |
nixos-render-docs: add structural includes, use for manual
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.
Diffstat (limited to 'nixos/doc/manual/development')
7 files changed, 37 insertions, 41 deletions
diff --git a/nixos/doc/manual/development/development.md b/nixos/doc/manual/development/development.md new file mode 100644 index 00000000000..6a0dd091b12 --- /dev/null +++ b/nixos/doc/manual/development/development.md @@ -0,0 +1,14 @@ +# Development {#ch-development} + +This chapter describes how you can modify and extend NixOS. + +```{=include=} chapters +sources.chapter.md +writing-modules.chapter.md +building-parts.chapter.md +bootspec.chapter.md +what-happens-during-a-system-switch.chapter.md +writing-documentation.chapter.md +nixos-tests.chapter.md +testing-installer.chapter.md +``` diff --git a/nixos/doc/manual/development/development.xml b/nixos/doc/manual/development/development.xml deleted file mode 100644 index 949468c9021..00000000000 --- a/nixos/doc/manual/development/development.xml +++ /dev/null @@ -1,20 +0,0 @@ -<part xmlns="http://docbook.org/ns/docbook" - xmlns:xlink="http://www.w3.org/1999/xlink" - xmlns:xi="http://www.w3.org/2001/XInclude" - version="5.0" - xml:id="ch-development"> - <title>Development</title> - <partintro xml:id="ch-development-intro"> - <para> - This chapter describes how you can modify and extend NixOS. - </para> - </partintro> - <xi:include href="../from_md/development/sources.chapter.xml" /> - <xi:include href="../from_md/development/writing-modules.chapter.xml" /> - <xi:include href="../from_md/development/building-parts.chapter.xml" /> - <xi:include href="../from_md/development/bootspec.chapter.xml" /> - <xi:include href="../from_md/development/what-happens-during-a-system-switch.chapter.xml" /> - <xi:include href="../from_md/development/writing-documentation.chapter.xml" /> - <xi:include href="../from_md/development/nixos-tests.chapter.xml" /> - <xi:include href="../from_md/development/testing-installer.chapter.xml" /> -</part> diff --git a/nixos/doc/manual/development/nixos-tests.chapter.md b/nixos/doc/manual/development/nixos-tests.chapter.md index 2a4fdddeaa6..ec0e4b9f076 100644 --- a/nixos/doc/manual/development/nixos-tests.chapter.md +++ b/nixos/doc/manual/development/nixos-tests.chapter.md @@ -5,9 +5,9 @@ NixOS tests are kept in the directory `nixos/tests`, and are executed (using Nix) by a testing framework that automatically starts one or more virtual machines containing the NixOS system(s) required for the test. -```{=docbook} -<xi:include href="writing-nixos-tests.section.xml" /> -<xi:include href="running-nixos-tests.section.xml" /> -<xi:include href="running-nixos-tests-interactively.section.xml" /> -<xi:include href="linking-nixos-tests-to-packages.section.xml" /> +```{=include=} sections +writing-nixos-tests.section.md +running-nixos-tests.section.md +running-nixos-tests-interactively.section.md +linking-nixos-tests-to-packages.section.md ``` diff --git a/nixos/doc/manual/development/what-happens-during-a-system-switch.chapter.md b/nixos/doc/manual/development/what-happens-during-a-system-switch.chapter.md index aad82831a3c..9cbec729803 100644 --- a/nixos/doc/manual/development/what-happens-during-a-system-switch.chapter.md +++ b/nixos/doc/manual/development/what-happens-during-a-system-switch.chapter.md @@ -47,7 +47,7 @@ Most of these actions are either self-explaining but some of them have to do with our units or the activation script. For this reason, these topics are explained in the next sections. -```{=docbook} -<xi:include href="unit-handling.section.xml" /> -<xi:include href="activation-script.section.xml" /> +```{=include=} sections +unit-handling.section.md +activation-script.section.md ``` diff --git a/nixos/doc/manual/development/writing-documentation.chapter.md b/nixos/doc/manual/development/writing-documentation.chapter.md index 4986c9f0a81..8d504dfb0b0 100644 --- a/nixos/doc/manual/development/writing-documentation.chapter.md +++ b/nixos/doc/manual/development/writing-documentation.chapter.md @@ -83,7 +83,7 @@ Keep the following guidelines in mind when you create and add a topic: ## Adding a Topic to the Book {#sec-writing-docs-adding-a-topic} -Open the parent XML file and add an `xi:include` element to the list of +Open the parent CommonMark file and add a line to the list of chapters with the file name of the topic that you created. If you created a `section`, you add the file to the `chapter` file. If you created a `chapter`, you add the file to the `part` file. diff --git a/nixos/doc/manual/development/writing-modules.chapter.md b/nixos/doc/manual/development/writing-modules.chapter.md index a0ec4a5df96..ae657458d76 100644 --- a/nixos/doc/manual/development/writing-modules.chapter.md +++ b/nixos/doc/manual/development/writing-modules.chapter.md @@ -189,14 +189,14 @@ in { ``` ::: -```{=docbook} -<xi:include href="option-declarations.section.xml" /> -<xi:include href="option-types.section.xml" /> -<xi:include href="option-def.section.xml" /> -<xi:include href="assertions.section.xml" /> -<xi:include href="meta-attributes.section.xml" /> -<xi:include href="importing-modules.section.xml" /> -<xi:include href="replace-modules.section.xml" /> -<xi:include href="freeform-modules.section.xml" /> -<xi:include href="settings-options.section.xml" /> +```{=include=} sections +option-declarations.section.md +option-types.section.md +option-def.section.md +assertions.section.md +meta-attributes.section.md +importing-modules.section.md +replace-modules.section.md +freeform-modules.section.md +settings-options.section.md ``` diff --git a/nixos/doc/manual/development/writing-nixos-tests.section.md b/nixos/doc/manual/development/writing-nixos-tests.section.md index d80e314e625..3de46fda3df 100644 --- a/nixos/doc/manual/development/writing-nixos-tests.section.md +++ b/nixos/doc/manual/development/writing-nixos-tests.section.md @@ -470,6 +470,8 @@ In that case, `numpy` is chosen from the generic `python3Packages`. The following options can be used when writing tests. -```{=docbook} -<xi:include href="../../generated/test-options-db.xml" xpointer="test-options-list"/> +```{=include=} options +id-prefix: test-opt- +list-id: test-options-list +source: @NIXOS_TEST_OPTIONS_JSON@ ``` |