DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:netlogo

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
plugin:netlogo [2012-10-27 04:54] – [Installation] rikblokplugin:netlogo [2018-07-28 07:30] (current) – all links https rikblok
Line 2: Line 2:
  
 ---- plugin ---- ---- plugin ----
-description: Embed a NetLogo applet in your DokuWiki page.+description: Embed a NetLogo Web model in your DokuWiki page.
 author     : Rik Blok  author     : Rik Blok 
 email      : rik.blok@ubc.ca  email      : rik.blok@ubc.ca 
 type       : syntax type       : syntax
-lastupdate : 2012-10-20 +lastupdate : 2018-07-27 
-compatible : Angua, Adora Belle+compatible : Angua, Adora Belle, Weatherwax, 2016-06-26a
 depends    :  depends    : 
 conflicts  conflicts 
Line 13: Line 13:
 tags       : applet, programming tags       : applet, programming
  
-downloadurl: http://github.com/rikblok/dokuwiki-plugin-netlogo/zipball/master +downloadurl: https://github.com/rikblok/dokuwiki-plugin-netlogo/zipball/master 
-bugtracker : http://github.com/rikblok/dokuwiki-plugin-netlogo/issues +bugtracker : https://github.com/rikblok/dokuwiki-plugin-netlogo/issues 
-sourcerepo : http://github.com/rikblok/dokuwiki-plugin-netlogo/+sourcerepo : https://github.com/rikblok/dokuwiki-plugin-netlogo/
 donationurl:  donationurl: 
 ---- ----
  
