A place to host documentation for flake modules created using flake-parts.
We use Emanote to serve the documentation from their individual repos.
[!CAUTION] We are working to simplify the documentation setup for new modules. See https://github.com/flake-parts/community.flake.parts/issues/6
Put your Markdown docs in a sub-folder, eg: ./doc
:
[[..]]
style wiki-links to link between pages.Add the following YAML meta[^imp] to your index.md
page, replacing NAME
with your module name:
short-title: NAME
template:
sidebar:
collapsed: true
emanote:
folder-folgezettel: false
index.yaml
containing the following, replacing NAME
with your module name, and USER/REPO
with your GitHub repo info:
page:
siteTitle: NAME
headHtml: |
<snippet var="js.highlightjs" />
template:
editBaseUrl: https://github.com/USER/REPO/edit/main/doc
sidebar:
collapsed: false
Create a doc/flake.nix
file with the following content, replacing NAME
with your module name:
{
inputs = {
cfp.url = "github:flake-parts/community.flake.parts/mod";
nixpkgs.follows = "cfp/nixpkgs";
flake-parts.follows = "cfp/flake-parts";
};
outputs = inputs:
inputs.flake-parts.lib.mkFlake { inherit inputs; } {
systems = inputs.nixpkgs.lib.systems.flakeExposed;
imports = [
inputs.cfp.flakeModules.default
];
perSystem = {
flake-parts-docs = {
enable = true;
modules."NAME" = {
path = ./.;
pathString = "./.";
};
};
};
};
}
nix run ./doc
to live preview the docsnix build ./doc
to build statically generated website of the docsThis will give you a local copy of https://community.flake.parts/ but using your local module docs (overriding the upstream one if any).
[^imp]: These organizational clutches will be fixed in future versions of Emanote (see https://github.com/srid/emanote/issues/494), such that you can just write all docs under ./doc
.
For further information, see Emanote guide.
flake.nix
,
flake-parts-docs.modules
option.doc/mods.md
, add a link to your module's documentationnix run
to test the site locally. You can run nix run .#preview
to preview the statically generated site.In nix shell,
just run