config.py (2449B)
1 import os 2 3 FILES_LIST = "list.txt" 4 BSC_ROOT = "." 5 DOCS_OUTPUT = "docs" 6 7 ALGO_FOLDER_NAME = "algorithms" # folder name that contains algorithm .md files 8 9 # Directories excluded from index generation 10 IGNORED_FOLDERS = {"stylesheets", "overrides", "assets", ".vitepress", "node_modules", "public"} 11 12 # Language config mapped by file extension 13 SUPPORTED_LANGS = { 14 '.c': {'label': 'C', 'fence': 'c', 'style': 'c'}, 15 '.cpp': {'label': 'C++', 'fence': 'cpp', 'style': 'c'}, 16 '.h': {'label': 'C Header', 'fence': 'c', 'style': 'c'}, 17 '.hpp': {'label': 'C++ Header', 'fence': 'cpp', 'style': 'c'}, 18 '.r': {'label': 'R', 'fence': 'r', 'style': 'hash'}, 19 '.py': {'label': 'Python', 'fence': 'python', 'style': 'hash'}, 20 '.java': {'label': 'Java', 'fence': 'java', 'style': 'c'}, 21 '.js': {'label': 'JavaScript', 'fence': 'javascript', 'style': 'c'}, 22 '.ts': {'label': 'TypeScript', 'fence': 'typescript', 'style': 'c'}, 23 '.sh': {'label': 'Bash', 'fence': 'bash', 'style': 'hash'}, 24 } 25 26 ALGO_ICON_SVG = '<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="display:inline; margin-bottom:-2px; margin-right:6px;" class="lucide lucide-binary"><rect x="14" y="14" width="4" height="6" rx="2"/><rect x="6" y="4" width="4" height="6" rx="2"/><path d="M6 20h4"/><path d="M14 10h4"/><path d="M6 14h2v6"/><path d="M14 4h2v6"/></svg>' 27 28 FILE_ICON_SVG = '<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="display:inline; margin-bottom:-2px; margin-right:6px;"><path d="M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z"/><path d="M14 2v5a1 1 0 0 0 1 1h5"/><path d="M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1"/><path d="M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1"/></svg>' 29 30 # Protected paths that should never be overwritten 31 PROTECTED_INDEX_FILES = { 32 os.path.normpath(os.path.join(DOCS_OUTPUT, f"semester_{i}", "index.md")) 33 for i in range(1, 9) 34 } 35 PROTECTED_INDEX_FILES.add(os.path.normpath(os.path.join(DOCS_OUTPUT, "index.md")))