Detecting if a FreeCAD command page has a complete {{GUICommand}} template

Discussions about the wiki documentation of FreeCAD and its translation.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
openBrain
Veteran
Posts: 9041
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: Detecting if a FreeCAD command page has a complete {{GUICommand}} template

Post by openBrain »

chrisb wrote: Wed Jan 22, 2020 7:48 pm Is this documented somewhere? It would be interesting for people extending or translating the documentation, and I still hope for a 0.19 boost in terms of docs.
The idea is first to fine-tune the script so information is formatted as we want. Then how to make it available publicly in another step.
Last edited by openBrain on Wed Jan 22, 2020 10:29 pm, edited 1 time in total.
chrisb
Veteran
Posts: 54293
Joined: Tue Mar 17, 2015 9:14 am

Re: Detecting if a FreeCAD command page has a complete {{GUICommand}} template

Post by chrisb »

Of course. Thanks.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
openBrain
Veteran
Posts: 9041
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: Detecting if a FreeCAD command page has a complete {{GUICommand}} template

Post by openBrain »

Attached a first release of the script (sorry, have to zip it so it's accepted by the forum).
It will :
  • Display a warning when a 'special' icon is used ('Icon' field used)
  • Display a warning when no icon exists ('Empty' field used)
  • Display a warning if both 'Icon' & 'Empty' fields are used
  • Finally, print 'OK' if all mandatory fields are there, or display 'NOK' if not
There are probably some corner cases that aren't properly handles, such as pages when the template is used more than once. ;)

EDIT : minor fixing in script
Attachments
checkGuiCommand.zip
(761 Bytes) Downloaded 20 times
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Detecting if a FreeCAD command page has a complete {{GUICommand}} template

Post by Kunda1 »

.
openBrain wrote: Wed Jan 22, 2020 10:37 pm Attached a first release of the script
Well done, my friend.
I'm traveling this week so won't be really available to test. Nevertheless, this is a great solid step in the direction of cleaning up and making the wiki more comprehensive. Cheers!
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
openBrain
Veteran
Posts: 9041
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: Detecting if a FreeCAD command page has a complete {{GUICommand}} template

Post by openBrain »

Kunda1 wrote: Thu Jan 23, 2020 1:25 am Well done, my friend.
I'm traveling this week so won't be really available to test. Nevertheless, this is a great solid step in the direction of cleaning up and making the wiki more comprehensive. Cheers!
Dont' worry. It's done when it's done. :) Enjoy your trip. Just tell me if you need adjustments when you'll have test it. ;)
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Detecting if a FreeCAD command page has a complete {{GUICommand}} template

Post by Kunda1 »

openBrain wrote: Thu Jan 23, 2020 9:15 am
OK! So, instead of moving forward with bash, lets convert this in to a python script (perhaps with the ability to import pywikibot to actually login and affect change in the future)

There are a lot of false positives due to the script indiscriminately checking wiki pages that wouldn't need to be searched (since they are not commands). The solution I'm thinking for this is creating a file hosted on github that has all the FreeCAD command names (aka pages that would have a {{GuiCommand}} template}, we can then point the script to access said file as an input. Does that make sense?

I'd also propose to have an option to indicate if a template is linted and/or to actually lint it. For example the {{GuiCommand}} markup is preferably expanded and not wrapped all on 1 line, ref: https://forum.freecadweb.org/viewtopic. ... 39#p365395
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
openBrain
Veteran
Posts: 9041
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: Detecting if a FreeCAD command page has a complete {{GUICommand}} template

Post by openBrain »

Could be good to first define a general algorithm (without referring any coding language). ;)
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Detecting if a FreeCAD command page has a complete {{GUICommand}} template

Post by Kunda1 »

openBrain wrote: Mon Feb 03, 2020 11:55 am Could be good to first define a general algorithm (without referring any coding language). ;)
Fair enough.

IHere is a list of all the FC commands (without their translation pages)
https://gist.github.com/luzpaz/08290325 ... 88822d15d1

We can have the script pull https://gist.githubusercontent.com/luzp ... tfile1.txt as the input
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Post Reply