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
Select Git revision
  • chat
  • kru0052-master-patch-91081
  • lifecycle
  • master
  • 20180621-before_revision
  • 20180621-revision
6 results

Target

Select target project
  • sccs/docs.it4i.cz
  • soj0018/docs.it4i.cz
  • lszustak/docs.it4i.cz
  • jarosjir/docs.it4i.cz
  • strakpe/docs.it4i.cz
  • beranekj/docs.it4i.cz
  • tab0039/docs.it4i.cz
  • davidciz/docs.it4i.cz
  • gui0013/docs.it4i.cz
  • mrazek/docs.it4i.cz
  • lriha/docs.it4i.cz
  • it4i-vhapla/docs.it4i.cz
  • hol0598/docs.it4i.cz
  • sccs/docs-it-4-i-cz-fumadocs
  • siw019/docs-it-4-i-cz-fumadocs
15 results
Select Git revision
  • 45-dokumentace-singularity
  • 59-john-s-froofreading
  • MPDATABenchmark
  • add_soft
  • fix-nodefiles
  • fix_bugs
  • fix_vnc_access_howto
  • hot-fix
  • hot_fix
  • job-features
  • master
  • patch-1
  • patch-2
  • readme
  • revert-1dceddf5
  • spell_check
  • test_jc
  • unittest
  • update_mkdocs
