Skip to content

Stop attempting to display the Macro wiki page#169

Merged
chennes merged 1 commit into
FreeCAD:mainfrom
chennes:showMacroCommentAndCode
Aug 14, 2025
Merged

Stop attempting to display the Macro wiki page#169
chennes merged 1 commit into
FreeCAD:mainfrom
chennes:showMacroCommentAndCode

Conversation

@chennes
Copy link
Copy Markdown
Member

@chennes chennes commented Aug 14, 2025

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).

Copilot AI review requested due to automatic review settings August 14, 2025 00:43

This comment was marked as outdated.

@chennes chennes force-pushed the showMacroCommentAndCode branch from ca5bec0 to 7e7dcd2 Compare August 14, 2025 00:46
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).
@chennes chennes force-pushed the showMacroCommentAndCode branch from 7e7dcd2 to 9489842 Compare August 14, 2025 00:47
@chennes chennes requested a review from Copilot August 14, 2025 00:52
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 WikiCleaner HTML 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_repo to show_addon for 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"):
Copy link

Copilot AI Aug 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
if self.url[0] == "/":
if self.url.lower().endswith(".md"):
self.readme_data_type = ReadmeDataType.Markdown
elif self.url.lower().endswith(".html"):
Copy link

Copilot AI Aug 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
@chennes chennes merged commit 5335ccc into FreeCAD:main Aug 14, 2025
11 checks passed
@chennes chennes deleted the showMacroCommentAndCode branch August 17, 2025 05:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants