Stop attempting to display the Macro wiki page#169
Conversation
ca5bec0 to
7e7dcd2
Compare
This was error-prone and fragile, and prevented the wiki from being reformatted because it would break the AM's display. Switch to just showing the macros metadata, and also add display of the code (some macros include useful information in their code's header).
7e7dcd2 to
9489842
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the Addon Manager's macro display functionality by removing the fragile wiki page parsing system and replacing it with a simpler metadata-based display that includes macro code.
- Removes the complex
WikiCleanerHTML parser that was used to scrape and clean FreeCAD wiki pages - Replaces wiki parsing with direct metadata display showing macro information and code
- Refactors method names from
show_repotoshow_addonfor better clarity
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| composite_view.py | Updates method call from show_repo to show_addon |
| addonmanager_readme_controller.py | Removes wiki parsing logic and adds metadata-based macro display |
| addonmanager_package_details_controller.py | Refactors show_repo to show_addon and separates macro/non-macro display logic |
| Widgets/addonmanager_widget_addon_buttons.py | Adds parameter to control whether addons can be disabled |
| AddonManager.py | Updates method calls from show_repo to show_addon |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| else: | ||
| self.add_tag_to_html(f"/span") | ||
| if self.url[0] == "/": | ||
| if self.url.lower().endswith(".md"): |
There was a problem hiding this comment.
The original code checked self.url[:3] == ".md" which looks for files starting with ".md", but the new code checks endswith(".md") which looks for files ending with ".md". This changes the logic and may not handle the same cases correctly.
| if self.url[0] == "/": | ||
| if self.url.lower().endswith(".md"): | ||
| self.readme_data_type = ReadmeDataType.Markdown | ||
| elif self.url.lower().endswith(".html"): |
There was a problem hiding this comment.
The original code checked self.url[:5] == ".html" which looks for files starting with ".html", but the new code checks endswith(".html") which looks for files ending with ".html". This changes the logic and may not handle the same cases correctly.
This was error-prone and fragile, and prevented the wiki from being reformatted because it would break the AM's display. Switch to just showing the macros metadata, and also add display of the code (some macros include useful information in their code's header).