Commit Graph
56 Commits
Author SHA1 Message Date
Matt Sturgeon ea95b028a3 docs: drop nixos-render-docs overlay
All patches are now upstream.
2026-07-12 15:18:12 +00:00
Matt Sturgeon 511a763e20 docs: use GFM alert patches from Nixpkgs PR
Replace our gfm-alerts-to-admonitions plugin and nixos-render-docs
patches with patches from the upstream Nixpkgs PR:
https://github.com/NixOS/nixpkgs/pull/538502
2026-07-09 17:39:52 +00:00
Matt Sturgeon a402fdf2a1 docs/modules: move page rendering orchestration to Python
Replace the generated bash+jq rendering pipeline with a Python
implementation.

This avoids repeatedly parsing large JSON blobs during page rendering
and significantly reduces documentation build time.
2026-07-04 13:55:02 +00:00
Matt Sturgeon d3ba58e0bd docs/modules: move rendering logic 2026-07-04 13:55:02 +00:00
saygo-pngandMatt Sturgeon 812d7e639d flake: move the nuschtosSearch input to the dev flake
Signed-off-by: saygo-png <saygo.mail@proton.me>
2025-12-05 13:44:35 +00:00
Matt Sturgeon 7d17c1b71d flake: remove helpers module arg
Not to be confused with the Nixvim-configuration `helpers` module arg,
remove the flake-parts `helpers` module arg.
2025-11-24 10:47:38 +00:00
Matt Sturgeon 334d2eb26e docs/mdbook: general cleanup and renames
Clean up the docs/mdbook/default.nix expression in an attempt to make it
easier to understand.
2025-09-16 15:00:04 +00:00
Austin Horstman 708c601e0d docs: enable on darwin
Now that sandbox issue has been fixed in nix. We can compile and serve
docs.
2025-06-25 19:20:44 +00:00
Matt Sturgeon f3342bdbd4 docs: refactor serve-docs; add nix run .#docs
Refactor `serve-docs` using `makeWrapper`, make it available as a
`serve-docs` package and as the `docs` "app".

This means `nix build .#docs` will build the docs while `nix run .#docs`
will run the server.
2025-05-22 13:48:58 +01:00
Matt Sturgeon 0c7e2aa96b docs: user-guide/helpers.mdlib/index.md
Move the user-guide to the new lib reference docs.

Added a MDBook redirect entry.

Updated man docs.
2025-05-19 00:19:57 +01:00
Matt Sturgeon 1c6dd6579a docs: include function docs
Embed the function reference docs into the main docs website.
2025-05-19 00:19:57 +01:00
Matt Sturgeon dfaea5982e docs/lib: init
Generate reference docs for functions that have RFC145 style
doc-comments.

1. function locations

  `docs/lib/function-locations.nix` scans nixvim's extended lib,
  extracting "position entries" via `unsafeGetAttrPos`.

  This is then converted into a nixdoc `locations.json` map of
  "function name" → "markdown location string".

2. mdbook menu

  `docs/lib/menu.nix` renders a mdbook menu representing all page
  entries.

3. markdown pages

  `docs/lib/default.nix` expects a set of "page entries", which come
  from `docs/lib/pages.nix` by default. It passes this data to
  `function-locations.nix` and `menu.nix`, and uses it internally to
  render markdown pages.

  Page entries can contain a `file` to render using `nixdoc`, and also a
  `markdown` attribute which will be included at the top of the docs.

  Additionally, a `title` can be included. This forms the heading
  `$name: $title`, where `name` is derived from the page's attr-path.

  See https://github.com/nix-community/nixdoc
2025-05-19 00:19:56 +01:00
Matt Sturgeon d7df583211 docs: eval modules without access to pkgs
Replace the `package-options` test with a stricter implementation.

When evaluating modules for use in the docs, provide them with a stubbed
`pkgs` instance that throws an error whenever a package is evaluated.

