lib/modules: make mkAliasOptionModule
emit DocBook
Follow-up to https://github.com/NixOS/nixpkgs/pull/208407 Removing `mdDoc` isn't enough, we need to emit actual DocBook.
This commit is contained in:
parent
6c73595e66
commit
fb1bc8de93
|
@ -1113,7 +1113,6 @@ rec {
|
||||||
visible = true;
|
visible = true;
|
||||||
warn = false;
|
warn = false;
|
||||||
use = id;
|
use = id;
|
||||||
wrapDescription = lib.id;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Transitional version of mkAliasOptionModule that uses MD docs. */
|
/* Transitional version of mkAliasOptionModule that uses MD docs. */
|
||||||
|
@ -1122,6 +1121,7 @@ rec {
|
||||||
visible = true;
|
visible = true;
|
||||||
warn = false;
|
warn = false;
|
||||||
use = id;
|
use = id;
|
||||||
|
markdown = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
/* mkDerivedConfig : Option a -> (a -> Definition b) -> Definition b
|
/* mkDerivedConfig : Option a -> (a -> Definition b) -> Definition b
|
||||||
|
@ -1144,7 +1144,7 @@ rec {
|
||||||
(opt.highestPrio or defaultOverridePriority)
|
(opt.highestPrio or defaultOverridePriority)
|
||||||
(f opt.value);
|
(f opt.value);
|
||||||
|
|
||||||
doRename = { from, to, visible, warn, use, withPriority ? true, wrapDescription ? lib.mdDoc }:
|
doRename = { from, to, visible, warn, use, withPriority ? true, markdown ? false }:
|
||||||
{ config, options, ... }:
|
{ config, options, ... }:
|
||||||
let
|
let
|
||||||
fromOpt = getAttrFromPath from options;
|
fromOpt = getAttrFromPath from options;
|
||||||
|
@ -1155,7 +1155,9 @@ rec {
|
||||||
{
|
{
|
||||||
options = setAttrByPath from (mkOption {
|
options = setAttrByPath from (mkOption {
|
||||||
inherit visible;
|
inherit visible;
|
||||||
description = wrapDescription "Alias of {option}`${showOption to}`.";
|
description = if markdown
|
||||||
|
then lib.mdDoc "Alias of {option}`${showOption to}`."
|
||||||
|
else "Alias of <option>${showOption to}</option>.";
|
||||||
apply = x: use (toOf config);
|
apply = x: use (toOf config);
|
||||||
} // optionalAttrs (toType != null) {
|
} // optionalAttrs (toType != null) {
|
||||||
type = toType;
|
type = toType;
|
||||||
|
|
|
@ -41,6 +41,7 @@
|
||||||
# characteristics but (hopefully) indistinguishable output.
|
# characteristics but (hopefully) indistinguishable output.
|
||||||
, allowDocBook ? true
|
, allowDocBook ? true
|
||||||
# whether lib.mdDoc is required for descriptions to be read as markdown.
|
# whether lib.mdDoc is required for descriptions to be read as markdown.
|
||||||
|
# !!! when this is eventually flipped to true, `lib.doRename` should also default to emitting Markdown
|
||||||
, markdownByDefault ? false
|
, markdownByDefault ? false
|
||||||
}:
|
}:
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue