Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • vilem.ded/howto-cards
  • yjarosz/labCards
  • sarah.diehl/howto-cards
  • jacek.lebioda/howto-cards
  • pinar.alper/howto-cards
  • maharshi.vyas/howto-cards
  • manuel.maidorn/howto-cards
  • roland.krause/howto-cards
  • miriam.fougeras/howto-cards
  • soraya.hezzaz/howto-cards
  • fasavanh.sanichanh/howto-cards
  • marie.fossepre/howto-cards
  • jennifer.behm/howto-cards
  • annegrat.daujeumont/howto-cards
  • jon.gales/howto-cards-jpg
  • sandy.thill/howto-cards
  • jenny.tran/howto-cards
17 results
Show changes
Commits on Source (34)
Showing
with 109 additions and 27 deletions
......@@ -42,6 +42,35 @@ def build_section_start(title, shortcut):
def build_section_end():
return "\t\t</ul>\n\t</div>"
def save_order(localroot, root, filename):
order = ""
os.chdir(root)
with open(filename, 'r') as f:
for line in f:
# check for the start of the section
if line[0:6] == "order:":
order = line[7:]
break
# change back to the local root
os.chdir(localroot)
return order.rstrip()
def get_ignore():
return ["404.html",
"Gemfile",
"Gemfile.lock",
"README.md",
"_config.yml",
"_site",
"assets",
"help.md",
"index.md",
"pagination.md"
]
def save_legacy_from(localroot, root, filename):
legacy_from = []
os.chdir(root)
......@@ -56,12 +85,13 @@ def save_legacy_from(localroot, root, filename):
legacy_from_flag = True
# append lines from the legacy section
if legacy_from_flag and line[0:12]:
if legacy_from_flag:
legacy_from.append(line)
# check for the end of the header
if legacy_from_flag and line[0:3] == "---":
legacy_from_flag = False
break
# change back to the local root
os.chdir(localroot)
......@@ -75,6 +105,7 @@ def remove_header(localroot, root, filename):
# count the number of lines
count = 0
n = 0
headerCheck = False
with open(filename, 'r') as f:
for line in f:
......@@ -105,6 +136,8 @@ def remove_header(localroot, root, filename):
# loop through the entire internal tree
localroot = os.getcwd()
# retrieve ignore list
ignore = get_ignore()
# generate the index properly speaking
cardDirs = ["internal", "external", "policies"]
......@@ -117,7 +150,7 @@ for direct in cardDirs:
dirs = natsorted(dirs)
for d in dirs:
if d[0] != ".":
if d[0] != "." and d not in ignore:
sections.append(d)
sections = list(set(sections))
......@@ -128,24 +161,27 @@ index = ''
index += '\n<div class="index-box-container">\n'
whiteList = ''
localIndexArr = [[]] * len(sections)
localIndexArr = {k: [] for k in range(len(sections))}
orderArr = {k: [] for k in range(len(sections))}
for folder in cardDirs:
# FolderFlag gets set to true at the first iteration
folderFlag = True
# check if folder exists
if path.isdir(folder):
if path.isdir(folder) and folder not in ignore:
dirs = os.listdir(folder)
dirs = natsorted(dirs)
for d in dirs:
if d[0] != ".":
if d[0] != "." and d not in ignore:
# set the header of the section
#index += "\n### " + d.replace("-", " ").capitalize() + "\n"
# get the index of the section
indexS = sections.index(d)
maxOrder = 0
#print(indexS)
if len(localIndexArr[indexS]) == 0:
localIndexArr[indexS] = ["\n"]
......@@ -159,7 +195,8 @@ for folder in cardDirs:
if file[0] != "_":
print(" > Generating header for: " + fileName)
# save legacy section
# save order and legacy section
order = save_order(localroot, root, file)
legacy_from = save_legacy_from(localroot, root, file)
# remove the previous header
......@@ -179,6 +216,26 @@ for folder in cardDirs:
# define the header for each card
header = "---\n"
if len(order) > 0:
header += "order: " + str(order) + "\n"
# append the order of the card
# find the maximum of existing orders
if folderFlag:
if len(orderArr[indexS]) > 0:
maxOrder = max(orderArr[indexS])
else:
maxOrder = 0
# after determining the max order, set the folder flag to False to avoid another entry into the same block of code
folderFlag = False
tmp = orderArr[indexS].copy()
tmp.append(maxOrder + int(order))
orderArr[indexS] = tmp
else:
orderArr[indexS] = []
header += "layout: page\n"
header += "permalink: " + permalink + "\n"
header += "shortcut: " + root_handbook(shortcut) + "\n"
......@@ -235,8 +292,21 @@ for folder in cardDirs:
print(" + New header added.")
print("-----------------------")
# join all subcategories to the index
localIndexArr[indexS] = natsorted(localIndexArr[indexS])
# ordering of cards
for d in sections:
indexS = sections.index(d)
# join all subcategories to the index
# if all subcategories have a predefined order
if len(orderArr[indexS]) == len(localIndexArr[indexS])-1 and len(orderArr[indexS]) > 0:
print("")
X = localIndexArr[indexS][1:]
Y = orderArr[indexS]
localIndexArr[indexS] = [x for _, x in sorted(zip(Y, X))]
# natural sorting otherwise
else:
localIndexArr[indexS] = natsorted(localIndexArr[indexS])
print(localIndexArr)
......
*.PNG filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.jpg filter=lfs diff=lfs merge=lfs -text
*.jpeg filter=lfs diff=lfs merge=lfs -text
......
......@@ -89,6 +89,8 @@ build:pages:
- apt-get install -y -qq git-lfs
- gem install bundler:$BUNDLER_VERSION && bundle install
script:
# copy the index
- cp .tmp/cards.md .
# Generate the configuration for forks (will use Gitlab Pages on personal namespaces)
- |
if [ $CI_MERGE_REQUEST_ID ]; then
......
<script src="{{ '/assets/vendor/js/jquery-3.6.0.min.js' | relative_url }}"></script>
<script type="text/javascript" src="https://analytics.lcsb.uni.lu/lap/static/js/jquery.min.js"></script>
<script type="text/javascript" src="{{ "assets/js/router.js" | relative_url }}"></script>
<script type="text/javascript" src="{{ "assets/js/box_hider.js" | relative_url }}"></script>
<script>
......
This diff is collapsed.
......@@ -39,14 +39,12 @@ order: -1
<li><a href="{{ 'external/access/passwords' | relative_url }}">Managing your passwords</a></li>
<li><a href="{{ 'external/access/vpn-cerbere-access' | relative_url }}">VPN/CERBERE connection</a></li>
<li><a href="{{ 'external/access/wifiNetworkAccessGuests' | relative_url }}">WiFi network access for guests</a></li>
</ul>
</div>
<div class="index-box noborderbox" id="backup-card">
<h3>Backup</h3>
<ul>
<li><a href="{{ 'external/backup/computer' | relative_url }}">Staff Computer</a></li>
</ul>
</div>
<div class="index-box noborderbox" id="contribute-card">
......@@ -64,23 +62,21 @@ order: -1
<div class="index-box noborderbox" id="exchange-channels-card">
<h3>Exchange channels</h3>
<ul>
<li><a href="{{ 'external/exchange-channels/asperaweb' | relative_url }}">AsperaWEB Quick Guide</a></li>
<li><a href="{{ 'external/exchange-channels/calendar' | relative_url }}">Sharing calendar in Microsoft Exchange</a></li>
<li><a href="{{ 'external/exchange-channels/asperaweb' | relative_url }}">AsperaWEB Quick Guide</a></li>
<li><a href="{{ 'external/exchange-channels/owncloud' | relative_url }}">Owncloud</a></li>
</ul>
</div>
<div class="index-box noborderbox" id="general-card">
<h3>General</h3>
<ul>
<li><a href="{{ 'external/general/BelvalCampusMap' | relative_url }}">Belval Campus Map</a></li>
<li><a href="{{ 'external/general/attend-webex' | relative_url }}">Attend the LCSB Team Meeting online (webex)</a></li>
<li><a href="{{ 'external/general/usefulLinks' | relative_url }}">Useful links for living in Luxembourg</a></li>
<li><a href="{{ 'external/general/getToLCSB' | relative_url }}">How to get to the Luxembourg Centre for Systems Biomedicine</a></li>
<li><a href="{{ 'external/general/BelvalCampusMap' | relative_url }}">Belval Campus Map</a></li>
<li><a href="{{ 'external/general/glossary' | relative_url }}">Glossary</a></li>
<li><a href="{{ 'external/general/links' | relative_url }}">Important websites</a></li>
<li><a href="{{ 'external/general/remote-working' | relative_url }}">Work remotely</a></li>
<li><a href="{{ 'external/general/usefulLinks' | relative_url }}">Useful links for living in Luxemburg</a></li>
<li><a href="{{ 'external/general/attend-webex' | relative_url }}">Attend the LCSB Team Meeting online (webex)</a></li>
</ul>
</div>
<div class="index-box noborderbox" id="integrity-card">
......@@ -118,23 +114,21 @@ order: -1
<div class="index-box noborderbox" id="on-offboarding-card">
<h3>On offboarding</h3>
<ul>
<li><a href="{{ 'external/on-offboarding/checklistArrival' | relative_url }}">Checklist upon arrival in Luxemburg</a></li>
<li><a href="{{ 'external/on-offboarding/checklistBeforeArriving' | relative_url }}">Newcomer Checklist before Arriving in Luxembourg</a></li>
<li><a href="{{ 'external/on-offboarding/checklistGetStarted' | relative_url }}">Newcomer's checklist</a></li>
<li><a href="{{ 'external/on-offboarding/checklistArrival' | relative_url }}">Checklist upon arrival in Luxembourg</a></li>
<li><a href="{{ 'external/on-offboarding/checklistGodparent' | relative_url }}">Checklist for godparents</a></li>
<li><a href="{{ 'external/on-offboarding/godparent' | relative_url }}">Godparents for Newcomers</a></li>
<li><a href="{{ 'external/on-offboarding/checklistBeforeArriving' | relative_url }}">Newcomer Checklist before Arriving in Luxembourg</a></li>
<li><a href="{{ 'external/on-offboarding/onboarding' | relative_url }}">Onboarding new members at the LCSB</a></li>
<li><a href="{{ 'external/on-offboarding/godparent' | relative_url }}">Godparents for Newcomers</a></li>
</ul>
</div>
<div class="index-box noborderbox" id="publication-card">
<h3>Publication</h3>
<ul>
<li><a href="{{ 'external/publication/10WaysImproveEnglish' | relative_url }}">10 ways to improve your English</a></li>
<li><a href="{{ 'external/publication/add-gitignore' | relative_url }}">Add a .gitignore to your repository</a></li>
<li><a href="{{ 'external/publication/publish-repo' | relative_url }}">Publish a repository</a></li>
<li><a href="{{ 'external/publication/add-gitignore' | relative_url }}">Add a .gitignore to your repository</a></li>
<li><a href="{{ 'external/publication/publishInBiotools' | relative_url }}">Publishing a tool in *bio.tools*</a></li>
<li><a href="{{ 'external/publication/10WaysImproveEnglish' | relative_url }}">10 ways to improve your English</a></li>
</ul>
</div>
</div><br><center><a href="{{ '/' | relative_url }}">go back</a></center><br><center><a href="{{ '/cards' | relative_url }}">Overview of all HowTo cards</a></center>
\ No newline at end of file
---
order: 100
layout: page
permalink: /external/access/harrenhal-access/
shortcut: access:harrenhal-access
......
---
order: 200
layout: page
permalink: /external/access/lums-passwords/
shortcut: access:lums-passwords
......
---
order: 300
layout: page
permalink: /external/access/passwords/
shortcut: access:passwords
......
---
order: 400
layout: page
permalink: /external/access/vpn-cerbere-access/
shortcut: access:vpn-cerbere-access
......
---
order: 500
layout: page
permalink: /external/access/wifiNetworkAccessGuests/
shortcut: access:wifiNetworkAccessGuests
......
---
order: 100
layout: page
permalink: /external/backup/computer/
shortcut: backup:computer
......
---
order: 300
layout: page
permalink: /external/exchange-channels/asperaweb/
shortcut: exchange-channels:asperaweb
......
---
order: 200
layout: page
permalink: /external/exchange-channels/calendar/
shortcut: exchange-channels:calendar
......
---
order: 400
layout: page
permalink: /external/exchange-channels/owncloud/
shortcut: exchange-channels:owncloud
......
---
order: 300
layout: page
permalink: /external/general/BelvalCampusMap/
shortcut: general:BelvalCampusMap
......
---
order: 900
layout: page
permalink: /external/general/attend-webex/
shortcut: general:attend-webex
......@@ -21,4 +22,4 @@ You can then login with your university credentials. Once you logged in, a popup
![](img/image2.png)
**Note:** On Windows, you might not be asked for a password.
\ No newline at end of file
**Note:** On Windows, you might not be asked for a password.
---
order: 200
layout: page
permalink: /external/general/getToLCSB/
shortcut: general:getToLCSB
......
---
order: 500
layout: page
permalink: /external/general/glossary/
shortcut: general:glossary
......