unf/README.md
2025-07-30 16:40:41 +10:00

54 lines
1.4 KiB
Markdown

# UNF
`unf` is the simplest possible way to generate documentation for a nix module.
given a few straightforward parameters, its `lib` provides documentation outputs for:
- a full documentation website (`html`)
- commonmark (`md`)
- `json`
- `yaml`
- `toml`
- rudimentary `xml`
- raw `nix` attrs
here's how it works:
````nix
# in your flake
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
unf.url = "git+https://git.atagen.co/atagen/unf";
};
outputs = { self, nixpkgs, unf }: {
packages.${system}.docs = unf.lib.html {
# a reference to your flake's self, for path replacement
inherit self;
# an instance of nixpkgs, required for evaluating the raw options
pkgs = nixpkgs.legacyPackages.${system};
# the name of your project, for page title etc
projectName = "unf";
# the intended base path for files referred to by your docs, ie. your public repo
newPath = "https://git.atagen.co/atagen/unf";
# any specialArgs you want in the module system while evaluating your options
specialArgs = { goodDx = true; };
# the modules you wish to document
modules = [ ./nix/interface.nix ];
# any options the user wishes to pass to nixosOptionsDoc
userOpts = { warningsAreErrors = false; };
};
};
}
# in your shell
$ nix build .#docs
````
and that's it.
enjoy !
<sub>if you are looking for the old readme, it is [here](./RANT.md)</sub>