Code Monkey home page Code Monkey logo

tw5-mermaid's Introduction

See a demo video of this plugin on YouTube.

Installation

Open the hosted plugin site alongside your wiki. On the sidebar under "Plugins," find this plugin ("Edit and manage Mermaid.js tiddlers") and drag-and-drop to your wiki, then refresh for the plugin to work.

Motivation

The idea of markdown is to allow a nicely rendered output from easy and self-descriptive syntax. Mermaid.js extends this concept to a variety of diagrams. This plugin wraps the Mermaid Live Editor to make it easy to edit and maintain Mermaid code in your wiki while displaying the rendered output, all within a very lightweight implementation.

Internet Required

One limitation of this implementation is that internet connection is required since the rendered display is pulled from the Mermaid online service. More limitations are discussed below.

Alternatives

  • Use Mermaid Live Editor directly - this plugin embraces the Live Editor and the suggested workflow allows for moving smoothly between the in-wiki editor and Live Editor as needed
  • Mermaid.js installation within TW5 - this is the most controlled and customizable option. In my experience, the negatives are that the plugin is large (>1MB) and Mermaid rendering could be bit buggy within TW5 and/or sometimes wouldn't play nicely with other plugins.
    • My other critique is that the plugins I found were not actively maintained or were difficult to access for installation. https://efurlanm.github.io/mermaid-tw5 seems to have addressed at least the latter.

Suggested Workflow

The Mermaid Editor tiddler is used to create and edit diagram tiddlers. These tiddlers contain the Mermaid syntax in fields and display the rendered result as an SVG; from here they may be transcluded as needed. The diagram display also include a link to open the Editor to edit the diagram.

The Mermaid Editor tiddler is thus the center of the workflow for creating or editing diagrams.

  • Syntax is entered in the text box and this can be rendered automatically as you type (by checking "auto sync") or with manual refreshes.
  • Diagram theme can also be edited by selecting from a standard "Theme" drop-down, or by adding themeVariables as an Advanced option.
  • At any point, the current content being edited can be opened on Mermaid Live Editor via a simple link. The Mermaid Editor also allows you to paste the Mermaid Live Editor URL, which it will parse back into the wiki for you to save or continue editing diagram tiddlers.

Limitations

  • Requires internet to render diagram images, regardless of editing or viewing.
  • This plugin wraps and is totally dependent on Mermaid Live service for rendering images. Mermaid Live Editor can itself be finnicky at times.
  • While the wrapper of Mermaid Live is fairly generic, it does not wrap the full Mermaid API but only codetheme, and themeVariables to simplify complexity; anything beyond that may not be supported. If you would like to see additional features, please open an issue.

Acknowledgements

tw5-mermaid's People

Contributors

jasonmhoule avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.