feat(docs): Generate github source urls

This commit is contained in:
Jalil David Salamé Messina 2024-02-18 16:06:32 +01:00
parent 00e193c0d4
commit ee404a058e
Signed by: jalil
GPG key ID: F016B9E770737A0B
5 changed files with 18 additions and 3 deletions

View file

@ -23,10 +23,16 @@ in
mkdir -p ./theme mkdir -p ./theme
ln -s ${highlight} ./theme/highlight.js ln -s ${highlight} ./theme/highlight.js
cat > sed-cmds <<EOF
# Replace nix store path to github url
s:\[/nix/store/[^\\]*-source/\(.*\)\\.nix\](.*):[\1\\.nix](https\://github.com/jalil-salame/configuration.nix/blob/main/\1.nix):
# Make <h2> <h3>
s/^## /### /
EOF
# copy generated options removing the declared by statement # copy generated options removing the declared by statement
sed '/^\*Declared by:\*$/,/^$/d' <${home-markdown} >> ./src/home-options.md sed -f sed-cmds <${home-markdown} >> ./src/home-options.md
sed '/^\*Declared by:\*$/,/^$/d' <${nvim-markdown} >> ./src/nvim-options.md sed -f sed-cmds <${nvim-markdown} >> ./src/nvim-options.md
sed '/^\*Declared by:\*$/,/^$/d' <${nixos-markdown} >> ./src/nixos-options.md sed -f sed-cmds <${nixos-markdown} >> ./src/nixos-options.md
''; '';
nativeBuildInputs = [ pkgs.mdbook-toc ]; nativeBuildInputs = [ pkgs.mdbook-toc ];

View file

@ -5,6 +5,9 @@ I use [NixOS](https://nixos.org) and
system and user configuration respectively. You can see what options I have system and user configuration respectively. You can see what options I have
added to configure the system and user configuration in the next chapters. added to configure the system and user configuration in the next chapters.
The source repo is
[configuration.nix](https://github.com/jalil-salame/configuration.nix).
## Table of Contents ## Table of Contents
<!-- toc --> <!-- toc -->

View file

@ -11,3 +11,5 @@ search](https://mipmip.github.io/home-manager-option-search/)
## Table of Contents ## Table of Contents
<!-- toc --> <!-- toc -->
## Options

View file

@ -10,3 +10,5 @@ through [NixOS Options](https://search.nixos.org/options).
## Table of Contents ## Table of Contents
<!-- toc --> <!-- toc -->
## Options

View file

@ -11,3 +11,5 @@ search](https://nixneovim.github.io/nixneovim-option-search/).
## Table of Contents ## Table of Contents
<!-- toc --> <!-- toc -->
## Options