Skip to content

Commit

Permalink
Update generate_markdown_list.py
Browse files Browse the repository at this point in the history
  • Loading branch information
diegovelezg authored Feb 3, 2025
1 parent 782c729 commit 6d1144b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions generate_markdown_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def get_track_from_course(course_readme_path):
def get_levels(file_path, root_dir):
parts = os.path.relpath(file_path, root_dir).split(os.sep)
if parts[0].upper() == "COURSES":
# En courses: parts[1] = identificador del curso, parts[2] = módulo (si existe)
# En COURSES: parts[1] = identificador del curso, parts[2] = módulo (si existe)
return (None, parts[1], parts[2] if len(parts) >= 3 else None)
else:
return (parts[0], parts[1] if len(parts) > 1 else None, parts[2] if len(parts) > 2 else None)
Expand All @@ -53,12 +53,12 @@ def get_file_type(file_path, subdir, file):
normalized_path = os.path.normpath(file_path).upper()
if "COURSES" in normalized_path:
parts = os.path.relpath(file_path, root_dir).split(os.sep)
# Si el archivo está en la raíz del curso (e.g. COURSES/ZENDESK_01/README_ES.md)
# Si el archivo está en la raíz del curso (ej. COURSES/ZENDESK/README_ES.md)
if len(parts) == 2 and file.startswith("README"):
return "course"
# Si el archivo es el README de un módulo (e.g. COURSES/ZENDESK_01/01_intro/README_ES.md)
# Si el archivo es el README de un módulo (ej. COURSES/ZENDESK/01_zendesk_01/README_ES.md)
if len(parts) >= 3 and file.startswith("README"):
return "module"
return "skill" # <-- Se cambia de "module" a "skill"
# Si el archivo está en una subcarpeta "activities" o "activity" y no es README, es activity
if ("activities" in subdir.lower() or "activity" in subdir.lower()) and not file.startswith("README"):
return "activity"
Expand Down Expand Up @@ -101,7 +101,7 @@ def generate_markdown_list(root_dir):
course_readme = os.path.join(root_dir, "COURSES", course_id, "README_ES.md")
track = get_track_from_course(course_readme)
skill = course_id # El identificador del curso se usa como "skill"
module = module_id # El nombre del módulo
module = module_id # El nombre del módulo (puede ser None si es el README del curso)
else:
track, skill, module = get_levels(file_path, root_dir)

Expand Down

0 comments on commit 6d1144b

Please sign in to comment.