FreeCAD coding/documentation standards?

Discussions about the wiki documentation of FreeCAD and its translation.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

FreeCAD coding/documentation standards?

Post by Kunda1 »

Is there a place where these are stated?
For coding:
uniform coding style for c++
uniform coding style for python
indentation, parenthesis, dos and don'ts
comment styling

I see https://www.freecadweb.org/wiki/index.p ... ource_code but it's a summary not specifics
https://www.freecadweb.org/wiki/index.p ... ui_Command has some info but very limited to specific subject

For documentation:
How to write doxygen comments for FreeCAD? (ref: http://www.iesensor.com/FreeCADDoc/0.16-dev/index.html or https://www.freecadweb.org/api/)
How to comment FC code?

EDIT:
FYI https://www.freecadweb.org/api/ is broken

EDIT 2:
I did find @qingfengxia effort at: https://github.com/qingfengxia/FreeCAD_Mod_Dev_Guide
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
Jee-Bee
Veteran
Posts: 2566
Joined: Tue Jun 16, 2015 10:32 am
Location: Netherlands

Re: FreeCAD coding/documentation standards?

Post by Jee-Bee »

User avatar
PrzemoF
Veteran
Posts: 3520
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: FreeCAD coding/documentation standards?

Post by PrzemoF »

For python in FEM: https://forum.freecadweb.org/viewtopic.php?f=18&t=12833

There were suggestions to use it for the rest of FreeCAD, but I don't know if it happened.
User avatar
kkremitzki
Veteran
Posts: 2518
Joined: Thu Mar 03, 2016 9:52 pm
Location: Illinois

Re: FreeCAD coding/documentation standards?

Post by kkremitzki »

Kunda1 wrote: EDIT:
FYI https://www.freecadweb.org/api/ is broken
Fixed via FTP and in repo via PR 504. There's still an error on both HTTP and HTTPS though, what is this "dynsections.js" in
https://github.com/kkremitzki/FreeCAD/b ... r.html#L17
?
It isn't present on the server, obviously, and it isn't present in a "make DevDoc" build folder...

Edit: Bleh, only index.html is fixed, new docs will need to be built.
Like my FreeCAD work? I'd appreciate any level of support via Patreon, Liberapay, or PayPal! Read more about what I do at my blog.
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: FreeCAD coding/documentation standards?

Post by Kunda1 »

kkremitzki wrote:
Kunda1 wrote: EDIT:
FYI https://www.freecadweb.org/api/ is broken
Fixed via FTP and in repo via PR 504. There's still an error on both HTTP and HTTPS though, what is this "dynsections.js" in
https://github.com/kkremitzki/FreeCAD/b ... r.html#L17
?
It isn't present on the server, obviously, and it isn't present in a "make DevDoc" build folder...

Edit: Bleh, only index.html is fixed, new docs will need to be built.
Thanks @kkremitzki !
yorik wrote:summoning @yorik to rebuild api docs
Thanks!
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
User avatar
kkremitzki
Veteran
Posts: 2518
Joined: Thu Mar 03, 2016 9:52 pm
Location: Illinois

Re: FreeCAD coding/documentation standards?

Post by kkremitzki »

Kunda1 wrote:
summoning @yorik to rebuild api docs
Thanks!
I actually have FTP superpowers now so I built the API web docs myself and I'm pushing them as we speak 8-)
Like my FreeCAD work? I'd appreciate any level of support via Patreon, Liberapay, or PayPal! Read more about what I do at my blog.
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: FreeCAD coding/documentation standards?

Post by Kunda1 »

PrzemoF wrote:For python in FEM: https://forum.freecadweb.org/viewtopic.php?f=18&t=12833

There were suggestions to use it for the rest of FreeCAD, but I don't know if it happened.
@PrzemoF Great. Should I continue the conversation in the FEM sub-forum or continue it here?
kkremitzki wrote:I actually have FTP superpowers now so I built the API web docs myself and I'm pushing them as we speak 8-)
Awesome...thanks for being so johnny on the spot :D
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
User avatar
yorik
Founder
Posts: 13665
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: FreeCAD coding/documentation standards?

Post by yorik »

kkremitzki wrote:I'm pushing them as we speak 8-)
Thanks!
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: FreeCAD coding/documentation standards?

Post by Kunda1 »

I'd like to resurrect this thread and continue discussing how to improve the API documentation for FC.
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
User avatar
NormandC
Veteran
Posts: 18589
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: FreeCAD coding/documentation standards?

Post by NormandC »

Sorry, I don't have the time to read the linked FEM coding standards topic.

I would like to submit for general standards that when creating a new command that generates an object in the Model tree, the programmer should ensure that the label is available for translation. I've been asking for this for years (there's a very old ticket on Mantis), and no programmer seems to care about it. Currently, only the Part Primitives have translated labels.

French
French
FC_translated_part_primitive_labels_01.png (9.52 KiB) Viewed 1969 times
Spanish
Spanish
FC_translated_part_primitive_labels_02.png (9.76 KiB) Viewed 1965 times
Chinese traditional
Chinese traditional
FC_translated_part_primitive_labels_03.png (10.8 KiB) Viewed 1957 times

This is just one of many usability issues in FreeCAD, and I think it's an important one that would be easy to fix. For most FreeCAD tools, the command is translated, but not its result.

I'm so tired of it not getting done that I would change the source code and submit a PR myself, if someone showed me how. I'm no programmer but I have an analytic mind.
Post Reply