build docs with nmd
This commit is contained in:
parent
86e86dc787
commit
05f16167f7
3 changed files with 89 additions and 1 deletions
13
docs/manual.xml
Normal file
13
docs/manual.xml
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
<book xmlns="http://docbook.org/ns/docbook"
|
||||||
|
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||||
|
xmlns:xi="http://www.w3.org/2001/XInclude"
|
||||||
|
version="5.0"
|
||||||
|
xml:id="book-minimal-example">
|
||||||
|
<info>
|
||||||
|
<title>A simple example</title>
|
||||||
|
</info>
|
||||||
|
<chapter>
|
||||||
|
<title>A simple example</title>
|
||||||
|
<simpara>Hello, world!</simpara>
|
||||||
|
</chapter>
|
||||||
|
</book>
|
||||||
38
flake.lock
generated
38
flake.lock
generated
|
|
@ -81,14 +81,52 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"nmd": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixpkgs"
|
||||||
|
],
|
||||||
|
"scss-reset": "scss-reset"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1687627428,
|
||||||
|
"narHash": "sha256-7zGfXuNS5RHqhpEdz2fwrtqvF86JRo5U1hrxZSYgcm8=",
|
||||||
|
"ref": "refs/heads/master",
|
||||||
|
"rev": "824a380546b5d0d0eb701ff8cd5dbafb360750ff",
|
||||||
|
"revCount": 63,
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://git.sr.ht/~rycee/nmd"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://git.sr.ht/~rycee/nmd"
|
||||||
|
}
|
||||||
|
},
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-utils": "flake-utils",
|
"flake-utils": "flake-utils",
|
||||||
"nix-flake-tests": "nix-flake-tests",
|
"nix-flake-tests": "nix-flake-tests",
|
||||||
"nixpkgs": "nixpkgs",
|
"nixpkgs": "nixpkgs",
|
||||||
|
"nmd": "nmd",
|
||||||
"sops-nix": "sops-nix"
|
"sops-nix": "sops-nix"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"scss-reset": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1631450058,
|
||||||
|
"narHash": "sha256-muDlZJPtXDIGevSEWkicPP0HQ6VtucbkMNygpGlBEUM=",
|
||||||
|
"owner": "andreymatin",
|
||||||
|
"repo": "scss-reset",
|
||||||
|
"rev": "0cf50e27a4e95e9bb5b1715eedf9c54dee1a5a91",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "andreymatin",
|
||||||
|
"repo": "scss-reset",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"sops-nix": {
|
"sops-nix": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": "nixpkgs_2",
|
"nixpkgs": "nixpkgs_2",
|
||||||
|
|
|
||||||
39
flake.nix
39
flake.nix
|
|
@ -6,9 +6,11 @@
|
||||||
sops-nix.url = "github:Mic92/sops-nix";
|
sops-nix.url = "github:Mic92/sops-nix";
|
||||||
nix-flake-tests.url = "github:antifuchs/nix-flake-tests";
|
nix-flake-tests.url = "github:antifuchs/nix-flake-tests";
|
||||||
flake-utils.url = "github:numtide/flake-utils";
|
flake-utils.url = "github:numtide/flake-utils";
|
||||||
|
nmd.url = "git+https://git.sr.ht/~rycee/nmd";
|
||||||
|
nmd.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = { nixpkgs, nix-flake-tests, flake-utils, ... }: flake-utils.lib.eachDefaultSystem (system:
|
outputs = { nixpkgs, nix-flake-tests, flake-utils, nmd, ... }: flake-utils.lib.eachDefaultSystem (system:
|
||||||
let
|
let
|
||||||
pkgs = nixpkgs.legacyPackages.${system};
|
pkgs = nixpkgs.legacyPackages.${system};
|
||||||
in
|
in
|
||||||
|
|
@ -36,6 +38,41 @@
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# Inspiration from https://github.com/nix-community/nix-on-droid/blob/039379abeee67144d4094d80bbdaf183fb2eabe5/docs/default.nix#L22
|
||||||
|
packages.manualHtml = let
|
||||||
|
nmdlib = import nmd { inherit pkgs; };
|
||||||
|
|
||||||
|
setupModule = {
|
||||||
|
_module.args.pkgs = pkgs.lib.mkForce (nmdlib.scrubDerivations "pkgs" pkgs);
|
||||||
|
_module.check = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
modulesDocs = nmdlib.buildModulesDocs {
|
||||||
|
modules = [
|
||||||
|
setupModule
|
||||||
|
./modules/blocks/ssl.nix
|
||||||
|
];
|
||||||
|
moduleRootPaths = [ ../. ];
|
||||||
|
mkModuleUrl = path: "https://myproject.foo/${path}";
|
||||||
|
channelName = "selfhostblocks";
|
||||||
|
docBook = { id = "selfhostblocks-options"; optionIdPrefix = "shb-opt"; };
|
||||||
|
};
|
||||||
|
|
||||||
|
manual = nmdlib.buildDocBookDocs {
|
||||||
|
pathName = "SelfHostBlocks";
|
||||||
|
modulesDocs = [ modulesDocs ];
|
||||||
|
documentsDirectory = ./docs;
|
||||||
|
chunkToc = ''
|
||||||
|
<toc>
|
||||||
|
<d:tocentry xmlns:d="http://docbook.org/ns/docbook" linkend="book-manual">
|
||||||
|
<?dbhtml filename="index.html"?>
|
||||||
|
</d:tocentry>
|
||||||
|
</toc>
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
in
|
||||||
|
manual.html;
|
||||||
|
|
||||||
checks =
|
checks =
|
||||||
let
|
let
|
||||||
importFiles = files:
|
importFiles = files:
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue