Generate docs (#1)

* feat: Reorganize code

* feat: Generate docs as mdbook

* feat: Add deploy github action

* fix: formatting
This commit is contained in:
Jalil David Salamé Messina 2024-01-14 18:58:08 +01:00 committed by GitHub
parent ca6bf00ad6
commit 63034a2af9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 144 additions and 70 deletions

1
docs/.gitignore vendored Normal file
View file

@ -0,0 +1 @@
book

6
docs/book.toml Normal file
View file

@ -0,0 +1,6 @@
[book]
authors = ["Jalil David Salamé Messina"]
language = "en"
multilingual = false
src = "src"
title = "Jalil's NixOS configuration module"

16
docs/default.nix Normal file
View file

@ -0,0 +1,16 @@
{ pkgs, lib, ... }:
let
eval = lib.evalModules { modules = [ ../options.nix ]; };
doc = (pkgs.nixosOptionsDoc { inherit (eval) options; }).optionsCommonMark;
in
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
'';
buildPhase = "${pkgs.mdbook}/bin/mdbook build --dest-dir $out";
}

3
docs/src/SUMMARY.md Normal file
View file

@ -0,0 +1,3 @@
# Summary
- [Module Options](./options.md)

3
docs/src/options.md Normal file
View file

@ -0,0 +1,3 @@
# Module Options
Here you will find the module options and their default values (if they have any).