Skip to content

Commit db1a995

Browse files
authored
Merge pull request #1443 from stgraber/doc
Tweak rendering of manpage in doc
2 parents 7fb9c60 + f3eb4a5 commit db1a995

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

doc/.sphinx/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ furo
22
gitpython
33
linkify-it-py
44
lxd-sphinx-extensions
5-
myst-parser<3.0.0
5+
myst-parser
66
pyspelling
77
sphinx
88
sphinx-autobuild

doc/conf.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,25 @@
5353

5454
with open(os.path.join('.sphinx/deps/manpages/', pagepath), 'w') as mdfile:
5555
mdfile.write('(' + page + ')=\n')
56+
line_block = False
5657
for line in content:
5758
if line.startswith('###### Auto generated'):
5859
continue
60+
elif line.startswith('### Synopsis'):
61+
mdfile.write('## Synopsis\n')
62+
mdfile.write('```{line-block}\n')
63+
line_block = True
5964
elif line.startswith('## '):
6065
mdfile.write('# `' + line[3:].rstrip() + '`\n')
66+
elif line.startswith('```'):
67+
if line_block:
68+
mdfile.write('```\n')
69+
line_block = False
70+
mdfile.write(line)
6171
elif line.startswith('##'):
72+
if line_block:
73+
mdfile.write('```\n')
74+
line_block = False
6275
mdfile.write(line[1:])
6376
else:
6477
mdfile.write(line)

0 commit comments

Comments
 (0)