From d6796ff307fa9b0fbebf7379126c5871658f427e Mon Sep 17 00:00:00 2001 From: Daniel Thwaites Date: Mon, 17 Feb 2025 19:16:26 +0000 Subject: [PATCH] doc: fix some alerts not being rendered by `substituteInPlace` --- docs/book.toml | 2 ++ docs/default.nix | 16 +++++----------- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/docs/book.toml b/docs/book.toml index a06b57f1..d4042175 100644 --- a/docs/book.toml +++ b/docs/book.toml @@ -2,6 +2,8 @@ title = "Stylix" language = "en" +[preprocessor.alerts] + [output.html] site-url = "/stylix/" git-repository-url = "https://github.com/danth/stylix" diff --git a/docs/default.nix b/docs/default.nix index bc782599..b4d3f7de 100644 --- a/docs/default.nix +++ b/docs/default.nix @@ -87,6 +87,10 @@ in pkgs.stdenvNoCC.mkDerivation { name = "stylix-book"; src = ./.; + buildInputs = with pkgs; [ + mdbook + mdbook-alerts + ]; patchPhase = '' # The generated documentation has headings at level 2, but we want level 3 @@ -145,17 +149,7 @@ pkgs.stdenvNoCC.mkDerivation { mkdir -p src/options/modules ${modulePageScript} - - # mdBook doesn't support this Markdown extension yet - substituteInPlace **/*.md \ - --replace-quiet '> [!NOTE]' '> **Note**' \ - --replace-quiet '> [!TIP]' '> **Tip**' \ - --replace-quiet '> [!IMPORTANT]' '> **Important**' \ - --replace-quiet '> [!WARNING]' '> **Warning**' \ - --replace-quiet '> [!CAUTION]' '> **Caution**' ''; - buildPhase = '' - ${pkgs.mdbook}/bin/mdbook build --dest-dir $out - ''; + buildPhase = "mdbook build --dest-dir $out"; }