Skip to content

Comments

Update library function "docstrings" for nixdoc generation#49383

Merged
grahamc merged 5 commits intoNixOS:masterfrom
tazjin:docs/lib-docstrings
Oct 29, 2018
Merged

Update library function "docstrings" for nixdoc generation#49383
grahamc merged 5 commits intoNixOS:masterfrom
tazjin:docs/lib-docstrings

Conversation

@tazjin
Copy link
Member

@tazjin tazjin commented Oct 29, 2018

Motivation for this change

This extracts the changes to documentation comments that previously were in #49275 into a new pull-request. These changes should be backportable to 18.09.

Please see the other PR for more discussion, background information and examples of rendered documentation.

Files covered:

  • lib/lists.nix
  • lib/strings.nix
  • lib/trivial.nix
  • lib/debug.nix
  • lib/options.nix

cc: @grahamc

Expands on some of the function comments and add some of the
special syntaxes recognised by nixdoc.
Updates documentation comments with extra information for nixdoc[1]
compatibility.

Some documentation strings have additionally been reworded for
clarity.

"Faux types" are added where applicable, but some functions do things
that are not trivially representable in the type notation used so they
were ignored for this purpose.

[1]: https://github.com/tazjin/nixdoc
Documents functions in `lib.debug` for docs generation with nixdoc.

Note that type signatures and clearer descriptions are still missing
on some of these functions, but this is good enough for a first run.
Documents functions in `lib.options` for docs generation with nixdoc.

The formatting change in the `mkOption` arguments is due to the way
`nixdoc` parses documentation comments on pattern arguments. It's not
ideal, but it works.
@GrahamcOfBorg GrahamcOfBorg added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. labels Oct 29, 2018
@grahamc grahamc merged commit 0c5d9e5 into NixOS:master Oct 29, 2018
@grahamc
Copy link
Member

grahamc commented Oct 29, 2018

Please open a backport pr with git cherry-pick -x these,commit,hashes to the release-18.09 branch

@tazjin tazjin deleted the docs/lib-docstrings branch October 29, 2018 11:32
@tazjin tazjin mentioned this pull request Mar 6, 2019
14 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants