about summary refs log tree commit diff
path: root/nixos/lib/make-options-doc/default.nix
diff options
context:
space:
mode:
authorsandydoo <hey@sandydoo.me>2022-12-05 16:05:06 +0000
committersandydoo <hey@sandydoo.me>2022-12-07 14:06:56 +0000
commit926afb6f1c9bcca568eaf12fdd9d16c138a26136 (patch)
treeb04377652d7ad2058a1e31f5edc268051a3476fe /nixos/lib/make-options-doc/default.nix
parent1792d2f5c5e4fc9d656a155f8e1d35fffbd1ecbc (diff)
nixos/make-options-doc: pretty-print literals
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.
Diffstat (limited to 'nixos/lib/make-options-doc/default.nix')
-rw-r--r--nixos/lib/make-options-doc/default.nix10
1 files changed, 6 insertions, 4 deletions
diff --git a/nixos/lib/make-options-doc/default.nix b/nixos/lib/make-options-doc/default.nix
index e097aa5eebd8e..694512115d40a 100644
--- a/nixos/lib/make-options-doc/default.nix
+++ b/nixos/lib/make-options-doc/default.nix
@@ -111,14 +111,16 @@ in rec {
   inherit optionsNix;
 
   optionsAsciiDoc = pkgs.runCommand "options.adoc" {} ''
-    ${pkgs.python3Minimal}/bin/python ${./generateAsciiDoc.py} \
-      < ${optionsJSON}/share/doc/nixos/options.json \
+    ${pkgs.python3Minimal}/bin/python ${./generateDoc.py} \
+      --format asciidoc \
+      ${optionsJSON}/share/doc/nixos/options.json \
       > $out
   '';
 
   optionsCommonMark = pkgs.runCommand "options.md" {} ''
-    ${pkgs.python3Minimal}/bin/python ${./generateCommonMark.py} \
-      < ${optionsJSON}/share/doc/nixos/options.json \
+    ${pkgs.python3Minimal}/bin/python ${./generateDoc.py} \
+      --format commonmark \
+      ${optionsJSON}/share/doc/nixos/options.json \
       > $out
   '';