summaryrefslogtreecommitdiffstats
path: root/nixos
diff options
context:
space:
mode:
authorpennae <82953136+pennae@users.noreply.github.com>2023-01-30 19:26:07 +0100
committerGitHub <noreply@github.com>2023-01-30 19:26:07 +0100
commit5b6dcece880b1fe45532b383e1c1f9574ddac4cf (patch)
tree75ad5ae9002e3ff171eb95a0367456105bb7e121 /nixos
parent8de8ee54bdceb257a05635e08c6021eb251720bd (diff)
parent0a6e6cf7e698a6a08a62d8863e2c66b36d5db0d9 (diff)
Merge pull request #212684 from pennae/nixos-render-docs
nixos-render-docs: init, use for some manual rendering to docbook
Diffstat (limited to 'nixos')
-rw-r--r--nixos/doc/manual/default.nix15
-rw-r--r--nixos/doc/manual/development/meta-attributes.section.md26
-rw-r--r--nixos/doc/manual/from_md/development/meta-attributes.section.xml29
-rwxr-xr-xnixos/doc/manual/md-to-db.sh18
-rw-r--r--nixos/lib/make-options-doc/default.nix39
-rw-r--r--nixos/lib/make-options-doc/optionsToDocbook.py343
-rw-r--r--nixos/modules/i18n/input-method/default.nix2
-rw-r--r--nixos/modules/i18n/input-method/default.xml275
-rw-r--r--nixos/modules/misc/meta.nix2
-rw-r--r--nixos/modules/programs/digitalbitbox/default.nix2
-rw-r--r--nixos/modules/programs/digitalbitbox/default.xml70
-rw-r--r--nixos/modules/programs/plotinus.nix2
-rw-r--r--nixos/modules/programs/plotinus.xml30
-rw-r--r--nixos/modules/programs/zsh/oh-my-zsh.nix2
-rw-r--r--nixos/modules/programs/zsh/oh-my-zsh.xml154
-rw-r--r--nixos/modules/security/acme/default.nix2
-rw-r--r--nixos/modules/security/acme/default.xml395
-rw-r--r--nixos/modules/services/backup/borgbackup.nix2
-rw-r--r--nixos/modules/services/backup/borgbackup.xml215
-rw-r--r--nixos/modules/services/databases/foundationdb.nix2
-rw-r--r--nixos/modules/services/databases/foundationdb.xml425
-rw-r--r--nixos/modules/services/databases/postgresql.nix2
-rw-r--r--nixos/modules/services/databases/postgresql.xml250
-rw-r--r--nixos/modules/services/desktops/flatpak.nix2
-rw-r--r--nixos/modules/services/desktops/flatpak.xml59
-rw-r--r--nixos/modules/services/development/blackfire.nix2
-rw-r--r--nixos/modules/services/development/blackfire.xml61
-rw-r--r--nixos/modules/services/editors/emacs.nix2
-rw-r--r--nixos/modules/services/editors/emacs.xml490
-rw-r--r--nixos/modules/services/hardware/trezord.nix2
-rw-r--r--nixos/modules/services/hardware/trezord.xml29
-rw-r--r--nixos/modules/services/mail/mailman.nix2
-rw-r--r--nixos/modules/services/mail/mailman.xml112
-rw-r--r--nixos/modules/services/matrix/mjolnir.nix2
-rw-r--r--nixos/modules/services/matrix/mjolnir.xml148
-rw-r--r--nixos/modules/services/matrix/synapse.nix2
-rw-r--r--nixos/modules/services/matrix/synapse.xml263
-rw-r--r--nixos/modules/services/misc/gitlab.nix2
-rw-r--r--nixos/modules/services/misc/gitlab.xml143
-rw-r--r--nixos/modules/services/misc/sourcehut/default.nix2
-rw-r--r--nixos/modules/services/misc/sourcehut/default.xml113
-rw-r--r--nixos/modules/services/misc/taskserver/default.nix2
-rw-r--r--nixos/modules/services/misc/taskserver/default.xml130
-rw-r--r--nixos/modules/services/misc/weechat.nix2
-rw-r--r--nixos/modules/services/misc/weechat.xml63
-rw-r--r--nixos/modules/services/monitoring/parsedmarc.nix2
-rw-r--r--nixos/modules/services/monitoring/parsedmarc.xml126
-rw-r--r--nixos/modules/services/monitoring/prometheus/exporters.nix2
-rw-r--r--nixos/modules/services/monitoring/prometheus/exporters.xml245
-rw-r--r--nixos/modules/services/network-filesystems/litestream/default.nix2
-rw-r--r--nixos/modules/services/network-filesystems/litestream/default.xml62
-rw-r--r--nixos/modules/services/networking/firefox-syncserver.nix2
-rw-r--r--nixos/modules/services/networking/firefox-syncserver.xml79
-rw-r--r--nixos/modules/services/networking/mosquitto.nix2
-rw-r--r--nixos/modules/services/networking/mosquitto.xml149
-rw-r--r--nixos/modules/services/networking/pleroma.nix2
-rw-r--r--nixos/modules/services/networking/pleroma.xml244
-rw-r--r--nixos/modules/services/networking/prosody.nix2
-rw-r--r--nixos/modules/services/networking/prosody.xml92
-rw-r--r--nixos/modules/services/networking/yggdrasil.nix2
-rw-r--r--nixos/modules/services/networking/yggdrasil.xml157
-rw-r--r--nixos/modules/services/search/meilisearch.nix2
-rw-r--r--nixos/modules/services/search/meilisearch.xml87
-rw-r--r--nixos/modules/services/web-apps/akkoma.nix2
-rw-r--r--nixos/modules/services/web-apps/akkoma.xml398
-rw-r--r--nixos/modules/services/web-apps/discourse.nix2
-rw-r--r--nixos/modules/services/web-apps/discourse.xml331
-rw-r--r--nixos/modules/services/web-apps/grocy.nix2
-rw-r--r--nixos/modules/services/web-apps/grocy.xml84
-rw-r--r--nixos/modules/services/web-apps/jitsi-meet.nix2
-rw-r--r--nixos/modules/services/web-apps/jitsi-meet.xml55
-rw-r--r--nixos/modules/services/web-apps/keycloak.nix2
-rw-r--r--nixos/modules/services/web-apps/keycloak.xml177
-rw-r--r--nixos/modules/services/web-apps/lemmy.nix2
-rw-r--r--nixos/modules/services/web-apps/lemmy.xml53
-rw-r--r--nixos/modules/services/web-apps/matomo.nix2
-rw-r--r--nixos/modules/services/web-apps/matomo.xml107
-rw-r--r--nixos/modules/services/web-apps/nextcloud.nix2
-rw-r--r--nixos/modules/services/web-apps/nextcloud.xml333
-rw-r--r--nixos/modules/services/web-apps/pict-rs.nix2
-rw-r--r--nixos/modules/services/web-apps/pict-rs.xml185
-rw-r--r--nixos/modules/services/web-apps/plausible.nix2
-rw-r--r--nixos/modules/services/web-apps/plausible.xml45
-rw-r--r--nixos/modules/services/web-servers/garage.nix2
-rw-r--r--nixos/modules/services/web-servers/garage.xml206
-rw-r--r--nixos/modules/services/x11/desktop-managers/gnome.nix2
-rw-r--r--nixos/modules/services/x11/desktop-managers/gnome.xml261
-rw-r--r--nixos/modules/services/x11/desktop-managers/pantheon.nix2
-rw-r--r--nixos/modules/services/x11/desktop-managers/pantheon.xml171
-rw-r--r--nixos/modules/system/boot/loader/external/external.nix2
-rw-r--r--nixos/modules/system/boot/loader/external/external.xml43
91 files changed, 69 insertions, 7602 deletions
diff --git a/nixos/doc/manual/default.nix b/nixos/doc/manual/default.nix
index 0ddb3fa7fbe9..913058746b35 100644
--- a/nixos/doc/manual/default.nix
+++ b/nixos/doc/manual/default.nix
@@ -68,12 +68,15 @@ let
sources = lib.sourceFilesBySuffices ./. [".xml"];
- modulesDoc = builtins.toFile "modules.xml" ''
- <section xmlns:xi="http://www.w3.org/2001/XInclude" id="modules">
- ${(lib.concatMapStrings (path: ''
- <xi:include href="${path}" />
- '') (lib.catAttrs "value" config.meta.doc))}
- </section>
+ modulesDoc = runCommand "modules.xml" {
+ nativeBuildInputs = [ pkgs.nixos-render-docs ];
+ } ''
+ nixos-render-docs manual docbook \
+ --manpage-urls ${pkgs.path + "/doc/manpage-urls.json"} \
+ "$out" \
+ --section \
+ --section-id modules \
+ --chapters ${lib.concatMapStrings (p: "${p.value} ") config.meta.doc}
'';
generatedSources = runCommand "generated-docbook" {} ''
diff --git a/nixos/doc/manual/development/meta-attributes.section.md b/nixos/doc/manual/development/meta-attributes.section.md
index 7129cf8723e6..33b41fe74d29 100644
--- a/nixos/doc/manual/development/meta-attributes.section.md
+++ b/nixos/doc/manual/development/meta-attributes.section.md
@@ -23,7 +23,7 @@ file.
meta = {
maintainers = with lib.maintainers; [ ericsagnes ];
- doc = ./default.xml;
+ doc = ./default.md;
buildDocsInSandbox = true;
};
}
@@ -31,7 +31,9 @@ file.
- `maintainers` contains a list of the module maintainers.
-- `doc` points to a valid DocBook file containing the module
+- `doc` points to a valid [Nixpkgs-flavored CommonMark](
+ https://nixos.org/manual/nixpkgs/unstable/#sec-contributing-markup
+ ) file containing the module
documentation. Its contents is automatically added to
[](#ch-configuration). Changes to a module documentation have to
be checked to not break building the NixOS manual:
@@ -40,26 +42,6 @@ file.
$ nix-build nixos/release.nix -A manual.x86_64-linux
```
- This file should *not* usually be written by hand. Instead it is preferred
- to write documentation using CommonMark and converting it to CommonMark
- using pandoc. The simplest documentation can be converted using just
-
- ```ShellSession
- $ pandoc doc.md -t docbook --top-level-division=chapter -f markdown+smart > doc.xml
- ```
-
- More elaborate documentation may wish to add one or more of the pandoc
- filters used to build the remainder of the manual, for example the GNOME
- desktop uses
-
- ```ShellSession
- $ pandoc gnome.md -t docbook --top-level-division=chapter \
- --extract-media=media -f markdown+smart \
- --lua-filter ../../../../../doc/build-aux/pandoc-filters/myst-reader/roles.lua \
- --lua-filter ../../../../../doc/build-aux/pandoc-filters/docbook-writer/rst-roles.lua \
- > gnome.xml
- ```
-
- `buildDocsInSandbox` indicates whether the option documentation for the
module can be built in a derivation sandbox. This option is currently only
honored for modules shipped by nixpkgs. User modules and modules taken from
diff --git a/nixos/doc/manual/from_md/development/meta-attributes.section.xml b/nixos/doc/manual/from_md/development/meta-attributes.section.xml
index 450a5f670f3a..64234f1cc0d7 100644
--- a/nixos/doc/manual/from_md/development/meta-attributes.section.xml
+++ b/nixos/doc/manual/from_md/development/meta-attributes.section.xml
@@ -28,7 +28,7 @@
meta = {
maintainers = with lib.maintainers; [ ericsagnes ];
- doc = ./default.xml;
+ doc = ./default.md;
buildDocsInSandbox = true;
};
}
@@ -42,8 +42,10 @@
</listitem>
<listitem>
<para>
- <literal>doc</literal> points to a valid DocBook file containing
- the module documentation. Its contents is automatically added to
+ <literal>doc</literal> points to a valid
+ <link xlink:href="https://nixos.org/manual/nixpkgs/unstable/#sec-contributing-markup">Nixpkgs-flavored
+ CommonMark</link> file containing the module documentation. Its
+ contents is automatically added to
<xref linkend="ch-configuration" />. Changes to a module
documentation have to be checked to not break building the NixOS
manual:
@@ -51,27 +53,6 @@
<programlisting>
$ nix-build nixos/release.nix -A manual.x86_64-linux
</programlisting>
- <para>
- This file should <emphasis>not</emphasis> usually be written by
- hand. Instead it is preferred to write documentation using
- CommonMark and converting it to CommonMark using pandoc. The
- simplest documentation can be converted using just
- </para>
- <programlisting>
-$ pandoc doc.md -t docbook --top-level-division=chapter -f markdown+smart &gt; doc.xml
-</programlisting>
- <para>
- More elaborate documentation may wish to add one or more of the
- pandoc filters used to build the remainder of the manual, for
- example the GNOME desktop uses
- </para>
- <programlisting>
-$ pandoc gnome.md -t docbook --top-level-division=chapter \
- --extract-media=media -f markdown+smart \
- --lua-filter ../../../../../doc/build-aux/pandoc-filters/myst-reader/roles.lua \
- --lua-filter ../../../../../doc/build-aux/pandoc-filters/docbook-writer/rst-roles.lua \
- &gt; gnome.xml
-</programlisting>
</listitem>
<listitem>
<para>
diff --git a/nixos/doc/manual/md-to-db.sh b/nixos/doc/manual/md-to-db.sh
index a7421bed532e..4698e94f508b 100755
--- a/nixos/doc/manual/md-to-db.sh
+++ b/nixos/doc/manual/md-to-db.sh
@@ -50,21 +50,3 @@ for mf in ${MD_FILES[*]}; do
done
popd
-
-# now handle module chapters. we'll need extra checks to ensure that we don't process
-# markdown files we're not interested in, so we'll require an x.nix file for ever x.md
-# that we'll convert to xml.
-pushd "$DIR/../../modules"
-
-mapfile -t MD_FILES < <(find . -type f -regex '.*\.md$')
-
-for mf in ${MD_FILES[*]}; do
- [ -f "${mf%.md}.nix" ] || continue
-
- pandoc --top-level-division=chapter "$mf" "${pandoc_flags[@]}" -o "${mf%.md}.xml"
- sed -i -e '1 i <!-- Do not edit this file directly, edit its companion .md instead\
- and regenerate this file using nixos/doc/manual/md-to-db.sh -->' \
- "${mf%.md}.xml"
-done
-
-popd
diff --git a/nixos/lib/make-options-doc/default.nix b/nixos/lib/make-options-doc/default.nix
index 01db7bcbee9b..271af9ba1801 100644
--- a/nixos/lib/make-options-doc/default.nix
+++ b/nixos/lib/make-options-doc/default.nix
@@ -148,42 +148,19 @@ in rec {
'';
optionsDocBook = pkgs.runCommand "options-docbook.xml" {
- MANPAGE_URLS = pkgs.path + "/doc/manpage-urls.json";
- OTD_DOCUMENT_TYPE = documentType;
- OTD_VARIABLE_LIST_ID = variablelistId;
- OTD_OPTION_ID_PREFIX = optionIdPrefix;
- OTD_REVISION = revision;
-
nativeBuildInputs = [
- (let
- # python3Minimal can't be overridden with packages on Darwin, due to a missing framework.
- # Instead of modifying stdenv, we take the easy way out, since most people on Darwin will
- # just be hacking on the Nixpkgs manual (which also uses make-options-doc).
- python = if pkgs.stdenv.isDarwin then pkgs.python3 else pkgs.python3Minimal;
- self = (python.override {
- inherit self;
- includeSiteCustomize = true;
- });
- in self.withPackages (p:
- let
- # TODO add our own small test suite when rendering is split out into a new tool
- markdown-it-py = p.markdown-it-py.override {
- disableTests = true;
- };
- mdit-py-plugins = p.mdit-py-plugins.override {
- inherit markdown-it-py;
- disableTests = true;
- };
- in [
- markdown-it-py
- mdit-py-plugins
- ]))
+ pkgs.nixos-render-docs
];
} ''
- python ${./optionsToDocbook.py} \
+ nixos-render-docs options docbook \
+ --manpage-urls ${pkgs.path + "/doc/manpage-urls.json"} \
+ --revision ${lib.