DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:mermaid

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
Last revisionBoth sides next revision
plugin:mermaid [2023-07-07 13:51] robertweinmeisterplugin:mermaid [2023-11-17 14:48] – Update for version 10.6 robertweinmeister
Line 6: Line 6:
 email      : develop@weinmeister.org email      : develop@weinmeister.org
 type       : syntax type       : syntax
-lastupdate : 2023-07-07+lastupdate : 2023-11-17
 compatible : Greebo, Hogfather, Igor, Jack Jackrum+ compatible : Greebo, Hogfather, Igor, Jack Jackrum+
 depends    :  depends    : 
Line 13: Line 13:
 tags       : mermaid, diagram, flowchart, graph, sequence tags       : mermaid, diagram, flowchart, graph, sequence
  
-downloadurl: https://github.com/RobertWeinmeister/dokuwiki-mermaid/releases/download/v10.2b/dokuwiki-mermaid-10.2b.zip+downloadurl: https://github.com/RobertWeinmeister/dokuwiki-mermaid/releases/download/v10.6/dokuwiki-mermaid-10.6.zip
 bugtracker : https://github.com/RobertWeinmeister/dokuwiki-mermaid/issues bugtracker : https://github.com/RobertWeinmeister/dokuwiki-mermaid/issues
 sourcerepo : https://github.com/RobertWeinmeister/dokuwiki-mermaid sourcerepo : https://github.com/RobertWeinmeister/dokuwiki-mermaid
Line 28: Line 28:
  
 ===== Examples/Usage ===== ===== Examples/Usage =====
 +
 +Provide the Mermaid code enclosed by the ''<mermaid>'' tags:
  
 <code> <code>
 <mermaid> <mermaid>
-graph TD +  graph TD 
-    A-->B +    A(**mermaid**)-->B((__plugin__)) 
-    A-->C +    A-->C(((//for//))) 
-    B-->D+    B-->D[["[[https://www.dokuwiki.org/dokuwiki|Dokuwiki]]"]]
     C-->D     C-->D
 </mermaid> </mermaid>
Line 64: Line 66:
 ''#Content'' specifies the code that gets passed on to Mermaid for rendering. ''#Width'' and ''#Height'' are optional parameters and are used to specify the size of the container of the diagram. They can take any value supported by CSS, for example ''%%<mermaid 100% 1cm>%%''. Default value is ''auto''. ''#Content'' specifies the code that gets passed on to Mermaid for rendering. ''#Width'' and ''#Height'' are optional parameters and are used to specify the size of the container of the diagram. They can take any value supported by CSS, for example ''%%<mermaid 100% 1cm>%%''. Default value is ''auto''.
  
-For more examples and details on the mermaid syntax, see https://mermaid.js.org/intro/.+For more examples and details on the syntax, see [[https://mermaid.js.org/intro/]]. 
 + 
 +===== Raw Mode ===== 
 + 
 +If needed, the Mermaid code can be passed on without any processing or rendering by DokuWiki. Insert a line containing only the word raw before the Mermaid code: 
 + 
 +    <mermaid> 
 +      raw 
 +      graph TD 
 +        A(**mermaid**)-->B((__plugin__)) 
 +        A-->C(((//for//))) 
 +        B-->D[["[[https://www.dokuwiki.org/dokuwiki|Dokuwiki]]"]] 
 +        C-->D 
 +    </mermaid> 
 + 
 +This allows to use the full feature set of Mermaid without interference from DokuWiki, albeit at the expanse of not being able to use any functionality provided by DokuWiki.
  
 ===== Configuration and Settings ===== ===== Configuration and Settings =====
Line 73: Line 90:
   * the remotely hosted, currently available, latest version   * the remotely hosted, currently available, latest version
   * a remotely hosted specific version   * a remotely hosted specific version
 +
 +===== Known Problems =====
 +
 +The syntax of Mermaid and DokuWiki can clash in rare cases. If you encounter problems, feel free to report them and open an issue.
 +
 +You can sidestep these problems by using the [[plugin:mermaid#raw_mode|raw mode]] which disables the processing by DokuWiki, or adjust your Mermaid code as shown below.
 +
 +==== Usage of Brackets ====
 +
 +Mermaid and DokuWiki both use brackets. If you need to use them both at the same time, make your intentions clear by using quotation marks like:
 +<code>["[[link]]"]</code>
 +
 +==== Binding Click Events ====
 +
 +Mermaid supports the [[https://mermaid.js.org/syntax/flowchart.html#interaction|binding of click events]]. This can and will clash with DokuWikis own handling of links. Instead of:
 +
 +    <mermaid>
 +      flowchart TD
 +        A[Link]
 +        click A "https://www.github.com"
 +    </mermaid>
 +
 +please use
 +
 +    <mermaid>
 +      flowchart TD
 +        A["[[https://www.github.com|Link]]"]
 +    </mermaid>
  
 ===== Development ===== ===== Development =====
  
 In the file ''action.php'', change the ''logLevel'' of Mermaid to ''debug'' for easier debugging by setting ''MERMAIDLOGLEVEL'' to ''debug''. In the file ''action.php'', change the ''logLevel'' of Mermaid to ''debug'' for easier debugging by setting ''MERMAIDLOGLEVEL'' to ''debug''.
 +
 +===== License =====
 +
 +This project is licensed under the GNU General Public License v2.0, included as LICENSE.
 +
 +Mermaid is licensed under the MIT License, included as LICENSE Mermaid.
  
 ===== Change Log ===== ===== Change Log =====
  
 +  * **2023-11-17**
 +    * Update to support the new Mermaid version 10.6
 +  * **2023-09-04**
 +    * Added raw mode
 +    * Update to support the new Mermaid version 10.4
 +  * **2023-07-21**
 +    * Bug fix: Double brackets are now supported
   * **2023-07-07**   * **2023-07-07**
-    * Bug fix+    * Bug fix: Elk renderer now working for all versions
   * **2023-07-04**   * **2023-07-04**
     * Update to support the new Mermaid version 10.2      * Update to support the new Mermaid version 10.2 
plugin/mermaid.txt · Last modified: 2024-02-15 23:08 by robertweinmeister

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