19 results
Show changes
Showing with 1027 additions and 0 deletions
{% extends "main.html" %}
{% block content %}
<h1>404 - Not found</h1>
{% endblock %}
site_name: IT4Innovations Documentation
docs_dir: docs.it4i
site_url: https://docs.it4i.cz/
extra_css:
- src/css.css?id=2018100501
- https://unpkg.com/mermaid@10.1.0/dist/mermaid.css
extra_javascript:
- https://unpkg.com/mermaid@10.1.0/dist/mermaid.min.js
# Repository
repo_name: sccs/docs.it4i.cz
repo_url: https://code.it4i.cz/sccs/docs.it4i.cz
edit_uri: -/edit/master/docs.it4i/
# Copyright
copyright: Copyright (c) 2013-__YEAR__ IT4Innovations__VERSION__
theme:
name: material
custom_dir: material
language: 'en'
# 404 page
static_templates:
- 404.html
features:
- search.highlight
- search.share
- content.action.edit
- navigation.tabs
- navigation.tabs.sticky
- navigation.instant
- navigation.path
- navigation.prune
- navigation.indexes
- navigation.top
icon:
logo: fontawesome/solid/book-open
repo: fontawesome/brands/gitlab
edit: material/pencil
# Don't include MkDocs' JavaScript
include_search_page: false
search_index_only: true
font:
text: 'Ubuntu'
#code: 'Ubuntu Mono' # Overwritten in css.css
palette:
primary: 'indigo'
accent: 'indigo'
palette:
# Palette toggle for light mode
- scheme: default
toggle:
icon: material/brightness-7
name: Switch to dark mode
# Palette toggle for dark mode
- scheme: slate
toggle:
icon: material/brightness-4
name: Switch to light mode
favicon: img/favicon.ico
nav:
- General:
- Introduction: index.md
- Get Access:
- Introduction: general/access/account-introduction.md
- Get Account:
- e-INFRA CZ Account: general/access/einfracz-account.md
- IT4I Account: general/obtaining-login-credentials/obtaining-login-credentials.md
- Get Project Membership: general/access/project-access.md
- Get Project: general/applying-for-resources.md
- Manage Your Profile:
- e-INFRA CZ Profile: general/management/einfracz-profile.md
- IT4I Profile: general/management/it4i-profile.md
- Access Services:
- Access the Clusters:
- SSH Access: general/shell-and-data-access.md
- SSH & Key Management: general/accessing-the-clusters/shell-access-and-data-transfer/ssh-key-management.md
- GUI:
- Open OnDemand: general/accessing-the-clusters/graphical-user-interface/ood.md
- VNC: general/accessing-the-clusters/graphical-user-interface/vnc.md
- X Window System: general/accessing-the-clusters/graphical-user-interface/x-window-system.md
- Xorg: general/accessing-the-clusters/graphical-user-interface/xorg.md
- Tmux: general/accessing-the-clusters/tmux.md
- Access the IS and Web Services: general/services-access.md
- VPN Access: general/accessing-the-clusters/vpn-access.md
- Run Jobs:
- Introduction: general/resource_allocation_and_job_execution.md
- Job Submission and Execution:
- General: general/job-submission-and-execution.md
- Karolina Specific: general/karolina-slurm.md
- Slurm Batch Examples: general/slurm-batch-examples.md
- Resources Allocation:
- Resource Allocation Policy: general/resources-allocation-policy.md
- Karolina Partitions: general/karolina-partitions.md
- Barbora Partitions: general/barbora-partitions.md
- Resource Accounting Policy: general/resource-accounting.md
- Job Priority: general/job-priority.md
# - Slurm Job Submission and Execution: general/slurm-job-submission-and-execution.md
- Capacity Computing:
- Introduction: general/capacity-computing.md
- Job Arrays: general/job-arrays.md
- HyperQueue: general/hyperqueue.md
# - Parallel Computing and MPI: general/karolina-mpi.md
- Tools:
- CodeIT4I: general/tools/codeit4i.md
- CI/CD: general/tools/cicd.md
- CLI Client Tools: general/tools/cli-client-tools.md
- Data Sharing Tools: general/tools/tools-list.md
- OpenCode: general/tools/opencode.md
- Technical Information:
- SSH Keys:
- OpenSSH Keys (UNIX): general/accessing-the-clusters/shell-access-and-data-transfer/ssh-keys.md
- PuTTY (Windows): general/accessing-the-clusters/shell-access-and-data-transfer/putty.md
- Certificates FAQ: general/obtaining-login-credentials/certificates-faq.md
- API Documentation: apiv2.md
- Satisfaction and Feedback: general/feedback.md
- Energy Saving: general/energy.md
- DICE: dice.md
- Support: general/support.md
- Acceptable Use Policy (AUP): general/aup.md
- Clusters:
- VLQ: vlq/introduction.md
- Karolina:
- Introduction: karolina/introduction.md
- Hardware Overview: karolina/hardware-overview.md
- Compute Nodes: karolina/compute-nodes.md
- Storage: karolina/storage.md
- Network: karolina/network.md
- Visualization Servers: karolina/visualization.md
- Barbora:
- Introduction: barbora/introduction.md
- Hardware Overview: barbora/hardware-overview.md
- Compute Nodes: barbora/compute-nodes.md
- Storage: barbora/storage.md
- Network: barbora/network.md
- Visualization Servers: barbora/visualization.md
- Barbora NG:
- Introduction: barbora-ng/introduction.md
- Hardware Overview: barbora-ng/hardware-overview.md
- NVIDIA DGX-2:
- Introduction: dgx2/introduction.md
- Accessing DGX-2: dgx2/accessing.md
- Resource Allocation and Job Execution: dgx2/job_execution.md
- Software deployment: dgx2/software.md
- Complementary Systems:
- Introduction: cs/introduction.md
- Accessing CS: cs/accessing.md
- Specification: cs/specifications.md
- Complementary System Job Scheduling: cs/job-scheduling.md
- Guides:
- AMD Partition: cs/guides/amd.md
- ARM Partition: cs/guides/arm.md
- Heterogeneous Memory Management on Intel Platforms: cs/guides/hm_management.md
- IBM Power10 Partition: cs/guides/power10.md
- NVIDIA Grace Partition: cs/guides/grace.md
- VMware Horizon: cs/guides/horizon.md
- Xilinx Accelerator Platform: cs/guides/xilinx.md
- Archive:
- Introduction: archive/archive-intro.md
- Anselm:
- Introduction: anselm/introduction.md
- Hardware Overview: anselm/hardware-overview.md
- Compute Nodes: anselm/compute-nodes.md
- Storage: anselm/storage.md
- Network: anselm/network.md
- Salomon:
- Introduction: salomon/introduction.md
- Hardware Overview: salomon/hardware-overview.md
- Compute Nodes: salomon/compute-nodes.md
- Network:
- InfiniBand Network: salomon/network.md
- IB Single-Plane Topology: salomon/ib-single-plane-topology.md
- 7D Enhanced Hypercube: salomon/7d-enhanced-hypercube.md
- Storage: salomon/storage.md
- Visualization Servers: salomon/visualization.md
- PRACE: prace.md
- Storage:
- PROJECT:
- Project storage: storage/project-storage.md
- Proj4 storage - S3: storage/proj4-storage.md
- CESNET:
- Storage: storage/cesnet-storage.md
- S3 Storage:
- Introduction: storage/cesnet-s3.md
- S3cmd: storage/s3cmd.md
- AWS CLI: storage/awscli.md
- ARCHIVE:
- Introduction: storage/archive-storage.md
- Access Control List:
- Standard File ACL: storage/standard-file-acl.md
- NFSv4 File ACL: storage/nfs4-file-acl.md
- Software:
- Environment and Modules: environment-and-modules.md
- Modules:
- New Software Installation Request: software/modules/new-software.md
- Lmod Environment: software/modules/lmod.md
- Modules Matrix: modules-matrix.md
- Job Features: job-features.md
- Available Karolina Modules: modules-karolina.md
- Available Barbora Modules: modules-barbora.md
- Available DGX-2 Modules: modules-dgx.md
- Available CS AVX2 Modules: modules-cs-avx2.md
- Available CS AVX512 Modules: modules-cs-avx512.md
- Available CS AARCH64 Modules: modules-cs-aarch64.md
- Available CS PPC64LT Modules: modules-cs-ppc64lt.md
- Available CS EL9 AARCH64 Modules: modules-cs-el9-aarch64.md
- ISV Licenses: software/isv_licenses.md
- CAE:
- COMSOL:
- COMSOL: software/cae/comsol/comsol-multiphysics.md
- Licensing and Available Versions: software/cae/comsol/licensing-and-available-versions.md
- Chemistry:
- VASP: software/chemistry/vasp.md
- Gaussian: software/chemistry/gaussian.md
- Molpro: software/chemistry/molpro.md
- NWChem: software/chemistry/nwchem.md
- Orca: software/chemistry/orca.md
- Phono3py: software/chemistry/phono3py.md
- Phonopy: software/chemistry/phonopy.md
- Compilers:
- Overview: software/compilers.md
- Karolina Compilation: software/karolina-compilation.md
- Data Science:
- Dask: software/data-science/dask.md
- Debuggers:
- Introduction: software/debuggers/introduction.md
- Allinea Forge (DDT,MAP): software/debuggers/allinea-ddt.md
- Allinea Performance Reports: software/debuggers/allinea-performance-reports.md
- CUBE: software/debuggers/cube.md
- Intel VTune Amplifier XE: software/debuggers/intel-vtune-amplifier.md
- Intel VTune Profiler: software/debuggers/intel-vtune-profiler.md
- PAPI: software/debuggers/papi.md
- Scalasca: software/debuggers/scalasca.md
- Score-P: software/debuggers/score-p.md
- Total View: software/debuggers/total-view.md
- Valgrind: software/debuggers/valgrind.md
- Vampir: software/debuggers/vampir.md
- EESSI: software/eessi.md
- GPU:
- NVIDIA CUDA: software/nvidia-cuda.md
- NVIDIA CUDA Quantum: software/nvidia-cuda-q.md
- ROCm HIP: software/nvidia-hip.md
- Intel Suite:
- Introduction: software/intel/intel-suite/intel-parallel-studio-introduction.md
- Intel Advisor: software/intel/intel-suite/intel-advisor.md
- Intel Compilers: software/intel/intel-suite/intel-compilers.md
- Intel IPP: software/intel/intel-suite/intel-integrated-performance-primitives.md
- Intel Inspector: software/intel/intel-suite/intel-inspector.md
- Intel MKL: software/intel/intel-suite/intel-mkl.md
- Intel TBB: software/intel/intel-suite/intel-tbb.md
- Intel Trace Analyzer and Collector: software/intel/intel-suite/intel-trace-analyzer-and-collector.md
- Machine Learning:
- Introduction: software/machine-learning/introduction.md
- NetKet: software/machine-learning/netket.md
- TensorFlow: software/machine-learning/tensorflow.md
- Deep Learning:
- AlphaFold: software/machine-learning/alphafold.md
- DeepDock: software/machine-learning/deepdock.md
- LLM:
- vLLM with Deepseek: software/vllm_deepseek.md
- MPI:
- Introduction: software/mpi/mpi.md
- OpenMPI Examples: software/mpi/ompi-examples.md
- MPI4Py (MPI for Python): software/mpi/mpi4py-mpi-for-python.md
- Jupyter-lab MPI: software/mpi/jupyter_mpi.md
- Numerical Languages:
- Introduction: software/numerical-languages/introduction.md
- Clp: salomon/software/numerical-libraries/Clp.md
- R: software/numerical-languages/r.md
- Matlab: software/numerical-languages/matlab.md
- Octave: software/numerical-languages/octave.md
- OpenCoarrays: software/numerical-languages/opencoarrays.md
- Numerical Libraries:
- FFTW: software/numerical-libraries/fftw.md
- GSL: software/numerical-libraries/gsl.md
- HDF5: software/numerical-libraries/hdf5.md
- Intel Numerical Libraries: software/numerical-libraries/intel-numerical-libraries.md
- PETSc: software/numerical-libraries/petsc.md
- NVIDIA HPC SDK:
- Overview: software/sdk/nvhpc.md
- OpenAAC MPI Tutorial: software/sdk/openacc-mpi.md
- Languages:
- Java: software/lang/java.md
- C#: software/lang/csc.md
- Python: software/lang/python.md
- Python-Conda: software/lang/conda.md
- JuliaLang: software/lang/julialang.md
- Tools:
- Apptainer: software/tools/apptainer.md
- ANSYS:
- Introduction: software/tools/ansys/ansys.md
- ANSYS CFX: software/tools/ansys/ansys-cfx.md
- ANSYS Fluent: software/tools/ansys/ansys-fluent.md
- ANSYS LS-DYNA: software/tools/ansys/ansys-ls-dyna.md
- ANSYS MAPDL: software/tools/ansys/ansys-mechanical-apdl.md
- Workbench: software/tools/ansys/workbench.md
- Setting License Preferences: software/tools/ansys/licensing.md
- Licensing and Available Versions: software/tools/ansys/setting-license-preferences.md
- EasyBuild:
- Introduction: software/tools/easybuild.md
- Generating Container Recipes and Images: software/tools/easybuild-images.md
- Spack: software/tools/spack.md
- Virtualization: software/tools/virtualization.md
- Visualization:
- In situ: software/viz/insitu.md
- NICE DCV: software/viz/NICEDCVsoftware.md
- OpenFOAM: software/viz/openfoam.md
- OVITO: software/viz/ovito.md
- ParaView: software/viz/paraview.md
- QtiPlot: software/viz/qtiplot.md
- VirtualGL: software/viz/vgl.md
- VESTA: software/viz/vesta.md
- LUMI:
- About LUMI: lumi/about.md
- LUMI AI: lumi/lumiai.md
- LUMI Software:
- General: lumi/software.md
- OpenFoam: lumi/openfoam.md
- PyTorch: lumi/pytorch.md
- LUMI Support: lumi/support.md
- Clouds:
- e-INFRA CZ Cloud: cloud/einfracz-cloud.md
- IT4I Cloud:
- About IT4I Cloud: cloud/it4i-cloud.md
- IT4I Cloud Quotas: cloud/it4i-quotas.md
extra:
disqus: 'test-3whnesz3gq'
social:
- icon: 'fontawesome/brands/gitlab'
link: 'https://code.it4i.cz/sccs/docs.it4i.cz'
- icon: 'fontawesome/solid/globe'
link: 'https://www.it4i.cz'
plugins:
- search:
separator: '[\s\-,:!=\[\]()"/]+|(?!\b)(?=[A-Z][a-z])|\.(?!\d)|&[lg]t;'
lang:
- en
- exclude-search:
exclude:
- anselm/*.md
- archive/*.md
- prace.md
- salomon/*.md
- general/pbs-job-submission-and-execution.md
- general/job-arrays.md
- general/karolina-mpi.md
- software/viz/gpi2.md
- modules-karolina.md
- modules-barbora.md
- modules-dgx.md
- modules-cs-avx2.md
- modules-cs-avx512.md
- modules-cs-aarch64.md
- modules-cs-ppc64lt.md
- modules-cs-el9-aarch64.md
- software/bio/omics-master/*.md
- mkdocs-pdf
# - optimize
markdown_extensions:
- codehilite
- markdown.extensions.admonition:
- pymdownx.arithmatex:
- markdown.extensions.toc:
permalink: true
slugify: !!python/name:pymdownx.slugs.uslugify
- pymdownx.snippets:
base_path: snippets
- pymdownx.tabbed:
- footnotes
- pymdownx.superfences
- attr_list
{
"scripts": {
"lint-md": "remark ."
},
"remarkConfig": {
"presets": ["lint-recommended"]
}
}
#!/bin/bash
#the script controls links, only inside the whole directory, doesnt control outside pages
for file in $@; do
check=$(cat "$file" | grep -Po "\[.*?\]\([^ ]*?\)" | grep -v "#" | grep -vE "http|@|www|ftp|none" | sed 's/\[.*\]//g' | sed 's/[()]//g' | sed 's/\/$/.md/g')
if [ ! -z "$check" ]; then
wrong=0
for line in $check; do
pathtocheck=$(dirname "$file")/$line
if [ -f $(dirname "$file")/"$line" ]; then
:
#echo "ok $pathtocheck"
else
if [ $wrong -eq "0" ]; then
echo ""
echo "\n+++++ $file +++++\n"
fi
wrong=1
echo "wrong link in $pathtocheck"
fi
done
fi
done
echo ""
backports-abc==0.5
click==7.1.2
EditorConfig==0.12.2
future==0.18.2
futures==3.1.1
importlib-metadata==6.6.0
Jinja2==3.1.2
joblib==0.17.0
jsbeautifier==1.13.0
livereload==2.6.3
lunr==0.5.8
Markdown==3.4.3
MarkupSafe==2.0.1
mkdocs==1.4.3
mkdocs-exclude-search==0.6.5
mkdocs-git-committers-plugin-2==1.1.2
mkdocs-git-revision-date-localized-plugin==1.2.0
mkdocs-material==9.1.12
mkdocs-material-extensions==1.1.1
mkdocs-pdf==0.1.2
nltk==3.5
packaging==20.4
Pygments==2.7.1
pymdown-extensions==8.0.1
pyparsing==2.4.7
PyYAML==5.4.1
regex==2023.5.5
singledispatch==3.4.0.3
six==1.16.0
titlecase==1.1.1
tornado==6.0.4
tqdm==4.50.0
#!/bin/bash
VER=$(git log --pretty=format:'/ ver. %h / %ai' -n 1)
sed "s,__VERSION__, $VER," mkdocs.yml -i
YEAR=$(date +"%Y")
sed "s,__YEAR__, $YEAR," mkdocs.yml -i
require 'faraday'
require 'json'
#print ARGV[0].downcase
puts "Checking the ver for #{ARGV[0]}"
response = Faraday.get "https://release-monitoring.org/api/projects/?pattern=#{ARGV[0].downcase}"
fedora_j = JSON.parse( response.body )['projects']
fedora = fedora_j.select { |h| h['name'] == ARGV[0].downcase }.first['version']
response = Faraday.get "https://docs.it4i.cz/modules-matrix.json"
it4i = JSON.parse( response.body )['projects'][ARGV[0]]
it4i_short = it4i.split('-')[0]
puts "IT4Innovations: #{it4i_short} (#{it4i})"
puts "Upstream : #{fedora}"
if it4i_short.eql? fedora
puts "Identical"
else
end
#!/bin/bash
sed 's/\\u00a0/ /g' -i "$@"
sed 's,\\n\\n, ,g' -i "$@"
sed 's,\\n , ,g' -i "$@"
sed 's, \\n, ,g' -i "$@"
sed -e 's/^[ \t]*//' -i "$@"
#!/bin/bash
for i in {"red","pink","purple","deep purple","indigo","blue","light blue","cyan","teal","green","light green","lime","yellow","amber","orange","deep orange","brown","grey","blue grey"}
do
echo "Setting color to: $i, ${i/ /_}, color_${i/ /_}"
git checkout color_${i/ /_}
git pull --rebase origin colors
git pull --rebase
sed -ri "s/(primary: ').*'/\1$i'/" mkdocs.yml
git commit -am "Setting color to: $i"
git push --set-upstream origin color_${i/ /_}
git checkout colors
done
#!/usr/bin/python
# -*- coding: utf-8 -*-
""" combinations """
from __future__ import print_function
import itertools
import re
CHARS = ['K', 'B', 'D']
MASK = ''.join(reversed(CHARS))
for i in range(1, len(CHARS)+1):
for comb in itertools.combinations(CHARS, i):
REG = "[^%s]" % ''.join(comb)
print(re.sub(REG, "-", MASK))
#!/bin/bash
curl -s https://code.it4i.cz/sccs/it4i-modules/raw/master/dgx.csv -o dgx.csv
curl -s https://code.it4i.cz/sccs/it4i-modules/raw/master/barbora.csv -o barbora.csv
curl -s https://code.it4i.cz/sccs/it4i-modules/raw/master/karolina.csv -o karolina.csv
#!/bin/bash
curl -s https://code.it4i.cz/sccs/it4i-modules/raw/master/barbora.md -o docs.it4i/modules-barbora.md
curl -s https://code.it4i.cz/sccs/it4i-modules/raw/master/dgx.md -o docs.it4i/modules-dgx.md
curl -s https://code.it4i.cz/sccs/it4i-modules/raw/master/karolina.md -o docs.it4i/modules-karolina.md
curl -s https://code.it4i.cz/sccs/it4i-modules/raw/master/cs_aarch64.md -o docs.it4i/modules-cs-aarch64.md
curl -s https://code.it4i.cz/sccs/it4i-modules/raw/master/cs_all_avx2.md -o docs.it4i/modules-cs-avx2.md
curl -s https://code.it4i.cz/sccs/it4i-modules/raw/master/cs_avx512.md -o docs.it4i/modules-cs-avx512.md
curl -s https://code.it4i.cz/sccs/it4i-modules/raw/master/cs_ppc64le.md -o docs.it4i/modules-cs-ppc64lt.md
curl -s https://code.it4i.cz/sccs/it4i-modules/raw/master/cs_el9_aarch64.md -o docs.it4i/modules-cs-el9-aarch64.md
curl -s https://code.it4i.cz/sccs/it4i-modules/raw/master/dgx.csv -o scripts/dgx.csv
curl -s https://code.it4i.cz/sccs/it4i-modules/raw/master/barbora.csv -o scripts/barbora.csv
curl -s https://code.it4i.cz/sccs/it4i-modules/raw/master/karolina.csv -o scripts/karolina.csv
#!/usr/bin/python3
"""
Script to process Markdown files, convert them to MDX,
and add frontmatter based on the first H1 heading.
"""
import os
import re
from pathlib import Path
def process_md_file(md_path):
"""
Converts a Markdown file (.md) to MDX format (.mdx),
adds frontmatter with title from H1 heading, and removes the original file.
Args:
md_path (Path): Path to the Markdown file.
"""
try:
with open(md_path, 'r', encoding='utf-8') as file_handle:
content = file_handle.read()
except UnicodeDecodeError:
print(f"Skipping {md_path} - unable to decode as UTF-8")
return
# Remove existing hide-toc frontmatter
hide_toc_pattern = re.compile(
r'^---\s*\n\s*hide:\s*\n\s*-\s+toc\s*\n---\s*\n*',
flags=re.MULTILINE
)
content = hide_toc_pattern.sub('', content, count=1)
# Remove leading empty lines
content = re.sub(r'^\n+', '', content)
# Process H1 heading
h1_pattern = re.compile(r'^\s*#\s+(.*)$', re.MULTILINE)
match = h1_pattern.search(content)
if match:
title = match.group(1).strip()
frontmatter = f'---\ntitle: "{title}"\n---\n'
# Construct new content with frontmatter at beginning
before_h1 = content[:match.start()].lstrip('\n')
after_h1 = content[match.end():].lstrip('\n')
new_content = frontmatter + before_h1 + after_h1
else:
print(f"No H1 heading found in {md_path}, creating basic frontmatter")
frontmatter = '---\ntitle: ""\n---\n\n'
new_content = frontmatter + content.lstrip('\n')
# Ensure no empty lines after frontmatter
lines = new_content.split('\n')
if len(lines) >= 3 and lines[0] == '---' and lines[2] == '---':
remaining = lines[3:]
while remaining and not remaining[0].strip():
remaining.pop(0)
new_content = '\n'.join(lines[:3] + remaining)
# Create and write MDX file
mdx_path = md_path.with_suffix('.mdx')
with open(mdx_path, 'w', encoding='utf-8') as file_handle:
file_handle.write(new_content)
# Remove original MD file
md_path.unlink()
print(f"Converted {md_path} to {mdx_path}")
def main():
"""Walks through directories and processes all Markdown files."""
for root, dirs, files in os.walk('.'):
dirs[:] = [d for d in dirs if not d.startswith('.')]
for file in files:
if file.endswith('.md'):
md_path = Path(root) / file
process_md_file(md_path)
if __name__ == '__main__':
main()
#!/usr/bin/python
# -*- coding: utf-8 -*-
""" matrix """
from __future__ import print_function
import itertools
CHARS = ['K', 'B', 'D']
MASK = ''.join(reversed(CHARS))
for bits in itertools.product([0, 1], repeat=len(CHARS)):
SBIT = "".join(str(bit) for bit in bits)
NST = ""
for i, _ in enumerate(SBIT):
if SBIT[i] == "1":
NST += MASK[i]
else:
NST += "-"
print(NST)
#!/bin/bash
find content/docs -type d -exec bash -c '
cd "{}" || exit
DIR=$(basename "$PWD")
TITLE=$(echo "$DIR" | sed -E "s/^(.)/\U\1/")
PAGES=$( (ls *.mdx 2>/dev/null | sed "s/\.mdx$//"; ls -d */ 2>/dev/null | sed "s#/##") | sort | jq -R . | jq -s . )
jq -n --arg title "$TITLE" --argjson pages "$PAGES" "{title: \$title, pages: \$pages}" > meta.json
' \;
exit 0
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
""" modules_matrix """
import argparse
import csv
import itertools
import json
import os.path
def arg_parse():
"""
Argument parser
"""
parser = argparse.ArgumentParser(
description="Module_matrix"
)
parser.add_argument('--json',
action='store_true',
help="get json")
return parser.parse_args()
def get_data(filename):
"""Function to read the data from the input CSV file to use in the analysis"""
reader = [] # Just in case the file open fails
with open(filename, 'r') as fdata:
reader = csv.reader(fdata, delimiter=',')
return list(reader) # Only return the reader when you have finished.
def get_datalist():
"""Get data list"""
datalist = []
for name in ['karolina', 'dgx', 'barbora']:
path = os.path.join('scripts', f"{name}.csv")
datalist += get_data(path)
return datalist
def get_counts(datalist):
"""Get counts"""
counts = {}
for i in datalist:
counts[i[0]] = counts.get(i[0], 0) + int(i[1])
return counts
def get_matrix():
"""Get matrix"""
chars = ['K', 'B', 'D']
arr = []
mask = ''.join(reversed(chars))
for bits in itertools.product([0, 1], repeat=len(chars)):
sbit = "".join(str(bit) for bit in bits)
nst = ""
for i, _ in enumerate(sbit):
if sbit[i] == "1":
nst += mask[i]
else:
nst += "-"
arr.append(nst)
return arr
def get_software(datalist):
"""Get software"""
matrix = get_matrix()
counts = get_counts(datalist)
software = {}
prev = ''
for mat, i in sorted(counts.items()):
split = mat.split('/')
if len(split) > 1:
if split[0] != prev:
software[split[0]] = {}
software[split[0]][split[1]] = '`' + matrix[i] + '`'
prev = split[0]
return software
def packages_json(software):
"""Packages JSON"""
packages = {}
for module in sorted(software.items(), key=lambda i: i[0].lower()):
packages[module[0]] = sorted(module[1])[-1]
data = {'total': len(packages), 'projects': packages}
return data
def print_software(software):
"""Print software"""
for module in sorted(software.items(), key=lambda i: i[0].lower()):
software_name = module[0]
versions = []
clusters = []
for key in sorted(module[1].keys()):
versions.append(key)
clusters.append(module[1][key])
print(f"| {software_name} | {'<br>'.join(versions)} | {'<br>'.join(clusters)} |")
print()
print('---8<--- "modules_matrix_search.md"')
def print_hint():
"""Print hint"""
print('!!! Hint "Cluster Acronyms"')
print(' ```')
print(' D B K')
print(' | | |')
print(' | | +----> Karolina')
print(' | +------> Barbora')
print(' +--------> DGX')
print(' ```')
print()
print("| Module <br><form><input id=\"searchInput\" placeholder=\"🔍 Filter\""
" style=\"width: 8rem; border-radius: 0.2rem; color: black;"
" padding-left: .2rem;\"></form> | Versions | Clusters |")
print("| ------ | -------- | -------- |")
def print_changelog():
"""Print changelog"""
print('**Modules Changelog**<br>')
print('You can see the modules changelog for each supercomputer here:<br>')
print('[DGX modules changelog][1]<br>')
print('[Barbora modules changelog][2]<br>')
print('[Karolina modules changelog][3]<br>')
def print_links():
"""Print links"""
print('[1]: https://code.it4i.cz/sccs/it4i-modules/-/blob/master/dgx-changelog.md')
print('[2]: https://code.it4i.cz/sccs/it4i-modules/-/blob/master/barbora-changelog.md')
print('[3]: https://code.it4i.cz/sccs/it4i-modules/-/blob/master/karolina-changelog.md')
def main():
"""Main function"""
arg = arg_parse()
datalist = get_datalist()
software = get_software(datalist)
if arg.json:
print(json.dumps(packages_json(software)))
else:
print_changelog()
print_hint()
print_software(software)
print_links()
if __name__ == "__main__":
main()
#!/bin/bash
find . -type f -not -name '*.md' -print0 | while IFS= read -r -d '' file; do
# Strip leading ./ from the file path
relative_path="${file#./}"
# Create target directory path
target_dir="../public/it4i/$(dirname "$relative_path")"
# Create directory structure if it doesn't exist
mkdir -p "$target_dir"
# Move the file
mv "$file" "$target_dir"
done
#!/bin/bash
for i in $(find ../public/it4i -type f -printf "%P\n" | grep -v .gitkeep) ; do
short=$(echo $i | sed -e 's/.*\/\([^\/]*\)\/\([^\/]*\)$/\1\/\2/');
for f in $(grep -rl "$short)"); do
sh=$(echo $short | sed -e 's/\//\\\//g')
ie=$(echo $i | sed -e 's/\//\\\//g')
sed -i "s/(.*$sh)/(\/it4i\/$ie)/" $f
done
done
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# pylint: disable=C0301, R1710
""" titlemd """
import argparse
import sys
try:
from titlecase import titlecase
except ImportError:
print("Please install titlecase")
def arg_parse():
"""
Argument parser
"""
parser = argparse.ArgumentParser(
description="Titlemd"
)
parser.add_argument('-t', '--test',
action='store_true',
help="test")
parser.add_argument('location',
nargs='?',
default='.',
help="location, default current directory")
return parser.parse_args()
def mkdocs_available(location):
""" Is mkdocs.yml available? """
return "mkdocs.yml" in location
def linestart(line, disabled, test, prev_line=None):
""" linestart """
if test:
if (line.startswith("``") or line.startswith("extra:")) and not disabled:
return True
if (line.startswith("``") or (prev_line and prev_line.startswith("pages:"))) and disabled:
return False
else:
if line.startswith("``") and not disabled:
return True
if line.startswith("``") and disabled:
return False
return disabled
def testdata(arg):
""" test """
# Spelling exceptions
with open('.spelling', encoding='utf-8') as fdata:
spelling = fdata.readlines()
def abbreviations(word, **_):
""" abbreviations """
if word + "\n" in spelling:
return word
# Open the file and read the lines as a list
with open(arg.location, encoding='utf-8') as fdata:
lines = fdata.readlines()
# Loop through the list of lines and titlecase
# any line beginning with '#'.
return_value = 0
prev_line = lines[0] if lines else ""
echo_filename = False
disabled = mkdocs_available(arg.location)
for line in lines:
disabled = linestart(line, disabled, arg.test, prev_line)
if line.startswith('#') and not disabled and not mkdocs_available(arg.location):
title_line = titlecase(line[:line.find("]")], callback=abbreviations) + line[line.find("]"):]
if line != title_line:
if return_value == 0 and not echo_filename:
print(f"{arg.location}")
echo_filename = True
print(f"-{line}", end="")
print(f"+{title_line}", end="")
print()
return_value = 1
if (line.startswith('---') or line.startswith('===')) and not disabled:
title_prev_line = titlecase(prev_line[:prev_line.find("]")], callback=abbreviations) + prev_line[prev_line.find("]"):]
if prev_line != title_prev_line:
if return_value == 0 and not echo_filename:
print(f"{arg.location}")
echo_filename = True
print(f"-{prev_line}", end="")
print(f"+{title_prev_line}", end="")
print()
return_value = 1
if (mkdocs_available(arg.location) and not line.startswith('#') and not disabled):
title_line = titlecase(line[:line.find(":")], callback=abbreviations) + line[line.find(":"):]
if line != title_line:
if return_value == 0 and not echo_filename:
print(f"{arg.location}")
echo_filename = True
print(f"-{line}", end="")
print(f"+{title_line}", end="")
print()
return_value = 1
prev_line = line
return return_value
def writedata(arg):
""" writedata """
# Spelling exceptions
with open('.spelling', encoding='utf-8') as fdata:
spelling = fdata.readlines()
def abbreviations(word, **_):
""" abbreviations """
if word + "\n" in spelling:
return word
# Open the file and read the lines as a list
with open(arg.location, encoding='utf-8') as fdata:
lines = fdata.readlines()
with open(arg.location, 'w', encoding='utf-8') as fdata:
prev_line = lines[0] if lines else ""
disabled = False
for line in lines:
disabled = linestart(line, disabled, arg.test)
if line.startswith('#') and not disabled:
line = titlecase(line[:line.find("]")], callback=abbreviations) + line[line.find("]"):]
if (line.startswith('---') or line.startswith('===')) and not disabled:
prev_line = titlecase(prev_line[:prev_line.find("]")], callback=abbreviations) + prev_line[prev_line.find("]"):]
fdata.write(prev_line)
prev_line = line
fdata.write(prev_line)
def main():
"""
main function
"""
arg = arg_parse()
if arg.test:
sys.exit(testdata(arg))
else:
writedata(arg)
if __name__ == "__main__":
main()
#!/usr/bin/python3
"""
Script to check internal links and section references in MDX files.
"""
import re
from pathlib import Path
def extract_links(content):
"""
Extract all internal links from the file.
:param content: The content of the MDX file.
:return: A list of internal links.
"""
link_pattern = re.compile(r'\[.*?\]\((?!http)(.*?)\)') # Everything except http/https
return link_pattern.findall(content)
def extract_headers(content):
"""
Extract all H1-H6 headers for hash reference checks.
:param content: The content of the MDX file.
:return: A set of headers formatted as hash links.
"""
header_pattern = re.compile(r'^(#+)\s*(.*)', re.MULTILINE)
return {f"#{match[1].lower().replace(' ', '-')}" for match in header_pattern.findall(content)}
def check_internal_links(directory):
"""
Check the existence of files and hash sections for internal links.
:param directory: The directory containing MDX files.
"""
mdx_files = {f.relative_to(directory): f for f in Path(directory).rglob("*.mdx")}
file_headers = {}
# Extract headers from each file
for mdx_file, path in mdx_files.items():
with open(path, "r", encoding="utf-8") as file:
content = file.read()
file_headers[mdx_file] = extract_headers(content)
# Check internal links
for mdx_file, path in mdx_files.items():
with open(path, "r", encoding="utf-8") as file:
content = file.read()
links = extract_links(content)
for link in links:
parts = link.split("#")
file_part = parts[0] if parts[0] else mdx_file
hash_part = f"#{parts[1]}" if len(parts) > 1 else None
file_target = (Path(mdx_file).parent / file_part).resolve()
# Check if the file exists
if file_part and file_target not in mdx_files.values():
print(f"❌ Broken file link in {mdx_file}: {link}")
# Check if the section exists
elif hash_part and hash_part not in file_headers.get(file_part, set()):
print(f"⚠️ Broken section link in {mdx_file}: {link}")
if __name__ == "__main__":
check_internal_links("content/docs")