Bug 106221 - Use of Javascript for writing Macros and Extensions not documented
Summary: Use of Javascript for writing Macros and Extensions not documented
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: sdk (show other bugs)
Version:
(earliest affected)
3.3.0 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: needsDevAdvice
Depends on:
Blocks: Macro-Documentation
  Show dependency treegraph
 
Reported: 2017-02-27 19:45 UTC by jan d
Modified: 2024-04-03 04:42 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description jan d 2017-02-27 19:45:08 UTC
Description:
The use of Javascript for writing Macros and Extensions seems not to be documented on the wiki or anywhere else in libreoffice-space. 



Actual Results:  
I found the following: 

* https://wiki.documentfoundation.org/Extensions mentions the possibility to write Extensions in Javascript, but there seems to be no further info.
* There are some examples for macros in JS at: http://opengrok.libreoffice.org/xref/core/scripting/examples/javascript/ but I did not find them linked anywhere

Expected Results:
Ideally, there would be: 

* An example for a Extension written in JS
* Information on how to debug extensions which are written in JS.



Reproducible: Always

User Profile Reset: No

Additional Info:


User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:51.0) Gecko/20100101 Firefox/51.0
Comment 1 Dan Dascalescu 2017-10-14 21:01:05 UTC
Pretty please document the JavaScript macro functions!

This lack of documentation is ridiculous.

JavaScript is the most popular programming language (see https://developers.slashdot.org/story/17/08/24/1457245/javascript-is-eating-the-world for an update).

People have been asking for to use JavaScript in macros since Sep 2016 - https://ask.libreoffice.org/en/question/77779/need-step-by-step-instructions-to-create-new-javascript-macro/

I've also asked for something as simple as a JavaScript currency conversion macro - https://ask.libreoffice.org/en/question/98257/javascript-macro-reference/

Yet, nothing?!

Why does LO even support JavaScript then, if it's completely undocumented?

The only slightly relevant stuff I've found on GitHub are three scantily documented samples at https://github.com/LibreOffice/core/tree/master/scripting/examples/javascript
Comment 2 QA Administrators 2018-10-16 02:51:05 UTC Comment hidden (obsolete)
Comment 3 Dan Dascalescu 2018-10-16 04:39:31 UTC
This is still an issue. A web search for "LibreOffice JavaScript macro reference" produces non-results, i.e. my own questions[1], and an acknowledgment from Olivier Hallot that the wiki does need to cover this.

[1]: https://ask.libreoffice.org/en/question/98257/javascript-macro-reference/

[2]: https://listarchives.libreoffice.org/global/documentation/msg11912.html

https://help.libreoffice.org/Common/Scripting mentions JavaScript without any additional details.
Comment 4 Miya Everett 2020-05-19 10:38:32 UTC Comment hidden (spam)
Comment 5 Rafael Lima 2021-05-12 15:01:30 UTC
There's a very short documentation about Javascript in the Getting Started Guide, page 403.

https://wiki.documentfoundation.org/images/b/b7/GS70-GettingStarted.pdf

What can be done in the short term is create a help page describing how to create a Hello World in javascript based on the example available in the guide.

Currently there has been a huge effort in improving Python documentation in LO, specially due the ScriptForge library, which allows Basic/Python interoperability.

https://help.libreoffice.org/7.2/en-US/text/sbasic/shared/03/lib_ScriptForge.html?DbPAR=BASIC#bm_id491529070339774
Comment 6 QA Administrators 2023-09-01 03:14:34 UTC Comment hidden (obsolete)
Comment 7 Stéphane Guillou (stragu) 2024-04-03 04:42:56 UTC
Just a note that the Rhino editor/debugger is removed with the Rhino 1.7.14 update: 58c4457a902c846229dc3383cc31bbc8f4b3aed9 (to be included in 24.8 release)