Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
wwwanlingxiao
public-apis
Commits
0184842e
Unverified
Commit
0184842e
authored
Dec 22, 2017
by
Dave Machado
Browse files
Update Category split logic
parent
46e2c4c9
Changes
1
Hide whitespace changes
Inline
Side-by-side
build/md2json.py
View file @
0184842e
...
...
@@ -14,7 +14,7 @@ def markdown_to_json(filename, anchor):
and
line
.
startswith
(
anchor
)
or
line
.
startswith
(
'| '
))
for
line
in
lines
:
if
line
.
startswith
(
anchor
):
category
=
line
.
split
(
)[
1
]
category
=
line
.
split
(
anchor
)[
1
].
strip
()
continue
chunks
=
[
x
.
strip
()
for
x
in
line
.
split
(
'|'
)[
1
:
-
1
]]
entry
=
{
...
...
@@ -26,7 +26,11 @@ def markdown_to_json(filename, anchor):
'Category'
:
category
,
}
entries
.
append
(
entry
)
return
json
.
dumps
(
entries
)
final
=
{
'count'
:
len
(
entries
),
'entries'
:
entries
,
}
return
json
.
dumps
(
final
)
def
main
():
...
...
Write
Preview
Supports
Markdown
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