From b9dd1b816a6c83f53398e9f9b32b2b6f1a1350e6 Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Fri, 26 Sep 2025 18:06:52 +0300 Subject: [PATCH] docs: restructure to allow a clean migration to new documentation util Signed-off-by: NotAShelf Change-Id: I6a6a6964afba43bdda6a2cbf037404ca3fa4f8c9 --- docs/manual.nix | 103 +-- docs/manual/configuring.md | 3 +- .../{ => custom-plugins}/custom-package.md | 0 docs/manual/hacking.md | 589 +++++++++++++++++- docs/manual/hacking/additional-plugins.md | 266 -------- docs/manual/hacking/getting-started.md | 17 - docs/manual/hacking/guidelines.md | 188 ------ docs/manual/hacking/keybinds.md | 97 --- docs/manual/hacking/testing.md | 15 - docs/manual/index.md | 107 +++- docs/manual/installation.md | 14 - docs/manual/options.md | 21 - docs/manual/preface.md | 20 - docs/manual/quirks.md | 42 +- docs/manual/quirks/nodejs.md | 24 - docs/manual/release-notes.md | 15 + docs/{ => manual}/release-notes/rl-0.1.md | 4 +- docs/{ => manual}/release-notes/rl-0.2.md | 20 +- docs/{ => manual}/release-notes/rl-0.3.md | 4 +- docs/{ => manual}/release-notes/rl-0.4.md | 4 +- docs/{ => manual}/release-notes/rl-0.5.md | 6 +- docs/{ => manual}/release-notes/rl-0.6.md | 4 +- docs/{ => manual}/release-notes/rl-0.7.md | 2 +- docs/{ => manual}/release-notes/rl-0.8.md | 5 +- docs/manual/tips.md | 2 +- docs/manual/try-it-out.md | 72 --- docs/release-notes/release-notes.md | 14 - 27 files changed, 760 insertions(+), 898 deletions(-) rename docs/manual/configuring/{ => custom-plugins}/custom-package.md (100%) delete mode 100644 docs/manual/hacking/additional-plugins.md delete mode 100644 docs/manual/hacking/getting-started.md delete mode 100644 docs/manual/hacking/guidelines.md delete mode 100644 docs/manual/hacking/keybinds.md delete mode 100644 docs/manual/hacking/testing.md delete mode 100644 docs/manual/installation.md delete mode 100644 docs/manual/options.md delete mode 100644 docs/manual/preface.md delete mode 100644 docs/manual/quirks/nodejs.md create mode 100644 docs/manual/release-notes.md rename docs/{ => manual}/release-notes/rl-0.1.md (96%) rename docs/{ => manual}/release-notes/rl-0.2.md (96%) rename docs/{ => manual}/release-notes/rl-0.3.md (98%) rename docs/{ => manual}/release-notes/rl-0.4.md (97%) rename docs/{ => manual}/release-notes/rl-0.5.md (96%) rename docs/{ => manual}/release-notes/rl-0.6.md (99%) rename docs/{ => manual}/release-notes/rl-0.7.md (99%) rename docs/{ => manual}/release-notes/rl-0.8.md (99%) delete mode 100644 docs/manual/try-it-out.md delete mode 100644 docs/release-notes/release-notes.md diff --git a/docs/manual.nix b/docs/manual.nix index 1ce89126..bf222204 100644 --- a/docs/manual.nix +++ b/docs/manual.nix @@ -1,32 +1,38 @@ { inputs, - stdenvNoCC, - runCommandLocal, - # build inputs path, - # nrd configuration - release, + stdenvNoCC, + runCommandNoCCLocal, optionsJSON, } @ args: let manual-release = args.release or "unstable"; in - runCommandLocal "hjem-docs" { - nativeBuildInputs = [inputs.ndg.packages.${stdenvNoCC.system}.ndg]; + runCommandNoCCLocal "nvf-docs-html" { + nativeBuildInputs = [ + (inputs.ndg.packages.${stdenvNoCC.system}.ndg.overrideAttrs + { + # FIXME: the tests take too long to build + doCheck = false; + }) + ]; } '' mkdir -p $out/share/doc - # Copy the markdown sources to be processed by ndg + # Copy the markdown sources to be processed by ndg. This is not + # strictly necessary, but allows us to modify the Markdown sources + # as we see fit. cp -rvf ${./manual} ./manual - substituteInPlace ./manual/options.md \ - --subst-var-by OPTIONS_JSON ./config-options.json - + # Replace variables following the @VARIABLE@ style in the manual + # pages. This can be built into ndg at a later date. substituteInPlace ./manual/index.md \ --subst-var-by NVF_VERSION ${manual-release} substituteInPlace ./manual/hacking/additional-plugins.md \ --subst-var-by NVF_REPO "https://github.com/notashelf/nvf/blob/${manual-release}" + # Generate the final manual from a set of parameters. This uses + # feel-co/ndg to render the web manual. ndg html \ --jobs $NIX_BUILD_CORES --title "NVF" \ --module-options ${optionsJSON}/share/doc/nixos/options.json \ @@ -41,78 +47,3 @@ in mkdir -p $out/nix-support/ echo "doc manual $dest index.html" >> $out/nix-support/hydra-build-products '' -/* -stdenvNoCC.mkDerivation { - name = "nvf-manual"; - src = builtins.path { - name = "nvf-manual-${manual-release}"; - path = lib.sourceFilesBySuffices ./manual [".md" ".md.in"]; - }; - - strictDependencies = true; - nativeBuildInputs = [nixos-render-docs]; - - postPatch = '' - ln -s ${optionsJSON}/share/doc/nixos/options.json ./config-options.json - ''; - - buildPhase = '' - dest="$out/share/doc/nvf" - mkdir -p "$(dirname "$dest")" - mkdir -p $dest/{highlightjs,script} - - # Copy highlight scripts to /highlights in document root. - cp -vt $dest/highlightjs \ - ${documentation-highlighter}/highlight.pack.js \ - ${documentation-highlighter}/LICENSE \ - ${documentation-highlighter}/mono-blue.css \ - ${documentation-highlighter}/loader.js - - # Copy anchor scripts to the script directory in document root. - cp -vt "$dest"/script \ - ${./static/script}/anchor-min.js \ - ${./static/script}/anchor-use.js \ - ${./static/script}/search.js - - - - # Move compiled stylesheet - cp -vt $dest \ - ${compileStylesheet}/style.css - - # Move release notes - cp -vr ${./release-notes} release-notes - - # Generate final manual from a set of parameters. Explanation of the CLI flags are - # as follows: - # - # 1. --manpage-urls will allow you to use manual pages as they are defined in - # the nixpkgs documentation. - # 2. --revision is the project revision as it is defined in 'release.json' in the - # repository root - # 3. --script will inject a given Javascript file into the resulting pages inside - # the