From: Kefu Chai Date: Tue, 11 May 2021 07:50:02 +0000 (+0800) Subject: doc/_ext: print "default" using "literal" filter X-Git-Tag: v17.1.0~1986^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=80eb4f42fb02ff98190fb8cc1aab8d96a92f5a9e;p=ceph.git doc/_ext: print "default" using "literal" filter there is chance that the default value of an option is empty, before this change the rendered result would be "````", and sphinx is confused at seeing this: Unexpected section title or transition. as it takes it as a notion of section title. after this change, the "literal" filter is always applied to the default value, so an empty string is rendered like "" instead. Signed-off-by: Kefu Chai --- diff --git a/doc/_ext/ceph_confval.py b/doc/_ext/ceph_confval.py index ffe036a6b93f..524c6bc2b75b 100644 --- a/doc/_ext/ceph_confval.py +++ b/doc/_ext/ceph_confval.py @@ -41,7 +41,7 @@ TEMPLATE = ''' {%- elif opt.type == 'bool' %} :default: ``{{ default | string | lower }}`` {%- else %} - :default: ``{{ default }}`` + :default: {{ default | literal }} {%- endif -%} {%- endif %} {%- if opt.enum_values %}