Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision |
blog:2020-11-08:geogebra_plugin [2020/11/08 09:23] – va7fi | blog:2020-11-08:geogebra_plugin [2020/11/09 15:01] – va7fi |
---|
====== Geogebra Plugin ====== | ====== Geogebra Plugin ====== |
[[https://www.geogebra.org/ |Geogebra]] is a graphing and geometry tool I've been using since my teaching days. I always found it to be very useful to display concepts that are hard to visualize on a static page. It is a lot more than a simple animation since people can interact with it and move things around. | [[https://www.geogebra.org/ |Geogebra]] is a graphing and geometry tool I've been using since my teaching days. I always found it to be very useful to display concepts that are hard to visualize on a static page. However, it is a lot more than a simple animation since people can interact with it and move things around. |
| |
In the past, I had to export Geogbra files to html5 to embed them, but the process was pretty clunky and time consuming. I searched the Dokuwiki plugins but all the ones listed are too old and don't work anymore. Finally, I created my own using some general instructions for [[https://wiki.geogebra.org/en/Reference:GeoGebra_Apps_Embedding |embedding Geogebra files]]. This is my first plugin and a bit of a cheat: I basically took the existing [[https://www.dokuwiki.org/plugin:color |Color plugin]] which is pretty simple, studied it to learn a bit of the syntax and modified it until it did what I needed. However, there's still a lot of code that I don't really understand and a few features that are missing. | In the past, I had to export Geogbra files to html5 to embed them, but the process was pretty clunky and time consuming. I searched the Dokuwiki plugins but all the ones listed are too old and don't work anymore. Finally, I created my own using some general instructions for [[https://wiki.geogebra.org/en/Reference:GeoGebra_Apps_Embedding |embedding Geogebra files]]. This is my first plugin and a bit of a cheat: I basically took the existing [[https://www.dokuwiki.org/plugin:color |Color plugin]] which is pretty simple, studied it to learn a bit of the syntax and modified it until it did what I needed. However, there's still a lot of code that I don't really understand and a few features that are missing. |
Here's how to installed it: | Here's how to installed it: |
<hidden> | <hidden> |
* Add the following three files in the wiki folder: ''./lib/plugins/ggb/'' | * Add the following three files in the wiki folder: ''./lib/plugins/ggb2/'' |
* ''manager.dat''<code> | * ''manager.dat''<code> |
installed=Sun, 08 Nov 2020 08:20:00 -0800</code> | installed=Sun, 08 Nov 2020 08:20:00 -0800</code> |
* ''plugin.info.txt''<code> | * ''plugin.info.txt''<code> |
base ggb | base ggb2 |
author Patrick Truchon | author Patrick Truchon |
email patoo@rbox.me | email patoo@rbox.me |
date 2020-11-08 | date 2020-11-08 |
name geogebra6 syntax plugin | name geogebra6 syntax plugin |
desc Include GeoGebra6 files into Dokuwiki</code> | desc Embeds GeoGebra 6 files into Dokuwiki</code> |
* ''syntax.php''<code php> | * ''syntax.php''<code php> |
<?php | <?php |
/** | /** |
* Plugin ggb: Embeds Geogebra files into Dokuwiki. | * Plugin ggb2: Embeds Geogebra files into Dokuwiki. |
* | * |
* @license GPL 3 (http://www.gnu.org/licenses/gpl.html) | * @license GPL 3 (http://www.gnu.org/licenses/gpl.html) |
* need to inherit from this class | * need to inherit from this class |
*/ | */ |
class syntax_plugin_ggb extends DokuWiki_Syntax_Plugin { | class syntax_plugin_ggb2 extends DokuWiki_Syntax_Plugin { |
| |
function getType(){ return 'substition'; } | function getType(){ return 'substition'; } |
function getSort(){ return 306; } | function getSort(){ return 306; } |
function connectTo($mode) { $this->Lexer->addSpecialPattern('{{ggb>.*?}}',$mode,'plugin_ggb'); } | function connectTo($mode) { $this->Lexer->addSpecialPattern('{{ggb>.*?}}',$mode,'plugin_ggb2'); } |
| |
| |