This ensures we don't accidentally use any packages in defaults or
examples.
2025-01-25 19:16:09 +00:00
Matt Sturgeon 30842191e0 docs: enable warningsAreErrors 2025-01-17 03:56:59 +00:00
Matt Sturgeon 4b3b67fb6f lib: make overrideable & access via flake
Add a non-system specific `<flake>.lib.nixvim` output, which is
equivalent to the existing `<flake>.lib.<system>.helpers` output.

This is now also wrapped with `lib.makeOverridable` to allow overriding
the function args used to construct the nixvim-lib.

Consistently access nixvim-lib via the new flake output, overriding
where necessary.
2024-12-21 15:17:43 +00:00
Matt Sturgeon cdbda982f0 docs/search: refactor to use override 2024-11-18 17:53:47 +00:00
Matt Sturgeon 0562e519ec docs: refactor wrapper-options docs 2024-10-21 18:36:00 +01:00
Marcel 28485b0e57 options-search: configure title 2024-10-09 00:10:41 +02:00
Matt Sturgeon 4b7a41276a modules/nixpkgs: initial pkgs option, drop defaultPkgs specialArg
This minimal implementation allows `nixpkgs.pkgs` to be defined, but
does not implement evaluating an instance from a pkgsPath when _not_
defined.

The `defaultPkgs` specialArg is dropped in favour of `nixpkgs.pkgs`
being defined. If it's not defined, an assertion is thrown.

