@@ -80,33 +80,49 @@ def _version_label(project: dict, version_name: str, releases: dict) -> str:
8080
8181
8282def _api_docs (data : dict , section : str ) -> str :
83- blocks = []
83+ cards = []
8484 for project in data ["docs" ][section ].values ():
8585 if project .get ("hidden" , False ):
8686 continue
8787 versions = []
8888 for name in ("stable" , "nightly" , "legacy" ):
8989 if project ["versions" ].get (name ) == 1 :
9090 label = _version_label (project , name , data ["releases" ])
91- versions .append (f"** [{ name } ({ label } )](/api/{ project ['path' ]} /{ name } /)** " )
91+ versions .append (f"[{ name . title () } ({ label } )](/api/{ project ['path' ]} /{ name } /)" )
9292 links = []
9393 if project .get ("cllink" ):
94- links .append (f"**[changelog]({ project ['cllink' ]} )**" )
95- links .append (f"**[github]({ project ['ghlink' ]} )**" )
96- blocks .append (
94+ links .append (f"[Changelog]({ project ['cllink' ]} )" )
95+ links .append (f"[GitHub]({ project ['ghlink' ]} )" )
96+ footer = []
97+ if versions :
98+ footer .extend (["**Documentation:** " + " · " .join (versions ), "" ])
99+ footer .append ("**Resources:** " + " · " .join (links ))
100+ cards .append (
97101 "\n " .join (
98102 [
99- f"### { project ['name' ]} " ,
103+ f":::{{grid-item-card}} { project ['name' ]} " ,
104+ ":class-card: rapids-api-card" ,
105+ ":class-title: rapids-api-card-title" ,
106+ ":class-footer: rapids-api-card-footer" ,
100107 "" ,
101108 project ["desc" ],
102109 "" ,
103- "#### DOCS" + ( " " + " | " . join ( versions ) if versions else "" ) ,
104- "" ,
105- "#### LINKS " + " | " . join ( links ) ,
110+ "+++" ,
111+ * footer ,
112+ ":::" ,
106113 ]
107114 )
108115 )
109- return "\n \n " .join (blocks )
116+ return "\n " .join (
117+ [
118+ "::::{grid} 1 1 2 2" ,
119+ ":gutter: 2" ,
120+ ":class-container: rapids-api-grid" ,
121+ "" ,
122+ "\n \n " .join (cards ),
123+ "::::" ,
124+ ]
125+ )
110126
111127
112128def _compute_capability (cuda : dict ) -> str :
0 commit comments