feat(docs): Also output raw markdown
This commit is contained in:
parent
2d11a56619
commit
e665e52fe2
2 changed files with 13 additions and 10 deletions
|
@ -1,16 +1,19 @@
|
|||
{ pkgs, lib, ... }:
|
||||
let
|
||||
eval = lib.evalModules { modules = [ ../nixos/options.nix ]; };
|
||||
doc = (pkgs.nixosOptionsDoc { inherit (eval) options; }).optionsCommonMark;
|
||||
markdown = (pkgs.nixosOptionsDoc { inherit (eval) options; }).optionsCommonMark;
|
||||
in
|
||||
pkgs.stdenvNoCC.mkDerivation {
|
||||
name = "nixos-configuration-book";
|
||||
src = ./.;
|
||||
{
|
||||
inherit markdown;
|
||||
docs = pkgs.stdenvNoCC.mkDerivation {
|
||||
name = "nixos-configuration-book";
|
||||
src = ./.;
|
||||
|
||||
patchPhase = ''
|
||||
# copy generated options removing the declared by statement
|
||||
sed '/^\*Declared by:\*$/,/^$/d' <${doc} >> src/options.md
|
||||
'';
|
||||
patchPhase = ''
|
||||
# copy generated options removing the declared by statement
|
||||
sed '/^\*Declared by:\*$/,/^$/d' <${markdown} >> src/options.md
|
||||
'';
|
||||
|
||||
buildPhase = "${pkgs.mdbook}/bin/mdbook build --dest-dir $out";
|
||||
buildPhase = "${pkgs.mdbook}/bin/mdbook build --dest-dir $out";
|
||||
};
|
||||
}
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
supportedSystems = [ "x86_64-linux" "aarch64-linux" ];
|
||||
forEachSupportedSystem = f: nixpkgs.lib.genAttrs supportedSystems (system: f { pkgs = import nixpkgs { inherit system; }; });
|
||||
# Module documentation
|
||||
doc = forEachSupportedSystem ({ pkgs }: { doc = import ./docs { inherit pkgs lib; }; });
|
||||
doc = forEachSupportedSystem ({ pkgs }: import ./docs { inherit pkgs lib; });
|
||||
in
|
||||
{
|
||||
# Schemas tell Nix about the structure of your flake's outputs
|
||||
|
|
Loading…
Reference in a new issue