docnix

Docnix

Finally, complete autogenerated documentation for the whole nix-ecosystem.

View here

🚧🚧🚧 Under Construction 🚧🚧🚧

Content

Autogenerated documentation from source code including

How it works

  1. Preparation

For this to work properly we need doc-comments in format according to RFC-145. Since nixpkgs is not entirely written in this format we use our package codemod to automatically migrate all comments.

Nixpkgs -> Nixpkgs'

  1. Data extraction

The next step is calling our custom builtins unsafeGetAttrDoc and unsafeGetLambdaDoc to retrieve the documentation for all functions in the nixpkgs expression tree.

Nixpkgs' -> json

  1. Data separation / aggregation

Data is scanned, and additional information from positions, partially applied aliases, etc. is collected and dumped into separate markdown files. Every markdown file also includes a short yaml header needed by the rendering framework.

It contains information about the navigation, tags, headlines and other meta information.

Json -> Markdown

  1. Rendering

We then utilize a simple javascript rendering framework to transform all the scraped data into separate markdown / html pages.

A search index and sitemap.xml is built for page search as well as for external search engines like Google.

Markdown -> Static html

Et voila 🥳

Contributing / Remaining work

All contributions are welcome! ❤️