Skip to content

AddonManager: Render different addon documents on a tabbed group#18199

Closed
hasecilu wants to merge 2 commits intoFreeCAD:mainfrom
hasecilu:enhancement/files_tabs
Closed

AddonManager: Render different addon documents on a tabbed group#18199
hasecilu wants to merge 2 commits intoFreeCAD:mainfrom
hasecilu:enhancement/files_tabs

Conversation

@hasecilu
Copy link
Copy Markdown
Contributor

@hasecilu hasecilu commented Nov 29, 2024

Works as expected but probably it's better to tweak a little the code. Are plans to update the package metadata format? Not sure if it really interesting to h ave the license.

Important

As of now documents URL are hardcoded, probably is better to only hardcode the package.xml URL and then from it parse all needed URLS, but as of now contributing or changelog are not in the specification.

  • Hide when showing macros
  • Heading with link is downgraded to text
  • Emojis from changelog don't appear 😭 Is the font on FreeCAD not able to fallback when codepoint is not populated on current font?
GitHub AM
image image

image

Fix FreeCAD/AddonManager#5

@luzpaz
Copy link
Copy Markdown
Contributor

luzpaz commented Dec 4, 2024

An update to the https://wiki.freecad.org/Package_Metadata (package.xml) documentation will be required as well.

@hasecilu
Copy link
Copy Markdown
Contributor Author

hasecilu commented Dec 4, 2024

I was making some tests like adding URLs on the metadata (instancezero/in3dca-freegrid@63c0474) but would be really needed?

The URL of the README on the metadata is the blob one (html) which is not used by the Addon Manager to render, AM generates the raw URL containing markdown which is used. CONTRIBUTING and CHANGELOG are fairly standard files, license varies but at least we know the file.

Is there another file for which would be useful to show to users? I usually add a README file on the translations directory until now I only have put instructions there but maybe adding a table with progress for each language is informative.

@hasecilu hasecilu force-pushed the enhancement/files_tabs branch from 18edb91 to 4038244 Compare January 18, 2025 17:50
@hasecilu
Copy link
Copy Markdown
Contributor Author

I was thinking on extending the specification to contain the relative path of the document like:

<changelog>./CHANGELOG.md</changelog>
<contributing>CONTRIBUTING.md</contributing>

When we need raw or blob URL we can use the updated def construct_git_url(repo, doc: str, raw_file: bool = True) function that works with many git providers.

I don't like the README way because it directly assigns a branch on the URL:

  <url type="readme">https://github.com/instancezero/in3dca-freegrid/blob/main/README.md</url>

And when I add a custom URL for a testing branch, the AM still tries docs from main branch, but this is an edge case.

An alternative way would be to add entry like LICENSE. where file is specified

  <license file="LICENSE">AGPL-3.0-or-later</license>
  <changelog file="CHANGELOG.md"></changelog>
  <contributing file="CONTRIBUTING.md"></contributing>

augmenting metadata spec with this entries we can construct the needed URLs.

@hasecilu hasecilu marked this pull request as ready for review January 18, 2025 18:09
self.dialog.documentationURLLineEdit.setText(url["location"])
elif url["type"] == "discussion":
self.dialog.discussionURLLineEdit.setText(url["location"])
# TODO: add changelog and contributing
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

If added to spec...

@ovo-Tim
Copy link
Copy Markdown
Contributor

ovo-Tim commented Jan 25, 2025

Hi, since you changed construct_git_url, maybe you could have a look at this: #19242

self.contrib_browser = WidgetReadmeBrowser(self)
self.license_browser = WidgetReadmeBrowser(self)

# TODO: notify WB maintainers to include CHANGELOG and CONTRIBUTING files
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We can open a tracking ticket on FreeCAD-Addons when this PR is merged.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Can the "Addon developers" group on on FreeCAD's GitHub org emit announcements?

Comment thread src/Mod/AddonManager/addonmanager_devmode_metadata_checker.py Outdated
@hasecilu hasecilu force-pushed the enhancement/files_tabs branch from 4038244 to 1cd132e Compare January 26, 2025 18:35
@hasecilu hasecilu marked this pull request as draft January 29, 2025 16:43
@hasecilu hasecilu force-pushed the enhancement/files_tabs branch 2 times, most recently from 8607654 to c833fc8 Compare January 29, 2025 21:57
Previously only the README file was rendered when opening addon details,
this change introduces the addition of more relevant documents:
CHANGELOG, CONTRIBUTING and LICENSE.
@hasecilu hasecilu force-pushed the enhancement/files_tabs branch from c833fc8 to 53cb878 Compare January 29, 2025 21:59
contributing = auto()
license = auto()
readme = auto()
picture = auto() # TODO: for gallery
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Could work like that if images are included on the repo, otherwise we could use URLs to the images.

https://github.com/FreeCAD/FreeCAD/issues/13632

# List of urls
metadata.url.append(MetadataReader._parse_url(child))
elif tag == "doc":
metadata.docs.append(MetadataReader._parse_doc(child))
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Created new tag
Tested adding testing branch to AM on settings -https://github.com/instancezero/in3dca-freegrid/tree/test/am_docs

  <doc type="readme">README.md</doc>
  <doc type="changelog">CHANGELOG.md</doc>
  <doc type="contributing">CONTRIBUTING.md</doc>

@maxwxyz maxwxyz added the Type: Feature FR for improvements or new features label Aug 21, 2025
@maxwxyz maxwxyz added this to the 1.2 milestone Sep 18, 2025
@github-actions
Copy link
Copy Markdown
Contributor

Thanks for helping improve FreeCAD!
This pull request hasn’t seen activity in a while. We automatically check each PR after 120 days without activity to keep the repository tidy.

If the PR is still relevant, let us know by adding a comment.
Otherwise, we’ll close this PR automatically in 60 days.

If you would like to keep working on this pull request, we advice to rebase it on current main branch, ask feedback from users or maintainers and engage with the community to get it forward.

@github-actions github-actions Bot added the Status: Stale Stale and might be closed automatically. label Jan 28, 2026
@chennes chennes closed this Feb 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Mod: Addon Manager Status: Stale Stale and might be closed automatically. Type: Feature FR for improvements or new features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Changelog feature for addon devs to display what is new in an addon update

5 participants