Help from Workbench Authors Needed

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
User avatar
chennes
Veteran
Posts: 3909
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Help from Workbench Authors Needed

Post by chennes »

We've now merged a new metadata standard into the main development branch, and I've just submitted a PR for an update to the Addon Manager that adds support for that metadata (https://github.com/FreeCAD/FreeCAD/pull/5131). I'd love for a few particularly daring workbench authors to try adding that metadata file to their workbench's git repository.

The standard was designed with backwards-compatibility in mind, so you won't need to make any changes to your workbench, just add the package.xml file (and potentially an icon file, if you don't already have one in your repo someplace). You can check out @Chris_G's Curves workbench for an example. What I'm particularly interested in is whether the documentation on the wiki is adequate, and makes sense, and if you run into anything in the standard that doesn't make sense or you think needs to change. Also, any suggestions you have for how to best change the Addon Manager to work with this new unified metadata (e.g. how to display and search the tags, etc.)

Thanks!

P.S. I haven't yet got the FreeCAD internals working with macros distributed like this, so this is just for workbenches and preference packs at the moment. Macros should be working in a few more days.
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
openBrain
Veteran
Posts: 9041
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: Help from Workbench Authors Needed

Post by openBrain »

At one time it could be cool to have a graphical generator/editor for the metadata file. :)

I look at Curves WB example and I'm surprised that nowhere in the file it is made clear that the file is intended for FreeCAD use. I think it could be good to encourage (even enforce) to use a defined namespace. Something like xmlns="http://freecad.org/metadata"
User avatar
chennes
Veteran
Posts: 3909
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: Help from Workbench Authors Needed

Post by chennes »

openBrain wrote: Wed Oct 27, 2021 9:10 pm Something like xmlns="http://freecad.org/metadata"
That's an excellent idea -- are you thinking of it for the package element:

Code: Select all

<package xmlns="http://freecad.org/metadata">
??
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
openBrain
Veteran
Posts: 9041
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: Help from Workbench Authors Needed

Post by openBrain »

chennes wrote: Wed Oct 27, 2021 9:22 pm That's an excellent idea -- are you thinking of it for the package element:

Code: Select all

<package xmlns="http://freecad.org/metadata">
??
Exactly.
I think it's good to have it because both a "reader" knows the file is intended for FreeCAD, and FreeCAD can be sure that the file is intended for it. :)
One thing I can't be totally sure reading the doc : can a metadata file contain several <package> blocks?
User avatar
chennes
Veteran
Posts: 3909
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: Help from Workbench Authors Needed

Post by chennes »

openBrain wrote: Wed Oct 27, 2021 9:52 pm Can a metadata file contain several <package> blocks?
No: one package per package.xml file.
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
User avatar
jonasb
Posts: 162
Joined: Tue Dec 22, 2020 7:57 pm

Re: Help from Workbench Authors Needed

Post by jonasb »

openBrain wrote: Wed Oct 27, 2021 9:10 pm I think it could be good to encourage (even enforce) to use a defined namespace. Something like xmlns="http://freecad.org/metadata"
While I think this is a good idea in general, I consider "http://freecad.org/metadata" a bit too generic. I'd suggest "https://freecad.org/package-metadata/2021". Or do we have any other XML namespace names in FreeCAD already, which template we could follow? Document.xml in *.FCStd doesn't seem to have a namespace...

For some rationals please see also §3 of https://google.github.io/styleguide/xmlstyle.html
User avatar
chennes
Veteran
Posts: 3909
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: Help from Workbench Authors Needed

Post by chennes »

jonasb wrote: Thu Oct 28, 2021 8:07 pm Or do we have any other XML namespace names in FreeCAD already, which template we could follow?
Well, TechDraw's symbols actually use their description wiki page as their namespace, so we could use "https://wiki.freecad.org/Package_Metadata"
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
TheMarkster
Veteran
Posts: 5513
Joined: Thu Apr 05, 2018 1:53 am

Re: Help from Workbench Authors Needed

Post by TheMarkster »

I added package.xml to ThreadProfile, DynamicData, and MeshRemodel. Let me know if anything in any of them needs fixing.
User avatar
chennes
Veteran
Posts: 3909
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: Help from Workbench Authors Needed

Post by chennes »

TheMarkster wrote: Sun Oct 31, 2021 3:31 am Let me know if anything in any of them needs fixing.
Thanks! The path to your icons includes an extra component: you have, e.g.

Code: Select all

      <icon>DynamicData/Resources/icons/DynamicDataLogo.svg</icon>
but it should just be

Code: Select all

      <icon>Resources/icons/DynamicDataLogo.svg</icon>
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
Post Reply