From 92e350985819b7f324007cb92650019e9f6558c6 Mon Sep 17 00:00:00 2001 From: Minijackson Date: Tue, 9 Nov 2021 15:29:00 +0100 Subject: doc-options-md: support old-style "literalExample" expressions --- doc-options-md.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/doc-options-md.nix b/doc-options-md.nix index ea21746..5cbc7c2 100644 --- a/doc-options-md.nix +++ b/doc-options-md.nix @@ -7,8 +7,12 @@ with lib; let visibleOptionDocs = filter (opt: opt.visible && !opt.internal) (optionAttrSetToDocList options); + isLiteral = value: + value ? _type && + (value._type == "literalExpression" || value._type == "literalExample"); + toValue = value: - if value ? _type && value._type == "literalExpression" then value.text + if isLiteral value then value.text else generators.toPretty { } value; toMarkdown = option: -- cgit v1.2.3