1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-09-28 09:17:28 +02:00

treewide: convert options with tables to Markdown

The Markdown options processor cannot handle rendering tables
to DocBook.  This could be fixed, but as we won't be using the
DocBook output for long I just removed them for now in the interest
of expediency; they were all well-suited to being description lists
showing option types anyway, apart from one awkward case in the form
of trayer, which also had ad-hoc syntax for enumerating acceptable
values in the documentation. Since the types aren't actually used for
option processing anyway, I changed them to use `enum` and similar to
give a single description of the acceptable values without a big table.
This commit is contained in:
Emily 2023-07-01 07:14:03 +01:00
parent 21c700d14b
commit 71df507159
3 changed files with 28 additions and 63 deletions

View file

@ -75,23 +75,19 @@ in {
number = true;
ratios = "1:1:2";
};
description = ''
description = lib.mdDoc ''
An attribute set of lf settings. The attribute names and corresponding
values must be among the following supported options.
<informaltable frame="none"><tgroup cols="1"><tbody>
${concatStringsSep "\n" (mapAttrsToList (n: v: ''
<row>
<entry><varname>${n}</varname></entry>
<entry>${v.description}</entry>
</row>
{var}`${n}`
: ${v.description}
'') knownSettings)}
</tbody></tgroup></informaltable>
See the lf documentation for detailed descriptions of these options.
Note, use <varname>previewer</varname> to set lf's
<varname>previewer</varname> option, and
<varname>extraConfig</varname> for any other option not listed above.
Use {option}`programs.lf.previewer.*` to set lf's
{var}`previewer` option, and
[](#opt-programs.lf.extraConfig) for any other option not listed above.
All string options are quoted with double quotes.
'';
};

View file

@ -89,23 +89,19 @@ in {
background = "dark";
}
'';
description = ''
description = lib.mdDoc ''
At attribute set of Vim settings. The attribute names and
corresponding values must be among the following supported
options.
<informaltable frame="none"><tgroup cols="1"><tbody>
${concatStringsSep "\n" (mapAttrsToList (n: v: ''
<row>
<entry><varname>${n}</varname></entry>
<entry>${v.description}</entry>
</row>
{var}`${n}`
: ${v.description}
'') knownSettings)}
</tbody></tgroup></informaltable>
See the Vim documentation for detailed descriptions of these
options. Note, use <varname>extraConfig</varname> to
manually set any options not listed above.
options. Use [](#opt-programs.vim.extraConfig) to manually
set any options not listed above.
'';
};

View file

@ -6,52 +6,44 @@ let
boolTrue = {
type = types.bool;
values = "true|false";
default = "true";
default = true;
};
number0 = {
type = types.int;
values = "number";
default = "0";
default = 0;
};
knownSettings = {
edge = {
type = types.str;
values = "left|right|top|bottom|none";
type = types.enum [ "left" "right" "top" "bottom" "none" ];
default = "bottom";
};
align = {
type = types.str;
values = "left|right|center";
type = types.enum [ "left" "right" "center" ];
default = "center";
};
margin = number0;
widthtype = {
type = types.str;
values = "request|pixel|percent";
type = types.enum [ "request" "pixel" "percent" ];
default = "percent";
};
width = {
type = types.int;
values = "number";
default = "100";
default = 100;
};
heighttype = {
type = types.str;
values = "request|pixel";
type = types.enum [ "request" "pixel" ];
default = "pixel";
};
height = {
type = types.int;
values = "number";
default = "26";
default = 26;
};
SetDockType = boolTrue;
@ -60,27 +52,23 @@ let
transparent = {
type = types.bool;
values = "true|false";
default = "false";
default = false;
};
alpha = {
type = types.int;
values = "number";
default = "127";
default = 127;
};
tint = {
type = types.str;
values = "int";
default = "0xFFFFFFFF";
};
distance = number0;
distancefrom = {
type = types.str;
values = "left|right|top|bottom";
type = types.enum [ "left" "right" "top" "bottom" ];
default = "top";
};
@ -89,9 +77,8 @@ let
padding = number0;
monitor = {
values = "number|primary";
type = types.str;
default = "0";
type = types.either types.ints.unsigned (types.enum [ "primary" ]);
default = 0;
};
iconspacing = number0;
@ -117,28 +104,14 @@ in {
settings = mkOption {
type = with types; attrsOf (nullOr (either str (either bool int)));
description = ''
description = lib.mdDoc ''
Trayer configuration as a set of attributes. Further details can be
found at <link xlink:href="https://github.com/sargon/trayer-srg"/>.
found in [trayer's README](https://github.com/sargon/trayer-srg/blob/master/README).
<informaltable frame="none"><tgroup cols="4">
<thead>
<row>
<entry>Property Name</entry>
<entry>Type</entry>
<entry>Values</entry>
<entry>Default</entry>
</row>
</thead><tbody>
${concatStringsSep "\n" (mapAttrsToList (n: v: ''
<row>
<entry><varname>${n}</varname></entry>
<entry>${v.type.description}</entry>
<entry>${v.values}</entry>
<entry>${v.default}</entry>
</row>
{var}`${n}`
: ${v.type.description} (default: `${builtins.toJSON v.default}`)
'') knownSettings)}
</tbody></tgroup></informaltable>
'';
default = { };
example = literalExpression ''