doc: Fix Sphinx build warnings

This commit is contained in:
Tatsuhiro Tsujikawa
2016-07-16 19:07:31 +09:00
parent 53e1623ab3
commit 7506a93179
8 changed files with 42 additions and 17 deletions

View File

@@ -166,7 +166,8 @@ def format_text(text):
else:
text = re.sub(r'\*', r'\*', text)
# markup option reference
text = re.sub(r'(^|\s)(-[a-zA-Z0-9-]+)', r'\1:option:`\2`', text)
text = re.sub(r'(^|\s)(-[a-zA-Z0-9]|--[a-zA-Z0-9-]+)',
r'\1:option:`\2`', text)
# sphinx does not like markup like ':option:`-f`='. We need
# backslash between ` and =.
text = re.sub(r'(:option:`.*?`)(\S)', r'\1\\\2', text)