@@ -130,26 +130,22 @@ def package_index_markdown(self) -> str:
130130
131131 def _get_installed_tools_markdown (self ) -> str :
132132 """Generates Markdown for installed tools section in package index."""
133- installed_tools = []
134-
135- def get_tool_path (relative_path ):
136- path = self .winpython_directory / relative_path if self .winpython_directory else None
137- return path if path and path .exists () else None
133+ tool_lines = []
138134
139- if nodejs_path := get_tool_path (NODEJS_RELATIVE_PATH ):
140- installed_tools .append (("Nodejs" , utils .get_nodejs_version (nodejs_path )))
141- installed_tools .append (("npmjs" , utils .get_npmjs_version (nodejs_path )))
135+ if (nodejs_path := self .winpython_directory / NODEJS_RELATIVE_PATH ).exists ():
136+ version = utils .get_nodejs_version (nodejs_path )
137+ tool_lines .append (f"[Nodejs](https://nodejs.org) | { version } | a JavaScript runtime built on Chrome's V8 JavaScript engine" )
138+ version = utils .get_npmjs_version (nodejs_path )
139+ tool_lines .append (f"[npmjs](https://www.npmjs.com) | { version } | a package manager for JavaScript" )
142140
143- if pandoc_exe := get_tool_path ("t/pandoc.exe" ):
144- installed_tools .append (("Pandoc" , utils .get_pandoc_version (str (pandoc_exe .parent ))))
141+ if (pandoc_exe := self .winpython_directory / "t" / "pandoc.exe" ).exists ():
142+ version = utils .get_pandoc_version (str (pandoc_exe .parent ))
143+ tool_lines .append (f"[Pandoc](https://pandoc.org) | { version } | an universal document converter" )
145144
146- if vscode_exe := get_tool_path ("t/VSCode/Code.exe" ):
147- installed_tools .append (("VSCode" , utils .getFileProperties (str (vscode_exe ))["FileVersion" ]))
145+ if vscode_exe := (self .winpython_directory / "t" / "VSCode" / "Code.exe" ).exists ():
146+ version = utils .getFileProperties (str (vscode_exe ))["FileVersion" ]
147+ tool_lines .append (f"[VSCode](https://code.visualstudio.com) | { version } | a source-code editor developed by Microsoft" )
148148
149- tool_lines = []
150- for name , version in installed_tools :
151- metadata = utils .get_package_metadata ("tools.ini" , name )
152- tool_lines .append (f"[{ name } ]({ metadata ['url' ]} ) | { version } | { metadata ['description' ]} " )
153149 return "\n " .join (tool_lines )
154150
155151 def _get_installed_packages_markdown (self ) -> str :
0 commit comments