Regenerate options.rst

This commit is contained in:
Naïm Favier 2022-01-21 15:06:14 +01:00
parent 4ed684481b
commit 53af883255
2 changed files with 21 additions and 57 deletions

View file

@ -40,12 +40,18 @@ groups = ["mailserver.loginAccount",
def print_option(name, value):
if 'default' in value:
if value['default'] == "":
default = '- Default: ``""``'
default = '``""``'
elif isinstance(value['default'], dict) and '_type' in value['default']:
if value['default']['_type'] == 'literalExpression':
default = '``{}``'.format(value['default']['text'])
if value['default']['_type'] == 'literalDocBook':
default = value['default']['text']
else:
default = '- Default: ``{}``'.format(v['default'])
# Some default values contains OUTPUTPATHS which make the
# output not stable across nixpkgs updates.
default = re.sub('/nix/store/[\w.-]*/', '<OUTPUT-PATH>/', default) # noqa
default = '``{}``'.format(value['default'])
# Some default values contains OUTPUTPATHS which make the
# output not stable across nixpkgs updates.
default = re.sub('/nix/store/[\w.-]*/', '<OUTPUT-PATH>/', default) # noqa
default = '- Default: ' + default
else:
default = ""
print(template.format(