Skip to content

Commit ec14cd9

Browse files
committed
Update man page generating program to python3.
1 parent 3ec91f2 commit ec14cd9

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ mingw:
116116
$(MAKE) && $(MAKE) install
117117

118118
man/man3/cmark.3: src/cmark.h | $(CMARK)
119-
python man/make_man_page.py $< > $@ \
119+
python3 man/make_man_page.py $< > $@ \
120120

121121
archive:
122122
git archive --prefix=$(RELEASE)/ -o $(RELEASE).tar.gz HEAD

man/make_man_page.py

+11-11
Original file line numberDiff line numberDiff line change
@@ -47,19 +47,19 @@ def md2man(text):
4747
textlen = len(text)
4848
return render_man(parse_document(textbytes, textlen), 0, 72)
4949

50-
comment_start_re = re.compile('^\/\*\* ?')
51-
comment_delim_re = re.compile('^[/ ]\** ?')
52-
comment_end_re = re.compile('^ \**\/')
53-
function_re = re.compile('^ *(?:CMARK_EXPORT\s+)?(?P<type>(?:const\s+)?\w+(?:\s*[*])?)\s*(?P<name>\w+)\s*\((?P<args>[^)]*)\)')
54-
blank_re = re.compile('^\s*$')
55-
macro_re = re.compile('CMARK_EXPORT *')
56-
typedef_start_re = re.compile('typedef.*{$')
57-
typedef_end_re = re.compile('}')
58-
single_quote_re = re.compile("(?<!\w)'([^']+)'(?!\w)")
59-
double_quote_re = re.compile("(?<!\w)''([^']+)''(?!\w)")
50+
comment_start_re = re.compile(r'^\/\*\* ?')
51+
comment_delim_re = re.compile(r'^[/ ]\** ?')
52+
comment_end_re = re.compile(r'^ \**\/')
53+
function_re = re.compile(r'^ *(?:CMARK_EXPORT\s+)?(?P<type>(?:const\s+)?\w+(?:\s*[*])?)\s*(?P<name>\w+)\s*\((?P<args>[^)]*)\)')
54+
blank_re = re.compile(r'^\s*$')
55+
macro_re = re.compile(r'CMARK_EXPORT *')
56+
typedef_start_re = re.compile(r'typedef.*{$')
57+
typedef_end_re = re.compile(r'}')
58+
single_quote_re = re.compile(r"(?<!\w)'([^']+)'(?!\w)")
59+
double_quote_re = re.compile(r"(?<!\w)''([^']+)''(?!\w)")
6060

6161
def handle_quotes(s):
62-
return re.sub(double_quote_re, '**\g<1>**', re.sub(single_quote_re, '*\g<1>*', s))
62+
return re.sub(double_quote_re, r'**\g<1>**', re.sub(single_quote_re, r'*\g<1>*', s))
6363

6464
typedef = False
6565
mdlines = []

0 commit comments

Comments
 (0)