From 4f0433ffce8dfb0d38df3826329ad68487446798 Mon Sep 17 00:00:00 2001 From: John Garbutt Date: Thu, 26 May 2016 14:33:57 +0100 Subject: [PATCH] Allow bulleted lists in config reference This is very much a hack, but its really just to see if it is possible to convert the bullet lists into text that renders correctly with rst. This was tested with the nova-hyperv.rst: https://github.com/JohnGarbutt/openstack-manuals/blob/f0607509e349ba83074f163fe5c2f813dfc673a4/doc/config-reference/source/tables/nova-hyperv.rst Change-Id: Iab063774f6732d52cd8e79f82ff0fc93bd6d306b --- autogenerate_config_docs/autohelp.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/autogenerate_config_docs/autohelp.py b/autogenerate_config_docs/autohelp.py index ce287bfe..695c4a84 100755 --- a/autogenerate_config_docs/autohelp.py +++ b/autogenerate_config_docs/autohelp.py @@ -459,8 +459,15 @@ def write_files(package_name, options, target, output_format): if not option.help: option.help = "No help text available for this option." - helptext = option.help.strip().replace('\n', ' ') + + helptext = option.help.strip() + helptext = helptext.replace('\n\n', '$sentinal$') + helptext = helptext.replace('\n*', '$sentinal$*') + helptext = helptext.replace('\n', ' ') helptext = ' '.join(helptext.split()) + # TODO(johngarbutt) space matches only the current template :( + helptext = helptext.replace('$sentinal$', '\n\n ') + if option.deprecated_for_removal: if not option.help.strip().startswith('DEPRECATED'): helptext = 'DEPRECATED: ' + helptext