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
osp
tools.ethertoff
Commits
2fba817e
Commit
2fba817e
authored
Oct 17, 2019
by
gijs
Browse files
Renaming variables
parent
7084a533
Changes
1
Hide whitespace changes
Inline
Side-by-side
generator/parse.py
View file @
2fba817e
...
@@ -20,7 +20,7 @@ from generator.extract_meta import extract_meta
...
@@ -20,7 +20,7 @@ from generator.extract_meta import extract_meta
"""
"""
We l
oop through all the pads and 'parse' them as markdown.
L
oop through all the pads and 'parse' them as markdown.
This should return both the content and a dictionary for the metadata
This should return both the content and a dictionary for the metadata
From this information a model is contstructed. The metadata is further
From this information a model is contstructed. The metadata is further
...
@@ -115,15 +115,17 @@ def parse_pads ():
...
@@ -115,15 +115,17 @@ def parse_pads ():
info
(
'Read {}'
.
format
(
pad
.
display_slug
))
info
(
'Read {}'
.
format
(
pad
.
display_slug
))
# Excecuting links
# Excecuting links
for
m
in
models
:
for
m
odel
in
models
:
# resolve links
# resolve links
# collect inline links
# collect inline links
if
m
.
content
:
model
.
resolveLinks
()
if
model
.
content
:
content
,
_
=
resolveReferences
(
m
.
content
,
model
=
m
)
# Second return are the collected references
content
,
_
=
resolveReferences
(
m
.
content
,
model
=
m
)
# Second return are the collected references
# render markdown
# render markdown
m
.
resolveLinks
()
md
=
markdown
.
Markdown
(
extensions
=
[
'extra'
,
TocExtension
(
baselevel
=
2
),
'attr_list'
])
md
=
markdown
.
Markdown
(
extensions
=
[
'extra'
,
TocExtension
(
baselevel
=
2
),
'attr_list'
])
m
.
content
=
mark_safe
(
md
.
convert
(
content
))
model
.
content
=
mark_safe
(
md
.
convert
(
content
))
return
models
return
models
class
Command
(
BaseCommand
):
class
Command
(
BaseCommand
):
...
...
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