Announcing Easy-Nix-Documentation

I would like to publicly announce this project I’ve been working on for the last month:

easy-nix-documentation

This is a NodeJS/Vue library that generates documentation from your NixOS modules, to be used with VitePress. This is done by parsing the output of (pkgs.nixosOptionsDoc {...}).optionsJSON. The idea is that easy-nix-documentation integrates into a regular VitePress project, instead of being a new documentation framework.

Easy-Nix-Documentation is in its early days. I’d be happy to have new users, fix any issues that come in and improve the API.

Examples:

26 Likes

So basically what we have been doing with mdBook and the markdown output for vite? Nice.

Can I somehow easily integrate this into an existing Vite site?

Also would be nice if you could use treesitter to highlight the code blocks.

mnw seems to miss some lib.literalExpression’s in quite some places.

Can I somehow easily integrate this into an existing Vite site?

I’d imagine you can, as I’ve tried to make to make the Vue component not hard-dependent on VuePress. But I might need to make some “toggles”, so it doesn’t bundle the CSS, etc.

Feel free to ping me if you want to try it right now.

Also would be nice if you could use treesitter to highlight the code blocks.

VitePress comes with Shiki, so that’s what I’m going to use first for the nix codeblocks.

it’s kinda offtopic, but is anyone aware why markdown options building depends on python script instead of just doing it in nix? Also, I feel like markdown output could be improved to be more concise

Nice project!

Do you have any ambitions in the direction of being able to check if examples are syntactically correct?

Or parsing the descriptions as DocBook and using that format the description?