mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-09 19:13:26 +03:00
doc/packages/treefmt: add option reference docs
Add a `treefmt.optionsDoc` passthru, which is included on the treefmt section of the nixpkgs manual. This generates reference docs for options declared in `treefmt.evalConfig`.
This commit is contained in:
parent
96f041725f
commit
4c638c2735
6 changed files with 56 additions and 11 deletions
|
@ -49,6 +49,7 @@ stdenvNoCC.mkDerivation (
|
|||
postPatch = ''
|
||||
ln -s ${optionsJSON}/share/doc/nixos/options.json ./config-options.json
|
||||
ln -s ${treefmt.functionsDoc.markdown} ./packages/treefmt-functions.section.md
|
||||
ln -s ${treefmt.optionsDoc.optionsJSON}/share/doc/nixos/options.json ./treefmt-options.json
|
||||
'';
|
||||
|
||||
buildPhase = ''
|
||||
|
|
|
@ -3,10 +3,21 @@
|
|||
[treefmt](https://github.com/numtide/treefmt) streamlines the process of applying formatters to your project, making it a breeze with just one command line.
|
||||
|
||||
The [`treefmt` package](https://search.nixos.org/packages?channel=unstable&show=treefmt)
|
||||
provides functions for configuring treefmt using the module system, which are [documented below](#sec-functions-library-treefmt).
|
||||
provides functions for configuring treefmt using the module system, which are [documented below](#sec-functions-library-treefmt), along with [their options](#sec-treefmt-options-reference).
|
||||
|
||||
Alternatively, treefmt can be configured using [treefmt-nix](https://github.com/numtide/treefmt-nix).
|
||||
|
||||
```{=include=} sections auto-id-prefix=auto-generated-treefmt-functions
|
||||
treefmt-functions.section.md
|
||||
```
|
||||
|
||||
## Options Reference {#sec-treefmt-options-reference}
|
||||
|
||||
The following attributes can be passed to [`withConfig`](#pkgs.treefmt.withConfig) or [`evalConfig`](#pkgs.treefmt.evalConfig):
|
||||
|
||||
```{=include=} options
|
||||
id-prefix: opt-treefmt-
|
||||
list-id: configuration-variable-list
|
||||
source: ../treefmt-options.json
|
||||
```
|
||||
|
||||
|
|
|
@ -420,6 +420,9 @@
|
|||
"sec-tools-of-stdenv": [
|
||||
"index.html#sec-tools-of-stdenv"
|
||||
],
|
||||
"sec-treefmt-options-reference": [
|
||||
"index.html#sec-treefmt-options-reference"
|
||||
],
|
||||
"ssec-cosmic-common-issues": [
|
||||
"index.html#ssec-cosmic-common-issues"
|
||||
],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue