1
1
#!/usr/bin/python3
2
2
3
3
## mkqhcp.py
4
- ## Version 1.0.2
4
+ ## Version 1.0.3
5
5
6
6
## Copyright 2022-2023 John Donoghue
7
7
##
@@ -41,7 +41,7 @@ def process(name):
41
41
f .write ('</QHelpCollectionProject>\n ' )
42
42
43
43
title = name
44
- pat_match = re .compile (".*<title>(?P<title>[^<]+)</title>.*" )
44
+ pat_match = re .compile (r ".*<title>(?P<title>[^<]+)</title>.*" )
45
45
with open (name + ".html" , 'rt' ) as fin :
46
46
# find html
47
47
for line in fin :
@@ -51,20 +51,20 @@ def process(name):
51
51
title = e .group ("title" )
52
52
break
53
53
54
- h2_match = re .compile ('.*<h2 class="chapter"[^>]*>(?P<title>[^<]+)</h2>.*' )
55
- h3_match = re .compile ('.*<h3 class="section"[^>]*>(?P<title>[^<]+)</h3>.*' )
56
- h4_match = re .compile ('.*<h4 class="subsection"[^>]*>(?P<title>[^<]+)</h4>.*' )
57
- tag_match1 = re .compile ('.*<span id="(?P<tag>[^"]+)"[^>]*></span>.*' )
58
- #tag_match2 = re.compile('.*<div class="[sub]*section" id="(?P<tag>[^"]+)"[^>]*>.*')
59
- tag_match2 = re .compile ('.*<div class="[sub]*section[^"]*" id="(?P<tag>[^"]+)"[^>]*>.*' )
60
- tag_match3 = re .compile ('.*<div class="chapter-level-extent" id="(?P<tag>[^"]+)"[^>]*>.*' )
61
- index_match = re .compile ('.*<h4 class="subsection"[^>]*>[\d\.\s]*(?P<name>[^<]+)</h4>.*' )
54
+ h2_match = re .compile (r '.*<h2 class="chapter"[^>]*>(?P<title>[^<]+)</h2>.*' )
55
+ h3_match = re .compile (r '.*<h3 class="section"[^>]*>(?P<title>[^<]+)</h3>.*' )
56
+ h4_match = re .compile (r '.*<h4 class="subsection"[^>]*>(?P<title>[^<]+)</h4>.*' )
57
+ tag_match1 = re .compile (r '.*<span id="(?P<tag>[^"]+)"[^>]*></span>.*' )
58
+ #tag_match2 = re.compile(r '.*<div class="[sub]*section" id="(?P<tag>[^"]+)"[^>]*>.*')
59
+ tag_match2 = re .compile (r '.*<div class="[sub]*section[^"]*" id="(?P<tag>[^"]+)"[^>]*>.*' )
60
+ tag_match3 = re .compile (r '.*<div class="chapter-level-extent" id="(?P<tag>[^"]+)"[^>]*>.*' )
61
+ index_match = re .compile (r '.*<h4 class="subsection"[^>]*>[\d\.\s]*(?P<name>[^<]+)</h4>.*' )
62
62
63
63
tag = "top"
64
64
has_h2 = False
65
65
has_h3 = False
66
66
67
- #pat_match = re.compile('.*<span id="(?P<tag>[^"])"></span>(?P<title>[.]+)$')
67
+ #pat_match = re.compile(r '.*<span id="(?P<tag>[^"])"></span>(?P<title>[.]+)$')
68
68
with open (name + ".html" , 'rt' ) as fin :
69
69
with open (name + ".qhp" , 'wt' ) as f :
70
70
f .write ('<?xml version="1.0" encoding="UTF-8"?>\n ' )
0 commit comments