Skip to content

Commit

Permalink
Reorganizing the Scripts section (#146)
Browse files Browse the repository at this point in the history
* reorganizing

* Rename src/docs/scripting/Learning Guides/Scripting.md to src/docs/scripting/Scripting.md

* Rename src/docs/scripting/Scripting.md to src/docs/scripting/Learning Guides/Scripting_guide.md

* Update Start_Here.md

* Update Formulas.md

* Create advanced_topics.md

* Update SUMMARY.md

* reorganizing pages

* Update SUMMARY.md

* Update Start_Here.md

* Update .gitignore
  • Loading branch information
euu2021 authored Mar 31, 2024
1 parent aa21d29 commit 297b215
Show file tree
Hide file tree
Showing 59 changed files with 291 additions and 658 deletions.
131 changes: 82 additions & 49 deletions src/docs/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,43 +26,63 @@
- [ArchUnit Test Result Viewer](user-documentation/ArchUnit_Extension.md)
- [Contribute](contribute/contribute.md)
- [Translation How-To](contribute/Translation_How-To.md)
- [Scripting](scripting/Scripting.md)
- [API/Groovy tutorial](scripting/api-groovy-tutorial.md)
- [Formulas](scripting/Formulas.md)
- [🤖 Scripts and Scripting. Start Here](scripting/Start_Here.md)
- [Learning Guide](scripting/Learning_guide.md)
- [What are scripts and what they do](scripting/What_are_scripts_and_what_they_do.md)
- [API/Groovy tutorial](scripting/api-groovy-tutorial.md)
- [Scripting guide](scripting/Scripting.md)
- [Scripting Setup](scripting/Scripting_environment_setup.md)
- [Scripting environment setup](scripting/Scripting_environment_setup.md)
- [Edit scripts in Eclipse](scripting/Edit_scripts_in_Eclipse.md)
- [intellij-idea-setup](scripting/intellij-idea-setup.md)
- [References and Cheatsheet](scripting/References_and_Cheatsheet.md)
- [Reference](scripting/Reference.md)
- [Scripting Cheatsheet](scripting/Scripting_Cheatsheet.md)
- [Basics](scripting/Basics.md)
- [Advanced Topics](scripting/advanced_topics.md)
- [Add-ons (Develop)](scripting/Add-ons_(Develop).md)
- [Batch Jobs](scripting/Batch_Jobs.md)
- [Debugging scripts](scripting/Debugging_scripts.md)
- [External script file execution](scripting/External_script_file_execution.md)
- [Formulas](scripting/Formulas.md)
- [Formula filter](scripting/Scripting!_Script_filter.md)
- [Scripting Cheatsheet](scripting/Scripting_Cheatsheet.md)
- [Scripts](scripting/Scripts_collection.md)
- [Groovy scripts and formulas can escape sandbox](scripting/Groovy_scripts_and_formulas_can_escape_sandbox.md)
- [How to publish add-ons](scripting/How_to_publish_add-ons.md)
- [Init scripts](scripting/Init_scripts.md)
- [Map local scripts](scripting/Map_local_scripts.md)
- [Scripting! API Changes](scripting/Scripting!_API_Changes.md)
- [Scripting! Freeplane Utility Classes](scripting/Scripting!_Freeplane_Utility_Classes.md)
- [Scripting! Included libraries](scripting/Scripting!_Included_libraries.md)
- [Scripting! Jython](scripting/Scripting!_Jython.md)
- [Scripting! Other languages](scripting/Scripting!_Other_languages.md)
- [Scripting! Script filter](scripting/Scripting!_Script_filter.md)
- [Scripting! Update Freeplane's Groovy version](scripting/Scripting!_Update_Freeplane's_Groovy_version.md)- [Scripting API](scripting/Scripting_API.md)
- [Security considerations](scripting/Security_considerations.md)
- [Your own utility script library](scripting/Your_own_utility_script_library.md)
- [Scripting showcase and examples](scripting/Finding_useful_scripts.md)
- [Scripting text editing](scripting/Scripting_text_editing.md)
- [Example scripts using external libraries](scripting/Example_scripts_using_external_libraries.md)
- [Scripts collection](scripting/Scripts_collection.md)
- [Scripts for text editing](scripting/Scripting_text_editing.md)
- [Scripts using external libraries](scripting/Example_scripts_using_external_libraries.md), too.
- [Script incubator](scripting/Script_incubator.md)
- [Scripting! Jython](scripting/Scripting!_Jython.md)
- [Scripting environment setup](scripting/Scripting_environment_setup.md)
- [Scripting basics (wip)](scripting/Basics.md)
- [Scripting reference (wip)](scripting/Reference.md)
- [IntelliJ IDEA setup](scripting/intellij-idea-setup.md)
- [Add-ons (Development)](scripting/Add-ons_(Develop).md)
- [Security considerations](scripting/Security_considerations.md)
- [Scripting (Examples By Category)](scripting_examples/_scripting_examples.md)
- [Node Attributes](scripting_examples/_category_node.md)
- [Text, Details, Note](scripting_examples/text_details_note.md)
- [Node Style](scripting_examples/style.md)
- [Links](scripting_examples/links.md)
- [Icons](scripting_examples/icons.md)
- [Attributes](scripting_examples/attributes.md)
- [Cloud (TBD)]()
- [Shape, Border (TBD)]()
- [Edges (TBD)]()
- [Layout (TBD)]()
- [Mind Map](scripting_examples/_category_map.md)
- [Mindmap Traversal](scripting_examples/traverse.md)
- [Selection](scripting_examples/selection.md)
- [Alias](scripting_examples/alias.md)
- [Filters (TBD)]()
- [Others](scripting_examples/_category_others.md)
- [Clipboard](scripting_examples/clipboard.md)
- [GUI](scripting_examples/gui.md)
- [Scripting! Example scripts](scripting/Scripting!_Example_scripts.md)
- [Scripting (Examples By Category)](scripting/scripting_examples/_scripting_examples.md)
- [Node Attributes](scripting/scripting_examples/_category_node.md)
- [Text, Details, Note](scripting/scripting_examples/text_details_note.md)
- [Node Style](scripting/scripting_examples/style.md)
- [Links](scripting/scripting_examples/links.md)
- [Icons](scripting/scripting_examples/icons.md)
- [Attributes](scripting/scripting_examples/attributes.md)
- [Cloud (TBD)]()
- [Shape, Border (TBD)]()
- [Edges (TBD)]()
- [Layout (TBD)]()
- [Mind Map](scripting/scripting_examples/_category_map.md)
- [Mindmap Traversal](scripting/scripting_examples/traverse.md)
- [Selection](scripting/scripting_examples/selection.md)
- [Alias](scripting/scripting_examples/alias.md)
- [Filters (TBD)]()
- [Others](scripting/scripting_examples/_category_others.md)
- [Clipboard](scripting/scripting_examples/clipboard.md)
- [GUI](scripting/scripting_examples/gui.md)
- [Coding](coding/Git_howto.md)
- [Git howto](coding/Git_howto.md)
- [How to build Freeplane](coding/How_to_build_Freeplane.md)
Expand All @@ -77,15 +97,11 @@
- [Old Home](attic/old-mediawiki-content/Home.md)
- [Approximate search](attic/old-mediawiki-content/Approximate_search.md)
- [Architecture](attic/old-mediawiki-content/Architecture.md)
- [Batch Jobs](attic/old-mediawiki-content/Batch_Jobs.md)
- [Contributors](attic/old-mediawiki-content/Contributors.md)
- [Current Freeplane File Format](attic/old-mediawiki-content/Current_Freeplane_File_Format.md)
- [Data recognition and data formats](attic/old-mediawiki-content/Data_recognition_and_data_formats.md)
- [Debugging scripts](attic/old-mediawiki-content/Debugging_scripts.md)
- [Document Format](attic/old-mediawiki-content/Document_Format.md)
- [Edit scripts in Eclipse](attic/old-mediawiki-content/Edit_scripts_in_Eclipse.md)
- [External objects](attic/old-mediawiki-content/External_objects.md)
- [External script file execution](attic/old-mediawiki-content/External_script_file_execution.md)
- [FAQ](attic/old-mediawiki-content/FAQ.md)
- [Fixed security vulnerabilities](attic/old-mediawiki-content/Fixed_security_vulnerabilities.md)
- [FreeMind 0.9.0 - Freeplane 1.1.x](attic/old-mediawiki-content/FreeMind_0.9.0_-_Freeplane_1.1.x.md)
Expand All @@ -100,20 +116,16 @@
- [Freeplane installation for Ubuntu OS](attic/old-mediawiki-content/Freeplane_installation_for_Ubuntu_OS.md)
- [Get the code](attic/old-mediawiki-content/Get_the_code.md)
- [Goals](attic/old-mediawiki-content/Goals.md)
- [Groovy scripts and formulas can escape sandbox](attic/old-mediawiki-content/Groovy_scripts_and_formulas_can_escape_sandbox.md)
- [Harmonizing FP-menu](attic/old-mediawiki-content/Harmonizing_FP-menu.md)
- [Help!Contents](attic/old-mediawiki-content/Help!Contents.md)
- [Help!Editing](attic/old-mediawiki-content/Help!Editing.md)
- [Help Previous Freeplane Versions](attic/old-mediawiki-content/Help_Previous_Freeplane_Versions.md)
- [How to publish add-ons](attic/old-mediawiki-content/How_to_publish_add-ons.md)
- [How to test](attic/old-mediawiki-content/How_to_test.md)
- [Information management with Freeplane add-on dView(indexfile)](attic/old-mediawiki-content/Information_management_with_Freeplane_add-on_dView(indexfile).md)
- [Init scripts](attic/old-mediawiki-content/Init_scripts.md)
- [Japanese](attic/old-mediawiki-content/Japanese.md)
- [Linux](attic/old-mediawiki-content/Linux.md)
- [Logo and splashscreen](attic/old-mediawiki-content/Logo_and_splashscreen.md)
- [Macintosh](attic/old-mediawiki-content/Macintosh.md)
- [Map local scripts](attic/old-mediawiki-content/Map_local_scripts.md)
- [Map templates](attic/old-mediawiki-content/Map_templates.md)
- [Menus and commands](attic/old-mediawiki-content/Menus_and_commands.md)
- [Mind map gallery](attic/old-mediawiki-content/Mind_map_gallery.md)
Expand All @@ -126,12 +138,6 @@
- [Release cycle](attic/old-mediawiki-content/Release_cycle.md)
- [Release smoke test](attic/old-mediawiki-content/Release_smoke_test.md)
- [Rules to build user friendly menus](attic/old-mediawiki-content/Rules_to_build_user_friendly_menus.md)
- [Scripting! API Changes](attic/old-mediawiki-content/Scripting!_API_Changes.md)
- [Scripting! Freeplane Utility Classes](attic/old-mediawiki-content/Scripting!_Freeplane_Utility_Classes.md)
- [Scripting! Included libraries](attic/old-mediawiki-content/Scripting!_Included_libraries.md)
- [Scripting! Other languages](attic/old-mediawiki-content/Scripting!_Other_languages.md)
- [Scripting! Update Freeplane's Groovy version](attic/old-mediawiki-content/Scripting!_Update_Freeplane's_Groovy_version.md)
- [Scripting API](attic/old-mediawiki-content/Scripting_API.md)
- [Support](attic/old-mediawiki-content/Support.md)
- [Think Tank](attic/old-mediawiki-content/Think_Tank.md)
- [Translation nl](attic/old-mediawiki-content/Translation_nl.md)
Expand All @@ -143,7 +149,6 @@
- [Visions](attic/old-mediawiki-content/Visions.md)
- [Wish List](attic/old-mediawiki-content/Wish_List.md)
- [XML External Entity vulnerability in map parser](attic/old-mediawiki-content/XML_External_Entity_vulnerability_in_map_parser.md)
- [Your own utility script library](attic/old-mediawiki-content/Your_own_utility_script_library.md)./src/docs/attic/_sidebar.md
- [New wiki initiative](attic/new-wiki-initiative/customizing-freeplane.md)
- [customizing-freeplane](attic/new-wiki-initiative/customizing-freeplane.md)
- [glossary](attic/new-wiki-initiative/glossary.md)
Expand All @@ -154,3 +159,31 @@
# Special pages

- [After redirect from the old media wiki](after-redirect.md)




























4 changes: 4 additions & 0 deletions src/docs/coding/IDE_setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ As soon as you have once launched Freeplane as described, you will find appropri

## IDE: IntelliJ

This page has the instructions that may be the easiest, currently: [Setting_IDE_for_debugging](../scripting/Setting_IDE_for_debugging.md)

Otherwise, you can try those steps:

The short story:<br/>
IntelliJ can directly import gradle files. After the import the directory
<code>freeplane_debughelper/idea/runConfigurations</code> containing run
Expand Down
2 changes: 1 addition & 1 deletion src/docs/how-to-get-help.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ in our **[DISCUSSIONS FORUM](https://github.com/freeplane/freeplane/discussions)

* discuss the usage of existing features
* discuss the suitability of new features
* discuss the development of [existing scripts](scripting/Scripts_collection.md) and new ones
* discuss the development of [existing scripts](scripting/Scripting showcase and examples/Scripts_collection.md) and new ones

New bug reports go into the [bug reports](https://github.com/freeplane/freeplane/issues/new?template=bug_report.md)

Expand Down
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,47 +7,47 @@ Almost all your scripts will access properties from Freeplane - the selected nod

1. Open the file *freeplane-osgi.launch* via the *Open resource* command (Ctrl+Shift+R):

![border](Eclipse-debugging1.png)
![border](../images/Eclipse-debugging1.png)


2. The file describes how a Freeplane instance can be launched from Eclipse. Use it this way:

![border](Eclipse-debugging2.png)
![border](../images/Eclipse-debugging2.png)


3. Let's assume you want to debug a script called test.groovy. The script execution should be stopped before executing the second line of code. Therefore we have to set a "Breakpoint" at this line. Open the context menu over the line with a right mouse click.

(By the way: In the lower part of the image below you can see the "Console" window. It contains Freeplane's log output - very helpful in case of errors. - You don't have to visit to logfile to inspect error traces.)

![border](Eclipse-debugging3.png)
![border](../images/Eclipse-debugging3.png)

A faster way to add breakpoints is to double click in the left bar before the line. The breakpoint is visualized as a small blue point:

![border](Eclipse-debugging4.png)
![border](../images/Eclipse-debugging4.png)


4. Then start the script in Freeplane. After some seconds Eclipse will get activated since the breakpoint in the script is hit. A dialog may appear in Eclipse:

![border](Eclipse-debugging5.png)
![border](../images/Eclipse-debugging5.png)


5. Eclipse doesn't know yet where to look for the sources of the script. Click on "Edit Source Lookup Path"

![border](Eclipse-debugging6.png)
![border](../images/Eclipse-debugging6.png)


6. In the following dialog click on *Add* then follow the screen shots

![border](Eclipse-debugging7.png)
![border](../images/Eclipse-debugging7.png)

![border](Eclipse-debugging8.png)
![border](../images/Eclipse-debugging8.png)

![border](Eclipse-debugging9.png)
![border](../images/Eclipse-debugging9.png)


7. Finally the code line is displayed! In the "Variable" view in the upper right side corner you can inspect variables. For further instructions on how to use the Debugging perspective see the [Eclipse debugging perspective](http://www.vogella.com/articles/EclipseDebugging/article.html).

![border](Eclipse-debugging10.png)
![border](../images/Eclipse-debugging10.png)

Enjoy!

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ After the installation of the [Scripting environment](../scripting/Scripting_env

This is what it looks like after opening a script via *Ctrl+Shift+R*:

![border](Eclipse-edit-script.png)
![border](../images/Eclipse-edit-script.png)

## Code completion and quickfixes

Expand All @@ -23,15 +23,15 @@ class Hello {

When we want to use class Hello we have to consider that it is defined in the package "hellopackage". Let's use Eclipse' editing aids to use it: After entering *def hello = new hell* hit Ctrl+Space

![border](Eclipse-code-completion1.png)
![border](../images/Eclipse-code-completion1.png)

You will see that there is an error since the required *"import hellopackage"* is unfortunately not added automatically (as it is for imported Java classes). But the small red "x" indicates that a "Quick fix" is available which you can select either by clicking on the "x" or by hitting Ctrl+1

![border](Eclipse-quickfix.png)
![border](../images/Eclipse-quickfix.png)

After selecting the first suggestion by hitting *Enter* you will be done:

![border](Eclipse-quickfix-result.png)
![border](../images/Eclipse-quickfix-result.png)

My tip: Test what happens if you type *Ctrl+Space* whenever you think that Eclipse might have an idea what you are about to type. The idea is: You do the creative work and and Eclipse cares for the tedious details of exact naming and locating objects.

Expand Down
19 changes: 19 additions & 0 deletions src/docs/scripting/Finding_useful_scripts.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
There are many scripts and Add-ons spread over the internet. Here are some suggestions of how to search for those scripts:

Inside this documentation:
- [The Add-ons page](Add-ons_(install).md)
- [The scripts collection](Scripts_collection.md)
- [Scripts for text editing](Scripting_text_editing.md)
- [Script incubator](Script_incubator.md)
- [Scripts using external libraries](Example_scripts_using_external_libraries.md)
- The [API reference](Reference.md) gives very simple example of most of the methods in the API
- The [scripting examples section](examples/scripting_examples) has a couple of scripts. But, this section is still in initial stages

Repositories
- By Macmarrum: [the script repository](https://github.com/macmarrum/freeplane-scripting/tree/main/src/scripts) and other [repositories](https://github.com/macmarrum?tab=repositories)
- The EdoFro [repositories](https://github.com/EdoFro)

The forums. There are many scripts spread over the two forums. Searching for the word "script" will return many of them.
- Github forum (current forum)
- Sourceforge forum (old forum)

4 changes: 2 additions & 2 deletions src/docs/scripting/Formulas.md
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ What do you think, do we need implementations for functions like NOW(), SECOND()
## Further reads

* most important: [Scripting API](Scripting_API.md)
* [Scripting](Scripting.md)
* [Scripting](../Learning%20Guides/Scripting.md)
* [Scripting_environment_setup](Scripting_environment_setup.md)

## Example Maps
Expand All @@ -225,5 +225,5 @@ What do you think, do we need implementations for functions like NOW(), SECOND()
## Videos

* [Expense Reporting in Freeplane](http://www.youtube.com/watch?v=qym9pG3AP4E)
<!-- ({Category:Documentation})({Category:Script}) -->
<!-- ({Category:Documentation})({Category:Advanced Topics}) -->

File renamed without changes.
5 changes: 5 additions & 0 deletions src/docs/scripting/Learning_guide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@

If you want to learn the basics about how to create scripts, even if you are a complete beginner in coding, you can follow this suggested learning path:

- Start with this gentle tutorial that uses many practical examples: [Tutorial](api-groovy-tutorial.md)
- Now that you are more familiar with the general idea of how scripts work, you can use this concise guide for revision and reference of the important points: [Scripting concise guide](Scripting.md)
File renamed without changes.
9 changes: 9 additions & 0 deletions src/docs/scripting/References_and_Cheatsheet.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
In the [Scripting API](Scripting_API.md) you will find all public methods that can be used in scripts.

If you are not sure about how a method needs to be written, you can see examples of each method at this [reference page](Reference.md).

For a quick reference, use the [Cheatsheet](Scripting_Cheatsheet.md).

---
Other pages, that are planned:
- [Basics](Basics.md)
4 changes: 2 additions & 2 deletions src/docs/scripting/Scripting.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Freeplane's builtin functionality can be extended by [Groovy](http://groovy-lang
With Freeplane scripting you can

* write your own functions and use them from the menu or via keyboard shortcuts,
* use [formulas](Formulas.md) in your map to compute stuff like in Excel, and
* use [formulas](../Other%20Topics/Formulas.md) in your map to compute stuff like in Excel, and
* create [add-ons](../getting-started/Add-ons_(install).md) to share it with other users,
* have [init scripts](Init_scripts.md) executed on startup that changes Freeplane's behavior (since Freeplane 1.5).

Expand Down Expand Up @@ -205,7 +205,7 @@ Note: For built-in icons, the icon name is the same as the corresponding graphic

## Formulas

Starting with Freeplane 1.2 one use scripts as [Formulas](Formulas.md) directly in the node core like in Excel. Type this formula in the node core:
Starting with Freeplane 1.2 one use scripts as [Formulas](../Other%20Topics/Formulas.md) directly in the node core like in Excel. Type this formula in the node core:

```groovy
= "Icons: " + node.icons.icons
Expand Down
File renamed without changes.
Loading

0 comments on commit 297b215

Please sign in to comment.