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

@ -16,7 +16,7 @@ in {
defaultEditor = mkOption {
type = types.bool;
default = false;
description = ''
description = lib.mdDoc ''
When enabled, installs neovim and configures neovim to be the default editor
using the EDITOR environment variable.
'';
@ -25,35 +25,35 @@ in {
viAlias = mkOption {
type = types.bool;
default = false;
description = ''
Symlink <command>vi</command> to <command>nvim</command> binary.
description = lib.mdDoc ''
Symlink {command}`vi` to {command}`nvim` binary.
'';
};
vimAlias = mkOption {
type = types.bool;
default = false;
description = ''
Symlink <command>vim</command> to <command>nvim</command> binary.
description = lib.mdDoc ''
Symlink {command}`vim` to {command}`nvim` binary.
'';
};
withRuby = mkOption {
type = types.bool;
default = true;
description = "Enable Ruby provider.";
description = lib.mdDoc "Enable Ruby provider.";
};
withPython3 = mkOption {
type = types.bool;
default = true;
description = "Enable Python 3 provider.";
description = lib.mdDoc "Enable Python 3 provider.";
};
withNodeJs = mkOption {
type = types.bool;
default = false;
description = "Enable Node provider.";
description = lib.mdDoc "Enable Node provider.";
};
configure = mkOption {
@ -82,7 +82,7 @@ in {
type = types.package;
default = pkgs.neovim-unwrapped;
defaultText = literalExpression "pkgs.neovim-unwrapped";
description = "The package to use for the neovim binary.";
description = lib.mdDoc "The package to use for the neovim binary.";
};
finalPackage = mkOption {
@ -97,8 +97,8 @@ in {
example = literalExpression ''
{ "ftplugin/c.vim".text = "setlocal omnifunc=v:lua.vim.lsp.omnifunc"; }
'';
description = ''
Set of files that have to be linked in <filename>runtime</filename>.
description = lib.mdDoc ''
Set of files that have to be linked in {file}`runtime`.
'';
type = with types; attrsOf (submodule (
@ -108,7 +108,7 @@ in {
enable = mkOption {
type = types.bool;
default = true;
description = ''
description = lib.mdDoc ''
Whether this /etc file should be generated. This
option allows specific /etc files to be disabled.
'';
@ -116,7 +116,7 @@ in {
target = mkOption {
type = types.str;
description = ''
description = lib.mdDoc ''
Name of symlink. Defaults to the attribute
name.
'';
@ -125,12 +125,12 @@ in {
text = mkOption {
default = null;
type = types.nullOr types.lines;
description = "Text of the file.";
description = lib.mdDoc "Text of the file.";
};
source = mkOption {
type = types.path;
description = "Path of the source file.";
description = lib.mdDoc "Path of the source file.";
};
};