cli-docs: add automatic markdown cli docs

This commit is contained in:
Johannes Kirschbauer
2024-05-07 13:23:03 +02:00
parent 5a6eeda125
commit 15dd4ea25f
7 changed files with 173 additions and 35 deletions

View File

@@ -1,4 +1,9 @@
{ pkgs, module-docs, ... }:
{
pkgs,
module-docs,
clan-cli-docs,
...
}:
let
uml-c4 = pkgs.python3Packages.plantuml-markdown.override { plantuml = pkgs.plantuml-c4; };
in
@@ -17,9 +22,9 @@ pkgs.stdenv.mkDerivation {
mkdocs-material
]);
configurePhase = ''
mkdir -p ./site/reference
mkdir -p ./site/reference/cli
cp -af ${module-docs}/* ./site/reference/
cp -af ${clan-cli-docs}/* ./site/reference/cli/
'';
buildPhase = ''

View File

@@ -54,19 +54,17 @@
in
{
devShells.docs = pkgs.callPackage ./shell.nix {
inherit (self'.packages) docs;
inherit (self'.packages) docs clan-cli-docs;
inherit module-docs;
};
packages = {
docs = pkgs.python3.pkgs.callPackage ./default.nix {
inherit (self'.packages) clan-cli-docs;
inherit (inputs) nixpkgs;
inherit module-docs;
};
deploy-docs = pkgs.callPackage ./deploy-docs.nix { inherit (config.packages) docs; };
inherit module-docs;
};
legacyPackages = {
foo = jsonDocs;
};
};
}

View File

@@ -2,13 +2,15 @@
docs,
pkgs,
module-docs,
clan-cli-docs,
...
}:
pkgs.mkShell {
inputsFrom = [ docs ];
shellHook = ''
mkdir -p ./site/reference
mkdir -p ./site/reference/cli
cp -af ${module-docs}/* ./site/reference/
cp -af ${clan-cli-docs}/* ./site/reference/cli/
chmod +w ./site/reference/*
echo "Generated API documentation in './site/reference/' "