-[[http://ccl.northwestern.edu/netlogo/|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 [[http://ccl.northwestern.edu/uri/|Uri Wilensky]] and developed at the [[http://ccl.northwestern.edu/|CCL]]. You can download it free of charge.+[[https://ccl.northwestern.edu/netlogo/|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 [[https://ccl.northwestern.edu/uri/|Uri Wilensky]] and developed at the [[https://ccl.northwestern.edu/|CCL]]. You can download it free of charge.  [[https://www.netlogoweb.org/|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.
  
-The NetLogo plugin for DokuWiki allows wiki editors to embed NetLogo applets in their pages.  When NetLogo files (with extension ''.nlogo'') are uploaded to the server and [[:syntax#images_and_other_files|included in a page as media]] this plugin executes the file in the NetLogo Java applet.((Your browser must be configured to run Java.)) 
  
 ===== Installation ===== ===== Installation =====
  
-This plugin will embed ''.nlogo'' files uploaded to your DokuWiki server.  To allow upload you must add the following line to ''conf/mime.local.conf'' +Search and install the plugin using the [[plugin:extension|Extension Manager]]. Refer to [[:Plugins]] on how to install plugins manually.
-  nlogo    !application/octet-stream +
-   +
-:!: **External requirements:** This plugin requires that the user has [[http://www.java.com/|Java]] installed to run the applet.+
  
-Install the plugin using the [[plugin:plugin|Plugin Manager]] and the download URL above, which points to latest version of the plugin. Refer to [[:Plugins]] on how to install plugins manually. 
  
 ===== Examples/Usage ===== ===== Examples/Usage =====
  
-See an implementation of [[http://www.zoology.ubc.ca/~rikblok/wiki/doku.php?id=science:conway_s_game_of_life:start|Conway's Game of Life]] for a demonstration of this plugin in action.+See an implementation of [[https://www.zoology.ubc.ca/~rikblok/wiki/doku.php?id=science:popmod:conway_s_game_of_life:start|Conway's Game of Life]] for a demonstration of this plugin in action. 
  
 ===== Syntax ===== ===== Syntax =====
 +
  
 ==== Basic syntax ==== ==== Basic syntax ====
  
-You can include uploaded ''.nlogo'' files with curly brackets, similar to [[:syntax#images_and_other_files|internal images]]. Optionally you can specify the size of them.  If a user has uploaded ''applet.nlogo'' to the current namespace, the following are valid syntax:+You can include externally hosted ''.nlogo'' files with curly brackets, similar to [[:wiki:syntax#images_and_other_files|internal images]] but with full URL. Optionally you can specify their size.  For example, if [[https://github.com/rikblok/NetLogo-models/blob/master/life-web.nlogo|life-web.nlogo]] has been uploaded to a [[https://github.com|GitHub]] repositorythen the following commands will embed the model in a wiki page:
  
-  Real size:                        {{applet.nlogo}} +  Real size:                        {{https://rawgit.com/rikblok/NetLogo-models/master/life-web.nlogo}} 
-  Resize to given width:            {{applet.nlogo?500}} +  Resize to given width:            {{https://rawgit.com/rikblok/NetLogo-models/master/life-web.nlogo?500}} 
-  Resize to given width and height: {{applet.nlogo?800x500}}+  Resize to given width and height: {{https://rawgit.com/rikblok/NetLogo-models/master/life-web.nlogo?800x500}}
      
-Note that NetLogo applets may not present properly if resized to smaller than their default size.+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. By using left or right whitespaces you can choose the alignment.
  
-  Right:  {{ applet.png}}  +  Right:  (Not currently working.) 
-  Left:   {{applet.png }} +  Left:   {{https://rawgit.com/rikblok/NetLogo-models/master/life-web.nlogo }} 
-  Center: {{ applet.png }} +  Center: {{ https://rawgit.com/rikblok/NetLogo-models/master/life-web.nlogo }}
- +
-Only files on the current server, uploaded to the DokuWiki media folder are permitted. The NetLogo plugin respects [[:acl|ACLs]]: an applet will only be executed if the viewer has permission to read the file.  Otherwise an error message is displayed.+
  
 Unlike images and other media files, titles are not allowed.  If a title is included a download link will be presented instead: Unlike images and other media files, titles are not allowed.  If a title is included a download link will be presented instead:
-  {{applet.nlogo|Click to download applet}}+  {{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 ==== ==== Advanced syntax ====
  
-Instead of adding a title to create a download link, you may add a ''?do=download'' parameter to the link.  The following are equivalent: +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}}
-  {{applet.nlogo|}} +
-  {{applet.nlogo?do=download}}+
      
-By default the ''.nlogo'' file determines the version of NetLogo executed.  You may override this behaviour by specifying your own version as a parameter in the link: 
- 
-  Centered without version:       {{ applet.nlogo }} 
-  Centered with version:          {{ applet.nlogo?version=5.0.3 }} 
-  Centered with size and version: {{ applet.nlogo?800x500&version=5.0.3 }} 
- 
 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: 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:
  
-  {{applet.nlogo?do=code}}+  {{https://rawgit.com/rikblok/NetLogo-models/master/life-web.nlogo?do=code}}
      
-Currently, the raw code is simply dumped to the page without formatting.  The author hopes to use [[:syntax#code_blocks|code blocks with syntax highlighting]] in the future.+Currently, the raw code is simply wrapped in a [[:wiki:syntax#code_blocks|code block]].  The author hopes to enable [[:wiki:syntax#syntax_highlighting|syntax highlighting]] in the future.
  
-NetLogo allow for extra information to be added in a "Info" tab.  To present this information add ''?do=info'' to the link:+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:
  
-  {{applet.nlogo?do=info}}+  {{https://rawgit.com/rikblok/NetLogo-models/master/life-web.nlogo?do=info}}
      
-Currently, the text is dumped to the page without formatting.  The author hopes to render the text (as markdown) in the future so that headers, links, and other formatting are correctly displayed.+The text is presented without any formatting.  To render so that headers, links, and other formatting are displayed correctly install the [[doku>plugin:markdownextra]] plugin and use ''?do=mdinfo'' instead: 
 + 
 +  {{https://rawgit.com/rikblok/NetLogo-models/master/life-web.nlogo?do=mdinfo}} 
  
 ===== Configuration and Settings ===== ===== Configuration and Settings =====
  
 None at this time. None at this time.
 +
  
 ===== Development ===== ===== Development =====
 +
  
 === How it works === === How it works ===
  
-The first and biggest challenge I had in developing this plugin was figuring out how to handle security.  I couldn't just allow the NetLogo applet to access the .nlogo file directly because: 
-  - It wouldn't work on most DokuWiki installs (direct file access is usually disabled), and 
-  - It wouldn't respect DokuWiki access permissions. 
-A user should only be able to run the file if he/she has permission to read it. 
  
-FIXME+== Direct linking ==
  
- --- [[user>rikblok|Rik Blok]] //2012/10/27 04:34//+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'[[https://rawgit.com/|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|Basic Syntax]]).
  
  
 === Change Log === === Change Log ===
  
-{{rss>http://github.com/rikblok/dokuwiki-plugin-netlogo/commits/master.atom 6 date}}+{{rss>https://github.com/rikblok/dokuwiki-plugin-netlogo/commits/master.atom 6 date}} 
  
 === Known Bugs and Issues === === Known Bugs and Issues ===
  
 See [[https://github.com/rikblok/dokuwiki-plugin-netlogo/issues | issues on GitHub]]. See [[https://github.com/rikblok/dokuwiki-plugin-netlogo/issues | issues on GitHub]].
 +
  
 === ToDo/Wish List === === ToDo/Wish List ===
Line 116: Line 117:
  
 Here are some improvements the author hopes to see implemented: Here are some improvements the author hopes to see implemented:
-  * The ''?do=info'' option should render the information.  Maybe using the [[plugin:markdown]] plugin? +  * The ''?do=code'' option should apply [[https://github.com/NetLogo/NetLogo/wiki/Syntax-highlighting|syntax highlighting]].
-  * The ''?do=code'' option should render the code, preferably with syntax highlighting. +
-  * Options (such as the applet download url) are hard-coded.  Should be moved to configuration. +
-  * Is it possible (and a good idea?) to automatically modify ''conf/mime.local.conf'' so the administrator doesn't have to fiddle with code to get this plugin working?+
  
  
plugin/netlogo.1351306478.txt.gz · Last modified: 2012-10-27 04:54 by rikblok

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki