Downloadable scripts - is it possible?

Discussions about the wiki documentation of FreeCAD and its translation.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
User avatar
PrzemoF
Veteran
Posts: 3520
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Downloadable scripts - is it possible?

Post by PrzemoF »

I just updated script to build FreeCAD on fedora 28/28/29 [1]. Is there a way to make it a downloadable file?

[1] https://www.freecadweb.org/wiki/Compile ... .2F28.2F29
vocx
Veteran
Posts: 5197
Joined: Thu Oct 18, 2018 9:18 pm

Re: Downloadable scripts - is it possible?

Post by vocx »

PrzemoF wrote: Fri Nov 30, 2018 10:05 pm I just updated script to build FreeCAD on fedora 28/28/29 [1]. Is there a way to make it a downloadable file?

[1] https://www.freecadweb.org/wiki/Compile ... .2F28.2F29
I think the only way to make it downloadable is to upload the script into the wiki using the Special:Upload page.

https://www.freecadweb.org/wiki/Special:Upload

According to that page, currently it only allows uploading image files, png, svg, jpg, etc.

So, the wiki administrators would need to change the configuration of the wiki to allow other file types.

According to the MediaWiki manual

https://www.mediawiki.org/wiki/Manual:C ... file_types

It seems the relevant code in the configuration is this

Code: Select all

$wgFileExtensions = array( 'png', 'gif', 'jpg', 'jpeg', 'svg', 'pdf'
);
Then, to create a link directly to the file you'd use the Media: namespace. So, in the wiki

Code: Select all

[[Media:Install_script.sh|Install script]]
Nevertheless, allowing the upload of actual code, either Bash or Python scripts, may be a security hazard. You would be allowing any wiki editor to add malicious code and make it downloadable to unsuspecting users. Therefore, I'm not so sure it's such a big advantage to have downloadable scripts.

Another problem with the wiki is that the information contained in the pages becomes obsolete. Unless someone periodically keeps the pages updated, the old information will remain. This is also true for uploaded content like images, and in this case it would also be true for scripts. If nobody changes the links to the scripts, users may be downloading old scripts that don't work with a new version of FreeCAD.

Also think about the translations, if changes are made to the English page, but the page is not set for translation, the English page may be using an up-to-date link to a script, while the translations may be using the older, obsolete link.
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
User avatar
PrzemoF
Veteran
Posts: 3520
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: Downloadable scripts - is it possible?

Post by PrzemoF »

Thank you very much for the explanation! Now I know I don't want it :)
mario52
Veteran
Posts: 4699
Joined: Wed May 16, 2012 2:13 pm

Re: Downloadable scripts - is it possible?

Post by mario52 »

hi

and as the forum
DownloadScript00.png
DownloadScript00.png (3.79 KiB) Viewed 713 times
I tried but failed (in the past)

mario
Maybe you need a special feature, go into Macros_recipes and Code_snippets, Topological_data_scripting.
My macros on Gist.github here complete macros Wiki and forum.
Post Reply