|
17 | 17 | REPO_DIR = "arm-learning-paths" |
18 | 18 | OUTPUT_MD = "huggingface_learning_paths.md" |
19 | 19 |
|
20 | | -LearningPath = namedtuple('LearningPath', ['title', 'category', 'path']) |
| 20 | +LearningPath = namedtuple('LearningPath', ['title', 'category', 'path', 'csps']) |
21 | 21 |
|
22 | 22 | def extract_front_matter(file_path): |
23 | 23 | """Extract YAML front matter from a markdown file.""" |
@@ -64,19 +64,28 @@ def find_huggingface_learning_paths(repo_dir): |
64 | 64 | print(f"DEBUG: {category}/{lp} parsed tags: {tags}") |
65 | 65 | if any(tag.lower() == "hugging face" for tag in tags): |
66 | 66 | title = fm.get('title', lp) |
67 | | - print(f"FOUND: {title} in {category}") |
68 | | - results.append(LearningPath(title=title, category=category, path=f"{category}/{lp}")) |
| 67 | + # Extract cloud service provider tags |
| 68 | + csp_raw = fm.get('cloud_service_providers', []) |
| 69 | + if isinstance(csp_raw, str): |
| 70 | + csps = [c.strip() for c in csp_raw.split(',')] |
| 71 | + elif isinstance(csp_raw, list): |
| 72 | + csps = [str(c).strip() for c in csp_raw] |
| 73 | + else: |
| 74 | + csps = [] |
| 75 | + print(f"FOUND: {title} in {category} CSPs: {csps}") |
| 76 | + results.append(LearningPath(title=title, category=category, path=f"{category}/{lp}", csps=csps)) |
69 | 77 | return results |
70 | 78 |
|
71 | 79 | def write_markdown_table(learning_paths, output_file): |
72 | 80 | with open(output_file, 'w') as f: |
73 | 81 | f.write("# Hugging Face Learning Paths\n\n") |
74 | 82 | f.write(f"Total Hugging Face Learning Paths: {len(learning_paths)}\n\n") |
75 | | - f.write("| Title | Category |\n") |
76 | | - f.write("|-------|----------|\n") |
| 83 | + f.write("| Title | Category | CSP |\n") |
| 84 | + f.write("|-------|----------|-----|\n") |
77 | 85 | for lp in learning_paths: |
78 | 86 | url = f"https://learn.arm.com/learning-paths/{lp.path}" |
79 | | - f.write(f"| [{lp.title}]({url}) | {lp.category} |\n") |
| 87 | + csp_str = ", ".join(lp.csps) if lp.csps else "" |
| 88 | + f.write(f"| [{lp.title}]({url}) | {lp.category} | {csp_str} |\n") |
80 | 89 | print(f"Markdown report written to {output_file}") |
81 | 90 |
|
82 | 91 | def main(): |
|
0 commit comments