Table of Contents
NetLogo Plugin
Compatible with DokuWiki
Angua, Adora Belle, Weatherwax, 2016-06-26a
This extension has not been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues.
Similar to applet
NetLogo is a multi-agent programmable modeling environment. It is used by tens of thousands of students, teachers and researchers worldwide. It is authored by Uri Wilensky and developed at the CCL. You can download it free of charge. NetLogo Web is a version of the NetLogo modeling environment that runs entirely in the browser.
The NetLogo plugin for DokuWiki allows wiki editors to embed NetLogo models directly in their pages.
Installation
Search and install the plugin using the Extension Manager. Refer to Plugins on how to install plugins manually.
Examples/Usage
See an implementation of Conway's Game of Life for a demonstration of this plugin in action.
Syntax
Basic syntax
You can include externally hosted .nlogo
files with curly brackets, similar to internal images but with full URL. Optionally you can specify their size. For example, if life-web.nlogo has been uploaded to a GitHub repository, then the following commands will embed the model in a wiki page:
Real size: {{https://rawgit.com/rikblok/NetLogo-models/master/life-web.nlogo}} Resize to given width: {{https://rawgit.com/rikblok/NetLogo-models/master/life-web.nlogo?500}} Resize to given width and height: {{https://rawgit.com/rikblok/NetLogo-models/master/life-web.nlogo?800x500}}
Note that NetLogo models may not present properly if resized to smaller than their default size.
By using left or right whitespaces you can choose the alignment.
Right: (Not currently working.) Left: {{https://rawgit.com/rikblok/NetLogo-models/master/life-web.nlogo }} Center: {{ https://rawgit.com/rikblok/NetLogo-models/master/life-web.nlogo }}
Unlike images and other media files, titles are not allowed. If a title is included a download link will be presented instead:
{{https://rawgit.com/rikblok/NetLogo-models/master/life-web.nlogo|Click to download}}
An empty title is allowed, however, for compatibility with the default format of the “Add Images and other files” toolbar button. For example,
{{https://rawgit.com/rikblok/NetLogo-models/master/life-web.nlogo|}}
will execute the model.
Advanced syntax
Instead of adding a title to create a download link, you may add a ?do=download
parameter to the link, such as
{{https://rawgit.com/rikblok/NetLogo-models/master/life-web.nlogo?do=download}}
You may want to present the source code to the file directly in the wiki page. To do so add ?do=code
to the link:
{{https://rawgit.com/rikblok/NetLogo-models/master/life-web.nlogo?do=code}}
Currently, the raw code is simply wrapped in a code block. The author hopes to enable syntax highlighting in the future.
NetLogo allows extra information to be added in a “Info” tab. To present this information in a wiki page add ?do=info
to the link:
{{https://rawgit.com/rikblok/NetLogo-models/master/life-web.nlogo?do=info}}
The text is presented without any formatting. To render so that headers, links, and other formatting are displayed correctly install the plugin:markdownextra plugin and use ?do=mdinfo
instead:
{{https://rawgit.com/rikblok/NetLogo-models/master/life-web.nlogo?do=mdinfo}}
Configuration and Settings
None at this time.
Development
How it works
Direct linking
This plugin requires direct linking to the raw .nlogo
file. Unfortunately, this excludes DokuWiki media files (with default configuration settings). So the .nlogo
file needs to be uploaded to an external server that serves raw files directly, such as GitHub's RawGit server.
Applet size
How big should the model be on the page? The user can specify with parameters but if not specified it reads the .nlogo
file and finds the positions of all the interface elements. It reserves space to fit them all. This might not work if you have unusual zoom settings in your browser. Then you may want to manually set the size using the size parameters (see Basic Syntax).
Change Log
- switched to https (secure) netlogoweb.org (2018-07-28 07:21)
- update plugin.info.txt (2017-01-22 05:00)
- Merge pull request #1 from splitbrain-forks/php7-signature (2016-12-17 06:42)
- fix: remove urlencode() (2016-11-28 06:47)
- fix: remove resolve_mediaid() (2016-11-28 06:45)
- only remote .nlogo files supported (2016-11-28 06:41)
Known Bugs and Issues
See issues on GitHub.
ToDo/Wish List
This plugin is intended only as a proof-of-concept. Others are encouraged to fork this plugin and develop it further. Please send a pull request to the master branch on significant improvements.
Here are some improvements the author hopes to see implemented:
- The
?do=code
option should apply syntax highlighting.