Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
howto-cards LEGACY VERSION
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
Model registry
Operate
Environments
Monitor
Incidents
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
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
R3
howto-cards LEGACY VERSION
Commits
d35864e3
Verified
Commit
d35864e3
authored
3 years ago
by
Laurent Heirendt
Browse files
Options
Downloads
Patches
Plain Diff
split generation of whitelist into separate function
parent
7ef66171
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!354
[release] Regular merge of develop
,
!347
Move lab cards external
Pipeline
#52778
passed with warnings
3 years ago
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
.ci/generateIndex.py
+19
-14
19 additions, 14 deletions
.ci/generateIndex.py
with
19 additions
and
14 deletions
.ci/generateIndex.py
+
19
−
14
View file @
d35864e3
...
...
@@ -147,7 +147,7 @@ def remove_header(localroot, root, filename):
return
n
def
generate_header
(
folder
,
permalink
,
shortcut
,
order
):
def
generate_header
(
folder
,
permalink
,
shortcut
,
order
,
legacy_from
):
header
=
"
---
\n
"
if
len
(
order
)
>
0
:
...
...
@@ -163,7 +163,7 @@ def generate_header(folder, permalink, shortcut, order):
if
"
handbook-annexes
"
in
permalink
or
"
handbook-additional
"
in
permalink
:
header
+=
"
- /cards/
"
+
root_handbook
(
shortcut
)
+
"
\n
"
header
+=
"
- /
"
+
folder
+
"
/cards/
"
+
root_handbook
(
shortcut
)
+
"
\n
"
#
after moving lab cards
#
separate lab section
if
"
lab-software
"
in
permalink
or
"
lab-equipment
"
in
permalink
or
"
lab-hsa
"
in
permalink
:
header
+=
"
- /cards/
"
+
root_lab
(
shortcut
)
+
"
\n
"
header
+=
"
- /
"
+
folder
+
"
/cards/
"
+
root_lab
(
shortcut
)
+
"
\n
"
...
...
@@ -176,6 +176,21 @@ def generate_header(folder, permalink, shortcut, order):
return
header
def
generate_whitelist_entry
(
folder
,
permalink
,
shortcut
):
wl_entry
=
permalink
+
"
\n
"
wl_entry
+=
"
/?
"
+
shortcut
+
"
\n
"
wl_entry
+=
"
/cards/
"
+
shortcut
+
"
\n
"
wl_entry
+=
"
/
"
+
folder
+
"
/cards/
"
+
shortcut
+
"
\n
"
if
"
handbook-annexes
"
in
permalink
or
"
handbook-additional
"
in
permalink
:
wl_entry
+=
"
/cards/
"
+
root_handbook
(
shortcut
)
+
"
\n
"
wl_entry
+=
"
/
"
+
folder
+
"
/cards/
"
+
root_handbook
(
shortcut
)
+
"
\n
"
# separate lab section
if
"
lab-software
"
in
permalink
or
"
lab-equipment
"
in
permalink
or
"
lab-hsa
"
in
permalink
:
wl_entry
+=
"
/cards/
"
+
root_lab
(
shortcut
)
+
"
\n
"
wl_entry
+=
"
/
"
+
folder
+
"
/cards/
"
+
root_lab
(
shortcut
)
+
"
\n
"
return
wl_entry
# loop through the entire internal tree
localroot
=
os
.
getcwd
()
...
...
@@ -274,20 +289,10 @@ for folder in cardDirs:
orderArr
[
indexS
]
=
[]
# generate the header for each card
header
=
generate_header
(
folder
,
permalink
,
shortcut
,
order
)
header
=
generate_header
(
folder
,
permalink
,
shortcut
,
order
,
legacy_from
)
# add autogenerated links to whitelist
whiteList
+=
permalink
+
"
\n
"
whiteList
+=
"
/?
"
+
shortcut
+
"
\n
"
whiteList
+=
"
/cards/
"
+
shortcut
+
"
\n
"
whiteList
+=
"
/
"
+
folder
+
"
/cards/
"
+
shortcut
+
"
\n
"
if
"
handbook-annexes
"
in
permalink
or
"
handbook-additional
"
in
permalink
:
whiteList
+=
"
- /cards/
"
+
root_handbook
(
shortcut
)
+
"
\n
"
whiteList
+=
"
- /
"
+
folder
+
"
/cards/
"
+
root_handbook
(
shortcut
)
+
"
\n
"
# after moving lab cards
if
"
lab-software
"
in
permalink
or
"
lab-equipment
"
in
permalink
or
"
lab-hsa
"
in
permalink
:
whiteList
+=
"
- /cards/
"
+
root_lab
(
shortcut
)
+
"
\n
"
whiteList
+=
"
- /
"
+
folder
+
"
/cards/
"
+
root_lab
(
shortcut
)
+
"
\n
"
whiteList
+=
generate_whitelist_entry
(
folder
,
permalink
,
shortcut
)
# add the header properly speaking
line_prepender
(
fileName
,
header
)
...
...
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