Skip to content

Commit 2285fa5

Browse files
📝 Add docstrings to dev-from-macmini
Docstrings generation was requested by @myoshi2891. * #281 (comment) The following files were modified: * `generate_index.py`
1 parent 2493702 commit 2285fa5

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

generate_index.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -889,6 +889,19 @@ def generate_index(self) -> None:
889889
all_files_html = ""
890890

891891
def render_category_files(structure, sorted_categories):
892+
"""
893+
Builds HTML fragments for category tabs, per-category file lists, and an aggregated all-files list.
894+
895+
Parameters:
896+
structure (Dict[str, List[Tuple[str, str]]]): Mapping from category name to a list of (title, relative_path) pairs for files in that category.
897+
sorted_categories (List[str]): Ordered list of category names to render; determines the iteration order and tab order.
898+
899+
Returns:
900+
Tuple[str, str, str]: A 3-tuple with:
901+
- tabs_html: HTML for the category tab buttons (includes icon and item count for each category).
902+
- tab_contents_html: HTML sections for each category containing the per-category file lists and a "no results" placeholder.
903+
- all_files_html: Aggregated HTML list of all file items across all categories.
904+
"""
892905
tabs_html_list = []
893906
files_html_sections = []
894907
all_files_html_list = [] # Renamed to avoid conflict with outer scope all_files_html
@@ -942,4 +955,4 @@ def render_category_files(structure, sorted_categories):
942955
print(f"Successfully updated {output_index_path} with vendored assets at {current_time}")
943956

944957
if __name__ == "__main__":
945-
Solution().generate_index()
958+
Solution().generate_index()

0 commit comments

Comments
 (0)