Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Education
Cantor
Commits
9ecfa3cb
Commit
9ecfa3cb
authored
Jul 21, 2020
by
Shubham .
Browse files
Some more changes to python script
parent
d0526195
Changes
1
Hide whitespace changes
Inline
Side-by-side
admin/documentation/Python/qthelp_generator.py
View file @
9ecfa3cb
...
...
@@ -22,6 +22,7 @@
# and then generate QtHelp files using the keywords generated
import
os
import
re
from
bs4
import
BeautifulSoup
# QtHelp files
...
...
@@ -84,10 +85,12 @@ soup = BeautifulSoup(html, features='html.parser')
for
i
in
soup
.
find_all
(
'a'
):
# replace the characters which produces error while qhcp file
keyword
=
i
.
text
.
replace
(
"<"
,
""
).
replace
(
"&"
,
""
)
keyword
=
re
.
sub
(
r
" ?\([^)]+\)"
,
""
,
keyword
)
link
=
i
[
'href'
]
line
=
'<keyword name = "{}" ref = "{}"/>
\n
'
.
format
(
keyword
,
link
)
qhp
.
write
(
line
)
if
keyword
!=
""
:
line
=
'<keyword name = "{}" ref = "{}"/>
\n
'
.
format
(
keyword
,
link
)
qhp
.
write
(
line
)
html2
=
index2
.
read
()
soup2
=
BeautifulSoup
(
html
,
features
=
'html.parser'
)
...
...
@@ -95,10 +98,12 @@ soup2 = BeautifulSoup(html, features='html.parser')
for
i
in
soup2
.
find_all
(
'a'
):
# replace the characters which produces error while qhcp file
keyword
=
i
.
text
.
replace
(
"<"
,
""
).
replace
(
"&"
,
""
)
keyword
=
re
.
sub
(
r
" ?\([^)]+\)"
,
""
,
keyword
)
link
=
i
[
'href'
]
line
=
'<keyword name = "{}" ref = "{}"/>
\n
'
.
format
(
keyword
,
link
)
qhp
.
write
(
line
)
if
keyword
!=
""
:
line
=
'<keyword name = "{}" ref = "{}"/>
\n
'
.
format
(
keyword
,
link
)
qhp
.
write
(
line
)
# write the tail
qhp
.
writelines
(
"""</keywords>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment