|
45 | 45 | r'<h1>(.*?)</h1>\s*<div class="C_prototype"[^>]*>'
|
46 | 46 | r'(.*?)</div>\s*<div id="I_description"[^>]*>(.*?)</div>',
|
47 | 47 | r'.TH "\3" 3 "%s" "cplusplus.com" "C++ Programmer\'s Manual"\n'
|
48 |
| - r'\n.SH NAME\n\3 - \5\n' |
49 |
| - r'\n.SE\n.SH TYPE\n\1\n' |
50 |
| - r'\n.SE\n.SH SYNOPSIS\n#include \2\n.sp\n\4\n' |
51 |
| - r'\n.SE\n.SH DESCRIPTION\n' % datetime.date.today(), re.S), |
| 48 | + r'\n.SH "NAME"\n\3 - \5\n' |
| 49 | + r'\n.SE\n.SH "TYPE"\n\1\n' |
| 50 | + r'\n.SE\n.SH "SYNOPSIS"\n#include \2\n.sp\n\4\n' |
| 51 | + r'\n.SE\n.SH "DESCRIPTION"\n' % datetime.date.today(), re.S), |
52 | 52 | (r'\s*<div id="I_type"[^>]*>(.*?)\s*</div>\s*'
|
53 | 53 | r'<div id="I_file"[^>]*>(.*?)</div>\s*'
|
54 | 54 | r'<h1>(.*?)</h1>\s*'
|
55 | 55 | r'<div id="I_description"[^>]*>(.*?)</div>',
|
56 | 56 | r'.TH "\3" 3 "%s" "cplusplus.com" "C++ Programmer\'s Manual"\n'
|
57 |
| - r'\n.SH NAME\n\3 - \4\n' |
58 |
| - r'\n.SE\n.SH TYPE\n\1\n' |
59 |
| - r'\n.SE\n.SH SYNOPSIS\n#include \2\n.sp\n' |
60 |
| - r'\n.SE\n.SH DESCRIPTION\n' % datetime.date.today(), re.S), |
| 57 | + r'\n.SH "NAME"\n\3 - \4\n' |
| 58 | + r'\n.SE\n.SH "TYPE"\n\1\n' |
| 59 | + r'\n.SE\n.SH "SYNOPSIS"\n#include \2\n.sp\n' |
| 60 | + r'\n.SE\n.SH "DESCRIPTION"\n' % datetime.date.today(), re.S), |
61 | 61 | (r'\s*<div id="I_type"[^>]*>(.*?)\s*</div>\s*<h1>(.*?)</h1>\s*'
|
62 | 62 | r'<div id="I_description"[^>]*>(.*?)</div>',
|
63 | 63 | r'.TH "\2" 3 "%s" "cplusplus.com" "C++ Programmer\'s Manual"\n'
|
64 |
| - r'\n.SH NAME\n\2 - \3\n' |
65 |
| - r'\n.SE\n.SH TYPE\n\1\n' |
66 |
| - r'\n.SE\n.SH DESCRIPTION\n' % datetime.date.today(), re.S), |
| 64 | + r'\n.SH "NAME"\n\2 - \3\n' |
| 65 | + r'\n.SE\n.SH "TYPE"\n\1\n' |
| 66 | + r'\n.SE\n.SH "DESCRIPTION"\n' % datetime.date.today(), re.S), |
67 | 67 | (r'\s*<div id="I_type"[^>]*>(.*?)\s*</div>\s*<h1>(.*?)</h1>\s*'
|
68 | 68 | r'<div id="I_file"[^>]*>(.*?)</div>\s*<div id="I_description"[^>]*>'
|
69 | 69 | '(.*?)</div>',
|
70 | 70 | r'.TH "\2" 3 "%s" "cplusplus.com" "C++ Programmer\'s Manual"\n'
|
71 |
| - r'\n.SH NAME\n\2 - \4\n' |
72 |
| - r'\n.SE\n.SH TYPE\n\1\n' |
73 |
| - r'\n.SE\n.SH DESCRIPTION\n' % datetime.date.today(), re.S), |
| 71 | + r'\n.SH "NAME"\n\2 - \4\n' |
| 72 | + r'\n.SE\n.SH "TYPE"\n\1\n' |
| 73 | + r'\n.SE\n.SH "DESCRIPTION"\n' % datetime.date.today(), re.S), |
74 | 74 | (r'\s*<div id="I_type"[^>]*>(.*?)\s*</div>\s*<h1>(.*?)</h1>\s*'
|
75 | 75 | r'<div class="C_prototype"[^>]*>(.*?)</div>\s*'
|
76 | 76 | r'<div id="I_description"[^>]*>(.*?)</div>',
|
77 | 77 | r'.TH "\2" 3 "%s" "cplusplus.com" "C++ Programmer\'s Manual"\n'
|
78 |
| - r'\n.SH NAME\n\2 - \4\n' |
79 |
| - r'\n.SE\n.SH TYPE\n\1\n' |
80 |
| - r'\n.SE\n.SH SYNOPSIS\n\3\n' |
81 |
| - r'\n.SE\n.SH DESCRIPTION\n' % datetime.date.today(), re.S), |
| 78 | + r'\n.SH "NAME"\n\2 - \4\n' |
| 79 | + r'\n.SE\n.SH "TYPE"\n\1\n' |
| 80 | + r'\n.SE\n.SH "SYNOPSIS"\n\3\n' |
| 81 | + r'\n.SE\n.SH "DESCRIPTION"\n' % datetime.date.today(), re.S), |
82 | 82 | (r'<span class="C_ico cpp11warning".*?>', r' [C++11]', re.S),
|
83 | 83 | # Remove empty #include
|
84 | 84 | (r'#include \n.sp\n', r'', 0),
|
@@ -216,10 +216,10 @@ def html2groff(data, name):
|
216 | 216 | def func_test():
|
217 | 217 | """Test if there is major format changes in cplusplus.com"""
|
218 | 218 | ifs = urllib.urlopen('http://www.cplusplus.com/printf')
|
219 |
| - result = html2groff(ifs.read()) |
220 |
| - assert '.SH NAME' in result |
221 |
| - assert '.SH TYPE' in result |
222 |
| - assert '.SH DESCRIPTION' in result |
| 219 | + result = html2groff(ifs.read(), 'printf') |
| 220 | + assert '.SH "NAME"' in result |
| 221 | + assert '.SH "TYPE"' in result |
| 222 | + assert '.SH "DESCRIPTION"' in result |
223 | 223 |
|
224 | 224 |
|
225 | 225 | def test():
|
|
0 commit comments