treewide: automatically md-convert option descriptions

the conversion procedure is simple:

 - find all things that look like options, ie calls to either `mkOption`
   or `lib.mkOption` that take an attrset. remember the attrset as the
   option
 - for all options, find a `description` attribute who's value is not a
   call to `mdDoc` or `lib.mdDoc`
 - textually convert the entire value of the attribute to MD with a few
   simple regexes (the set from mdize-module.sh)
 - if the change produced a change in the manual output, discard
 - if the change kept the manual unchanged, add some text to the
   description to make sure we've actually found an option. if the
   manual changes this time, keep the converted description

this procedure converts 80% of nixos options to markdown. around 2000
options remain to be inspected, but most of those fail the "does not
change the manual output check": currently the MD conversion process
does not faithfully convert docbook tags like <code> and <package>, so
any option using such tags will not be converted at all.
This commit is contained in:
pennae
2022-07-28 23:19:15 +02:00
parent 52b0ad17e3
commit 2e751c0772
1050 changed files with 9605 additions and 9605 deletions

View File

@@ -35,7 +35,7 @@ in
environment.variables = mkOption {
default = {};
example = { EDITOR = "nvim"; VISUAL = "nvim"; };
description = ''
description = lib.mdDoc ''
A set of environment variables used in the global environment.
These variables will be set on shell initialisation (e.g. in /etc/profile).
The value of each variable can be either a string or a list of
@@ -48,7 +48,7 @@ in
environment.profiles = mkOption {
default = [];
description = ''
description = lib.mdDoc ''
A list of profiles used to setup the global environment.
'';
type = types.listOf types.str;
@@ -57,10 +57,10 @@ in
environment.profileRelativeEnvVars = mkOption {
type = types.attrsOf (types.listOf types.str);
example = { PATH = [ "/bin" ]; MANPATH = [ "/man" "/share/man" ]; };
description = ''
description = lib.mdDoc ''
Attribute set of environment variable. Each attribute maps to a list
of relative paths. Each relative path is appended to the each profile
of <option>environment.profiles</option> to form the content of the
of {option}`environment.profiles` to form the content of the
corresponding environment variable.
'';
};
@@ -68,7 +68,7 @@ in
# !!! isn't there a better way?
environment.extraInit = mkOption {
default = "";
description = ''
description = lib.mdDoc ''
Shell script code called during global environment initialisation
after all variables and profileVariables have been set.
This code is assumed to be shell-independent, which means you should
@@ -79,7 +79,7 @@ in
environment.shellInit = mkOption {
default = "";
description = ''
description = lib.mdDoc ''
Shell script code called during shell initialisation.
This code is assumed to be shell-independent, which means you should
stick to pure sh without sh word split.
@@ -89,7 +89,7 @@ in
environment.loginShellInit = mkOption {
default = "";
description = ''
description = lib.mdDoc ''
Shell script code called during login shell initialisation.
This code is assumed to be shell-independent, which means you should
stick to pure sh without sh word split.
@@ -99,7 +99,7 @@ in
environment.interactiveShellInit = mkOption {
default = "";
description = ''
description = lib.mdDoc ''
Shell script code called during interactive shell initialisation.
This code is assumed to be shell-independent, which means you should
stick to pure sh without sh word split.
@@ -119,7 +119,7 @@ in
};
environment.homeBinInPath = mkOption {
description = ''
description = lib.mdDoc ''
Include ~/bin/ in $PATH.
'';
default = false;
@@ -127,7 +127,7 @@ in
};
environment.localBinInPath = mkOption {
description = ''
description = lib.mdDoc ''
Add ~/.local/bin/ to $PATH
'';
default = false;
@@ -151,9 +151,9 @@ in
environment.shells = mkOption {
default = [];
example = literalExpression "[ pkgs.bashInteractive pkgs.zsh ]";
description = ''
description = lib.mdDoc ''
A list of permissible login shells for user accounts.
No need to mention <literal>/bin/sh</literal>
No need to mention `/bin/sh`
here, it is placed into this list implicitly.
'';
type = types.listOf (types.either types.shellPackage types.path);