In the future, a nixpkgs source path can be supplied, defaulting to the
flake's `inputs.nixpkgs`. Along with other `nixpkgs.*` options, this
will allow a `pkgs` instance to be evaluated within the module eval.
2024-09-27 09:30:12 +01:00
Matt Sturgeon cb2b76c1a9 docs/home-manager: eval options without checking config definitions
By default `lib.evalModules` will check all config definitions match
a declared option (or a freeform type), leading to errors like:

    error: The option `wrapRc' does not exist.

Setting `_module.freeformType` or `_module.check` will disable this,
allowing us to evaluate the option declaration without checking the
config definitions.
2024-09-27 02:56:28 +01:00
Matt Sturgeon 1116ae6332 docs: use evalNixvim helper 2024-09-22 18:18:05 +01:00
Matt Sturgeon 191b0a9502 treewide: avoid passing pkgs to our lib
In the two places where our "helpers" lib is exclusively internal
(flake module args and building the docs), we no longer supply `pkgs`.

In the other 4 locations, we now note why we still do in a comment.
2024-09-22 18:18:05 +01:00
Matt Sturgeon 7a147234f8 lib: rename helpers.nix -> default.nix
The old `default.nix` is inlined into the "lib" flake-module, which is
the only place it was used.

This allows "helpers" to take its rightful place at the root of `./lib` 👑
2024-09-13 17:25:17 +01:00
Quentin BoyerandMatt Sturgeon 8eab77b51b docs: Support GFM style admonitions in option descriptions 2024-09-13 13:03:23 +01:00
Quentin BoyerandMatt Sturgeon cab2a30ae1 docs: Create a markdown-it plugin 2024-09-13 12:59:27 +01:00
Matt Sturgeon 6665521525 docs: move pkgs overlays to their own file 2024-09-13 12:26:48 +01:00
Matt Sturgeon 27a0dd435d lib/types: simplify eitherRecursive by defining it only once 2024-09-12 14:44:54 +01:00
Matt Sturgeon a5152c2f8e docs: remove unused oneOfRecursive 2024-09-12 13:00:03 +01:00
Matt Sturgeon d0c0821245 docs: patch nixos-render-docs to output GFM alerts
This does not add support for _using_ GFM syntax alerts, the nixpkgs
syntax must still be used in option descriptions for now.
2024-09-10 17:46:44 +01:00
Matt Sturgeon 70e9532ec2 docs: fix typo in pkgs arg default value 2024-08-28 05:45:29 +01:00
Matt Sturgeon 0bc1699037 docs: call evalModules in one place 2024-08-02 14:38:38 +01:00
Matt Sturgeon 27c4c9c210 lib/modules: init with specialArgs helpers 2024-08-02 14:38:38 +01:00
Quentin BoyerandGaetanLepage c12e59ff7c doc: Use correct href for nuscht-search
This commit also adds a subdirectory in the docs derivation, to have the
same local structure than what is uploaded on github pages.
2024-07-25 18:23:47 +00:00
traxysandGaetanLepage 42a7676d5a docs: Add an option search to our documentation 2024-07-25 14:00:35 +00:00
Matt Sturgeon 8b9ba44195 flake: remove getHelpers function 2024-07-08 16:24:07 +01:00
Matt Sturgeon 04a255ed7e modules/context: init with isDocs
Replaced the `isDocs` specialArg added in #1807 with an internal module
option.

We should only use `specialArgs` when absolutely necessary, a module or
`_module.args` is preferred, but those aren't available until `config`
is evaluated so they can't be used for `imports`.

The main problem with `specialArgs` is it makes our modules less
portable.

Luckily that shouldn't be an issue for these context flags.
2024-07-06 11:47:41 +01:00
Matt Sturgeon edc8602d47 docs: use pkgsDoc to build helpers 2024-07-06 00:32:42 +01:00
Matt Sturgeon 38d43a740f modules/files: don't include modules in the docs
This means we no longer need to spoof the module in the docs implementation.

Instead, we supply the (optional) special arg `isDocs` to `evalModules`.
2024-07-05 17:38:46 +01:00
Matt Sturgeon 2deb61f6a5 modules/top-level: move out of wrappers/modules 2024-07-05 17:20:28 +01:00
Matt Sturgeon d2afb176ff modules: refactor module bootstrapping
Let's simplify things by defining all modules in `./plugins`, `./modules`
and `./wrappers/modules`.

Instead of currying `pkgs` into a bootstrapping module, we can require
`defaultPkgs` be provided as a special arg.

This refactor allows us to completely remove `flake-modules/modules.nix`!
2024-07-02 19:58:30 +01:00
Sefa EyeogluandMatt Sturgeon aa4afbeac2 docs: use lib.extend instead of patching nixpkgs
This speeds up evaluation and removes IFD. Additionally, this makes it
easier to maintain these library changes, as we don't have to maintain
static patches.

Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2024-06-06 11:13:52 +01:00
traxys 62f32bfc71 treewide: Reformat with nixfmt 2024-05-05 22:00:40 +02:00
traxysandGitHub 6d1ef5864b docs: Add a section on module specific options (#1355)
This commit only adds Home-Manager specific options, we should add
sections for the different kind of modules too.

This is _not_ added to the man docs, as it is more complex. If need
arises we could look into how to do it.
2024-03-30 14:52:32 +01:00
Matt SturgeonandGitHub da7c6c41ef docs: fix github link branch (#1300)
Nixvim uses "main" rather than "master".
2024-03-22 13:00:43 +01:00
5d3ed3a09e misc: refactor helpers propagation
Co-authored-by: Robert Hensing <robert@roberthensing.nl>
2024-02-09 14:20:25 +01:00
traxysandGitHub 507ff5b142 docs: Use a nixpkgs patch instead of copy/pasting nixpkgs functions (#1011)
This makes the code more maintainable, as it only depends on our small
patch, instead of a large number of internals of nixpkgs.
2024-02-03 19:04:09 +01:00
traxysandGitHub ca30f8ddac docs: Add wrapper specific options (#1009)
(Fixes #1002)
2024-02-03 17:45:53 +01:00
traxysandGitHub 29225c2797 docs: Correctly generate documentation for types either a (submodule ...) (#929)
This requires pulling quite a lot of code from nixpkgs in order to
make the `either` type work correctly, the effects can be seen for
example in the documentation of `ollama.promps` and `ollama.actions`
2024-01-12 23:22:03 +01:00
wolbyteandGaétan Lepage 6efbb5353c docs: terminate build on shell-script error 2023-09-09 17:51:52 +02:00
wolbyteandGaétan Lepage 26b202828f docs: remove whitespaces from filepaths if any 2023-08-30 15:36:44 +02:00