Docs: separate and wrap each choices

This commit is contained in:
pagedown
2021-11-30 18:41:20 +08:00
parent 8685558a2a
commit 1d88371604

View File

@@ -413,7 +413,7 @@ def seq_as_rst(
if defval is not None:
a(textwrap.indent(f'Default: :code:`{defval}`', ' ' * 4))
if opt.get('choices'):
a(textwrap.indent('Choices: :code:`{}`'.format(', '.join(sorted(opt['choices']))), ' ' * 4))
a(textwrap.indent('Choices: {}'.format(', '.join(f':code:`{c}`' for c in sorted(opt['choices']))), ' ' * 4))
a('')
text = '\n'.join(blocks)