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
plugin:mermaid [2023-07-17 14:16] 45.9.85.254plugin:mermaid [2024-02-15 23:08] (current) – Update for version 10.8 robertweinmeister
Line 6: Line 6:
 email      : develop@weinmeister.org email      : develop@weinmeister.org
 type       : syntax type       : syntax
-lastupdate : 2023-07-07 +lastupdate : 2024-02-15 
-compatible : Hogfather, Igor, Jack Jackrum++compatible : Greebo, Hogfather, Igor, Jack Jackrum, Kaos+
 depends    :  depends    : 
 conflicts  conflicts 
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.8/dokuwiki-mermaid-10.8.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 =====
  
-There is only one setting. You can choose which Mermaid version you want to use:+No further configuration is required. 
 + 
 +==== Version and Location ==== 
 + 
 +You can choose which Mermaid version you want to use:
  
   * the locally hosted version   * the locally hosted version
   * the remotely hosted, currently available, latest version   * the remotely hosted, currently available, latest version
   * a remotely hosted specific version   * a remotely hosted specific version
 +
 +==== Default theme ====
 +
 +You can choose which Mermaid theme should be used as a default. The available themes are the five [[https://mermaid.js.org/config/theming.html#available-themes|integrated themes of Mermaid]].
 +
 +===== 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>
 +
 +==== DokuWiki Search Highlight ====
 +
 +The search highlight of the DokuWiki search can prevent the proper parsing of the diagram, leading to an error. For that reason, it is disabled for the Mermaid diagrams. The search itself is not affected.
  
 ===== 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 =====
  
 +  * **2024-02-15**
 +    * Update to support the new Mermaid version 10.8
 +    * Adds option to set site-wide default theme
 +    * Fixes a possible problem due to the DokuWiki search highlight
 +  * **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.1689596215.txt.gz · Last modified: 2023-07-17 14:16 by 45.9.85.254

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