Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
deephdc-github-io
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
DEEP
deephdc-github-io
Merge requests
!40
Create output path for markdowns if does not exist
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Create output path for markdowns if does not exist
create-md-files-path
into
pelican
Overview
0
Commits
1
Pipelines
0
Changes
1
Merged
Pablo Orviz Fernandez
requested to merge
create-md-files-path
into
pelican
5 years ago
Overview
0
Commits
1
Pipelines
0
Changes
1
Expand
0
0
Merge request reports
Compare
pelican
pelican (base)
and
latest version
latest version
9e57e57f
1 commit,
3 years ago
1 file
+
5
−
2
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
metadata2md.py
+
5
−
2
Options
@@ -41,7 +41,6 @@ def main():
help
=
'
DEEP application metadata
'
)
parser
.
add_argument
(
'
--output-file
'
,
metavar
=
'
MARKDOWN_FILE
'
,
type
=
argparse
.
FileType
(
'
w
'
),
help
=
'
Target markdown file
'
)
args
=
parser
.
parse_args
()
@@ -53,7 +52,11 @@ def main():
jinja_env
=
Environment
(
loader
=
BaseLoader
()).
from_string
(
TEMPLATE
)
md_data
=
jinja_env
.
render
(
json_data
)
if
args
.
output_file
:
args
.
output_file
.
write
(
md_data
)
dirn
=
os
.
path
.
dirname
(
args
.
output_file
)
if
not
os
.
path
.
exists
(
dirn
):
os
.
makedirs
(
dirn
)
with
open
(
args
.
output_file
,
'
w
'
)
as
f
:
f
.
write
(
md_data
)
else
:
print
(
md_data
)
Loading