2626def format_datasets (datasets_text : str ) -> str :
2727 """Format dataset text into a nicer representation.
2828
29- Args:
30- datasets_text: Raw dataset text from README.md
31-
32- Returns:
29+ Parameters
30+ ----------
31+ datasets_text : str
32+ Raw dataset text from README.md
33+
34+ Returns
35+ -------
36+ str
3337 Formatted dataset HTML
3438
3539 """
@@ -94,8 +98,10 @@ def replace_markdown_link(match):
9498def parse_readme_table () -> Dict [str , List [Dict ]]:
9599 """Parse the reference implementations table from README.md.
96100
97- Returns:
98- Dict with years as keys and lists of implementation details as values.
101+ Returns
102+ -------
103+ Dict[str, List[Dict]]
104+ Dictionary with years as keys and lists of implementation details as values.
99105
100106 """
101107 readme_path = Path ("README.md" )
@@ -143,10 +149,14 @@ def parse_readme_table() -> Dict[str, List[Dict]]:
143149def generate_card_html (impl : Dict ) -> str :
144150 """Generate HTML for a single implementation card.
145151
146- Args:
147- impl: Dictionary containing implementation details
152+ Parameters
153+ ----------
154+ impl : Dict
155+ Dictionary containing implementation details
148156
149- Returns:
157+ Returns
158+ -------
159+ str
150160 HTML string for the implementation card
151161
152162 """
@@ -184,10 +194,14 @@ def generate_card_html(impl: Dict) -> str:
184194def get_year_sections (content : str ) -> Dict [str , Tuple [int , int , str ]]:
185195 """Extract year sections from the markdown content.
186196
187- Args:
188- content: The markdown content
197+ Parameters
198+ ----------
199+ content : str
200+ The markdown content
189201
190- Returns:
202+ Returns
203+ -------
204+ Dict[str, Tuple[int, int, str]]
191205 Dictionary mapping years to their (start_pos, end_pos, section_content)
192206
193207 """
@@ -213,11 +227,16 @@ def get_year_sections(content: str) -> Dict[str, Tuple[int, int, str]]:
213227def generate_year_section (year : str , implementations : List [Dict ]) -> str :
214228 """Generate a complete year section with all implementations.
215229
216- Args:
217- year: The year for this section
218- implementations: List of implementation details
230+ Parameters
231+ ----------
232+ year : str
233+ The year for this section
234+ implementations : List[Dict]
235+ List of implementation details
219236
220- Returns:
237+ Returns
238+ -------
239+ str
221240 Formatted year section
222241
223242 """
@@ -235,11 +254,16 @@ def rebuild_document(
235254) -> str :
236255 """Completely rebuild the document with all year sections.
237256
238- Args:
239- original_content: The original markdown content
240- implementations_by_year: Dictionary with implementations by year
257+ Parameters
258+ ----------
259+ original_content : str
260+ The original markdown content
261+ implementations_by_year : Dict[str, List[Dict]]
262+ Dictionary with implementations grouped by year
241263
242- Returns:
264+ Returns
265+ -------
266+ str
243267 Updated markdown content
244268
245269 """
@@ -271,8 +295,10 @@ def rebuild_document(
271295def update_docs_index (implementations_by_year : Dict [str , List [Dict ]]) -> None :
272296 """Update the docs/index.md file with cards for all implementations.
273297
274- Args:
275- implementations_by_year: Dictionary of implementations grouped by year
298+ Parameters
299+ ----------
300+ implementations_by_year : Dict[str, List[Dict]]
301+ Dictionary of implementations grouped by year
276302
277303 """
278304 docs_index_path = Path ("docs/index.md" )
@@ -337,7 +363,10 @@ def update_docs_index(implementations_by_year: Dict[str, List[Dict]]) -> None:
337363
338364
339365def main () -> None :
340- """Run main function to sync README.md implementations to docs/index.md."""
366+ """Run main function to sync README.md implementations to docs/index.md.
367+
368+ This function orchestrates the entire synchronization process from README.md to docs/index.md.
369+ """
341370 print ("Syncing reference implementations from README.md to docs/index.md..." )
342371 implementations_by_year = parse_readme_table ()
343372
0 commit comments