diff options
author | Naïm Favier <n@monade.li> | 2022-01-21 15:06:14 +0100 |
---|---|---|
committer | Naïm Favier <n@monade.li> | 2022-02-24 20:51:40 +0000 |
commit | 53af8832553bb2f82e210d1ea07040e9371af582 (patch) | |
tree | 3acfc03a285019dd2a731bb2e23028cd44d1ad25 /scripts | |
parent | 4ed684481b550a802a9c4af97cdc60354d03a615 (diff) |
Regenerate options.rst
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/generate-rst-options.py | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/scripts/generate-rst-options.py b/scripts/generate-rst-options.py index 3a13074..a7d751e 100644 --- a/scripts/generate-rst-options.py +++ b/scripts/generate-rst-options.py @@ -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( |