DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:asciisvg

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:asciisvg [2011-06-23 16:44] – [plugin codes] atronoushplugin:asciisvg [2022-07-29 23:27] (current) Klap-in
Line 6: Line 6:
 email      : m.rahmani@aut.ac.ir email      : m.rahmani@aut.ac.ir
 type       : Syntax type       : Syntax
-lastupdate : 2008-08-05 +lastupdate : 2011-06-25 
-compatible : version 2010-11-07|version 2011-05-25|version 2011-05-25a(also compatible with older version 2009-05-08) +compatible : Lemming, Anteater, Rincewind
 depends    :  depends    : 
-conflicts masciimath+conflicts 
 similar    :  similar    : 
 tags       : media, images, diagram, svg tags       : media, images, diagram, svg
Line 171: Line 171:
 </code> </code>
  
-===== Usage/Syntax ===== 
-  * Make sure you have enabled ''Allow embedded HTML'' in DokuWiki ''Configuration Manager'' 
-<code> 
-  
- <html> 
- 
- <embed width="in pixels" height="in pixels" 
-  script='...ASCIIsvg commands...' 
- > 
- 
- </html> 
- 
-</code> 
- 
-This is the syntax for the tag that inserts the pictures on the wiki page. The ASCIIsvg commands are put between single quotes in the script attribute. The width and height are measured in pixels. For detailed discussion take a look at [[http://www.chapman.edu/~jipsen/svg/asciisvgcommands.html | ASCIIsvg commands]]. \\ 
-There are many examples under [[http://math.chapman.edu/cgi-bin/math.pl?ASCIIsvg_Gallery | ASCIIsvg Gallery]]. 
  
 ===== Samples ===== ===== Samples =====
Line 193: Line 177:
  
 == Example 1 == == Example 1 ==
-<code html+<code javascript
- +    <asvg 117/117
-<html+      
-<embed width="200" height="200" +    initPicture(-2.2,2.2,-2.2
-script=' initPicture(-1,6,-1,6+    line([-2,-2],[2,2]) 
- axes() +    marker = 'arrowdot' 
- a = [0,0] +    line([-2,2],[2,-2]) 
- b = [5,5] +      
- marker = "dot" +    </asvg>
- line(a,b) +
- text(a,"a",belowright) +
- text(b,"g",above) +
- text(b,"b",right) +
- text(b,"b",left) +
- text(b,"b",below) +
- text(b,"b",aboveleft) +
- text(b,"b",aboveright) +
- text(b,"b",belowleft) +
- text(b,"b",belowright) +
- stroke = "red" +
- path([a,[0,5],b,[5,0]]) +
- stroke = "green" +
- marker = "none" +
- curve([a,[.25,0],[.5,.5],[1,1],[1.5,1.5]]) +
- stroke = "blue" +
- circle([5,0],1) +
- ellipse([0,5],1,2+
- stroke = "purple" +
- rect([0,0],[2,2],null,.5,1+
- marker = "arrowdot" +
- line(a,[5,0])'> +
-</html>+
  
 </code> </code>
  
-See the result here [[http://people.web.psi.ch/geus/tiddly/asciisvgsample.html | Diagram 1]] (The diagram on the **left**).+
  
 == Example 2 == == Example 2 ==
  
-<code html+<code javascript
- +    <asvg 250/250
-<html+    initPicture(-1,6,-1,6
-<embed width="200" height="200" +     axes() 
-script='initPicture(-2,2+     a = [0,0] 
-axes() +     b [5,5] 
-a = 1 +     marker = 'dot' 
-stroke "blue" +     line(a,b) 
-update()'> +     text(a,'a',belowright) 
-<script> +     text(b,'g',above) 
-function update() { +     text(b,'b',right
-  plot(function (x){return a*x*x*x-x},"cubic"+     text(b,'b',left) 
-  setText(a,"aval"); +     text(b,'b',below) 
-} +     text(b,'b',aboveleft) 
-</script> +     text(b,'b',aboveright) 
- +     text(b,'b',belowleft) 
-</html> +     text(b,'b',belowright) 
 +     stroke = 'red' 
 +     path([a,[0,5],b,[5,0]]
 +     stroke = 'green' 
 +     marker = 'none' 
 +     curve([a,[.25,0],[.5,.5],[1,1],[1.5,1.5]]
 +     stroke = 'blue' 
 +     circle([5,0],1) 
 +     ellipse([0,5],1,2) 
 +     stroke = 'purple' 
 +     rect([0,0],[2,2],null,.5,1) 
 +     marker = 'arrowdot' 
 +     line(a,[5,0]) 
 +    </asvg>
 </code> </code>
  
-See the result here  [[http://people.web.psi.ch/geus/tiddly/asciisvgsample.html | Diagram 2]] (The diagram on the **right**). +  * More examples in [[http://math.chapman.edu/cgi-bin/math.pl?ASCIIsvg_Sandbox | ASCIIsvg sandbox]] 
- +  * Asciisvg in use, see this image: [[http://littlewikiplugins.codeplex.com/documentation|asciisvg in use]]
-More examples in [[http://math.chapman.edu/cgi-bin/math.pl?ASCIIsvg_Sandbox | ASCIIsvg sandbox]]+
  
 ===== ToDo ===== ===== ToDo =====
-  * The ASCIIsvg was implemented as a pseudo plugin here. It seems the plugin simply adds the ASCIIsvg.js into DokuWiki. It is better to add the script as a real plugin to support a syntax without enabling the embeded HTML. 
-  * The addition of ASCIIsvg.js into DokuWiki can be implemented in a more secure and safer way. 
   * Interested developers are invited to correct/modify the code to obey the DokuWiki rules. FIXME   * Interested developers are invited to correct/modify the code to obey the DokuWiki rules. FIXME
   * This plugin supports ASCIIsvg 1.2.7. The newer version is included in [[http://www1.chapman.edu/~jipsen/mathml/asciimath.html | ASCIIMatML]] and does not supported by this plugin :!:.   * This plugin supports ASCIIsvg 1.2.7. The newer version is included in [[http://www1.chapman.edu/~jipsen/mathml/asciimath.html | ASCIIMatML]] and does not supported by this plugin :!:.
  
 ===== Issues ===== ===== Issues =====
-  - It seems there is a minor conflict with [[plugin:indexmenu]]. When [[plugin:asciisvg]] is active the mouse right-click on the trees does not work. +    - There is a conflict with [[plugin:jsmath]]. When [[plugin:asciisvg]] is installed jsMath does not work anymore.
-  - There is a conflict with [[plugin:jsmath]]. When [[plugin:asciisvg]] is installed jsMath does not work anymore.+
  
 ===== Discussion ===== ===== Discussion =====
  
-It doesnt work with the newest Version it seems. Its 2009-02-14b. 
-I installed the newest plugin version, copied an example to a page but it doesnt show anything. FIXME 
plugin/asciisvg.1308840258.txt.gz · Last modified: 2011-06-23 16:44 by atronoush

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