Skip to content
GitLab
Menu
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
bf451879
Commit
bf451879
authored
Jun 13, 2020
by
Shubham .
Browse files
Create Python script to parse indices from index.hhk
parent
2b365bb9
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/admin/documentation/index_parser.py
0 → 100644
View file @
bf451879
# script to parse index.hhk and generate .xml file
fp
=
open
(
'./index.hhk'
,
'r'
)
fp2
=
open
(
'./output.txt'
,
'w'
)
for
li
in
fp
:
if
li
.
startswith
(
'<li>'
):
line2
=
fp
.
next
()
line3
=
fp
.
next
()
if
not
line2
:
break
else
:
ln2_lastindex
=
line2
.
rindex
(
'"'
)
ln3_lastindex
=
line3
.
rindex
(
'"'
)
name
=
line3
[
29
:
ln3_lastindex
]
ref
=
line2
[
30
:
ln2_lastindex
]
fp2
.
write
(
'<keyword name = "{}" ref = "{}"/>
\n
'
.
format
(
name
,
ref
))
fp
.
close
()
fp2
.
close
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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