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

@@ -25,13 +25,13 @@ in
hostName = mkOption {
type = types.str;
example = "postfixadmin.example.com";
description = "Hostname to use for the nginx vhost";
description = lib.mdDoc "Hostname to use for the nginx vhost";
};
adminEmail = mkOption {
type = types.str;
example = "postmaster@example.com";
description = ''
description = lib.mdDoc ''
Defines the Site Admin's email address.
This will be used to send emails from to create mailboxes and
from Send Email / Broadcast message pages.
@@ -40,9 +40,9 @@ in
setupPasswordFile = mkOption {
type = types.path;
description = ''
description = lib.mdDoc ''
Password file for the admin.
Generate with <literal>php -r "echo password_hash('some password here', PASSWORD_DEFAULT);"</literal>
Generate with `php -r "echo password_hash('some password here', PASSWORD_DEFAULT);"`
'';
};
@@ -50,36 +50,36 @@ in
username = mkOption {
type = types.str;
default = "postfixadmin";
description = ''
description = lib.mdDoc ''
Username for the postgresql connection.
If <literal>database.host</literal> is set to <literal>localhost</literal>, a unix user and group of the same name will be created as well.
If `database.host` is set to `localhost`, a unix user and group of the same name will be created as well.
'';
};
host = mkOption {
type = types.str;
default = "localhost";
description = ''
description = lib.mdDoc ''
Host of the postgresql server. If this is not set to
<literal>localhost</literal>, you have to create the
`localhost`, you have to create the
postgresql user and database yourself, with appropriate
permissions.
'';
};
passwordFile = mkOption {
type = types.path;
description = "Password file for the postgresql connection. Must be readable by user <literal>nginx</literal>.";
description = lib.mdDoc "Password file for the postgresql connection. Must be readable by user `nginx`.";
};
dbname = mkOption {
type = types.str;
default = "postfixadmin";
description = "Name of the postgresql database";
description = lib.mdDoc "Name of the postgresql database";
};
};
extraConfig = mkOption {
type = types.lines;
default = "";
description = "Extra configuration for the postfixadmin instance, see postfixadmin's config.inc.php for available options.";
description = lib.mdDoc "Extra configuration for the postfixadmin instance, see postfixadmin's config.inc.php for available options.";
};
};