doc: fix some alerts not being rendered by substituteInPlace

This commit is contained in:
Daniel Thwaites 2025-02-17 19:16:26 +00:00
parent de2057a000
commit d6796ff307
No known key found for this signature in database
GPG key ID: D8AFC4BF05670F9D
2 changed files with 7 additions and 11 deletions

View file

@ -2,6 +2,8 @@
title = "Stylix"
language = "en"
[preprocessor.alerts]
[output.html]
site-url = "/stylix/"
git-repository-url = "https://github.com/danth/stylix"

View file

@ -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";
}