Generate a markdown table holding name and description of each vtk module
(module_list)
| 116 | |
| 117 | |
| 118 | def create_module_table(module_list): |
| 119 | """Generate a markdown table holding name and description of each vtk |
| 120 | module""" |
| 121 | |
| 122 | table = "| Module Name | Description|\n" |
| 123 | table += "|-------------|------------|\n" |
| 124 | for module in sorted(module_list, key=lambda item: item["NAME"][0]): |
| 125 | name = "{{bdg-primary-line}}`{module_name}`".format( |
| 126 | module_name=module["NAME"][0] |
| 127 | ) |
| 128 | description = module.get("DESCRIPTION", [""])[0] |
| 129 | # extra documentation exists add link |
| 130 | if "readme" in module.keys(): |
| 131 | value = module["readme"] |
| 132 | description += f" [{{material-regular}}`menu_book;2em`](../{value})" |
| 133 | line = "| " + name + "|" + description + "|" |
| 134 | table += line + "\n" |
| 135 | return table |
| 136 | |
| 137 | |
| 138 | # ----------------------------------------------------------------------------------------- |