Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
SWIFTweb
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SWIFT
SWIFTweb
Commits
bde0cb09
Commit
bde0cb09
authored
2 years ago
by
JBorrow
Browse files
Options
Downloads
Patches
Plain Diff
Updated renderer to use new versions as of py 3.10
parent
0d573dec
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
about.py
+4
-1
4 additions, 1 deletion
about.py
compiler.py
+2
-2
2 additions, 2 deletions
compiler.py
mdcomp.py
+3
-3
3 additions, 3 deletions
mdcomp.py
with
9 additions
and
6 deletions
about.py
+
4
−
1
View file @
bde0cb09
...
...
@@ -23,7 +23,7 @@ import yaml
def
open_meta
(
filename
=
"
about_meta.yaml
"
,
data_dir
=
"
../data
"
):
"""
Read the meta file and return the associated data
"""
with
open
(
f
"
{
data_dir
}
/
{
filename
}
"
,
"
r
"
)
as
handle
:
return
yaml
.
load
(
handle
)
return
yaml
.
safe_
load
(
handle
)
def
compile_markdown
(
data
,
data_dir
=
"
../data
"
):
...
...
@@ -50,6 +50,9 @@ class Parser(HTMLParser):
self
.
waiting_for_data
=
False
def
handle_starttag
(
self
,
tag
,
attrs
):
if
len
(
attrs
)
==
0
:
return
for
attr
in
attrs
:
if
attr
[
0
]
==
"
id
"
:
this_id
=
attr
[
1
]
...
...
This diff is collapsed.
Click to expand it.
compiler.py
+
2
−
2
View file @
bde0cb09
...
...
@@ -44,7 +44,7 @@ def get_associated_data(template_names, data_dir="../data"):
# YAML Search
try
:
with
open
(
f
"
{
data_dir
}
/
{
stub
}
.yaml
"
,
"
r
"
)
as
handle
:
this_data
=
dict
(
yaml
.
load
(
handle
),
**
this_data
)
this_data
=
dict
(
yaml
.
safe_
load
(
handle
),
**
this_data
)
except
FileNotFoundError
:
pass
...
...
@@ -104,7 +104,7 @@ def global_variables(active, data_dir="../data"):
production of the processed navbar.
"""
with
open
(
"
{}/global.yaml
"
.
format
(
data_dir
),
"
r
"
)
as
handle
:
raw
=
yaml
.
load
(
handle
)
# We need to process the navbar.
raw
=
yaml
.
safe_
load
(
handle
)
# We need to process the navbar.
return
process_navbar
(
raw
,
active
)
...
...
This diff is collapsed.
Click to expand it.
mdcomp.py
+
3
−
3
View file @
bde0cb09
...
...
@@ -32,7 +32,7 @@ except (OSError, ModuleNotFoundError) as e:
print
(
"
Pandoc not found on your system. Using mistune (python-only)
"
)
import
mistune
class
IDRenderer
(
mistune
.
Renderer
):
class
IDRenderer
(
mistune
.
HTML
Renderer
):
def
header
(
self
,
text
,
level
,
raw
=
None
):
text
=
"
<h{} id={}>{}</h{}>
"
.
format
(
level
,
...
...
@@ -43,8 +43,8 @@ except (OSError, ModuleNotFoundError) as e:
return
text
renderer
=
IDRenderer
()
markdown
=
mistune
.
M
arkdown
(
renderer
=
renderer
)
renderer
=
IDRenderer
(
escape
=
False
)
markdown
=
mistune
.
create_m
arkdown
(
renderer
=
renderer
)
def
convert_text
(
input_text
):
return
markdown
(
input_text
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment