Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
generator
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
R3
apps
generator
Commits
79e41349
Verified
Commit
79e41349
authored
2 years ago
by
Laurent Heirendt
Browse files
Options
Downloads
Patches
Plain Diff
remove the category from img path
parent
8d958c4a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
qms.py
+10
-2
10 additions, 2 deletions
qms.py
with
10 additions
and
2 deletions
qms.py
+
10
−
2
View file @
79e41349
import
os
def
get_category
(
filename
):
name_list
=
filename
.
split
(
"
-
"
)
return
name_list
[
2
]
def
prepare_qms
(
localroot
,
root
,
filename
,
nb
):
os
.
chdir
(
root
)
...
...
@@ -15,9 +20,12 @@ def prepare_qms(localroot, root, filename, nb):
# replace latex command for titles
filedata
=
filedata
.
replace
(
"
{-}
"
,
"
##
"
)
# get the category
category
=
get_category
(
filename
)
# deal with img location
filedata
=
filedata
.
replace
(
"
policies/
"
+
filename
[:
-
3
]
+
"
/
"
,
""
)
filedata
=
filedata
.
replace
(
"
sops/
"
+
filename
[:
-
3
]
+
"
/
"
,
""
)
filedata
=
filedata
.
replace
(
"
policies/
"
+
category
+
"
/
"
+
filename
[:
-
3
]
+
"
/
"
,
""
)
filedata
=
filedata
.
replace
(
"
sops/
"
+
category
+
"
/
"
+
filename
[:
-
3
]
+
"
/
"
,
""
)
# replace img attributes
filedata
=
filedata
.
replace
(
"
{ width=50% }
"
,
""
)
...
...
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