Code Monkey home page Code Monkey logo

plantuml-markdown's Introduction

This plugin implements a block extension which can be used to specify a PlantUML diagram which will be converted into an image and inserted in the document.

Syntax:

    ::uml:: [format="png|svg"] [classes="class1 class2 ..."] [alt="text for alt"]
      PlantUML script diagram
    ::end-uml::

Example:

    ::uml:: format="png" classes="uml myDiagram" alt="My super diagram"
      Goofy ->  MickeyMouse: calls
      Goofy <-- MickeyMouse: responds
    ::end-uml::

Options are optional, but if present must be specified in the order format, classes, alt. The option value may be enclosed in single or double quotes.

Installation

You need to install PlantUML (see the site for details) and Graphviz 2.26.3 or later. The plugin expects a program plantuml in the classpath. If not installed by your package manager, you can create a shell script and place it somewhere in the classpath. For example, save te following into /usr/local/bin/plantuml (supposing PlantUML installed into /opt/plantuml):

    #!/bin/bash
    java -jar /opt/plantuml/plantuml.jar ${@}

For Gentoo Linux there is an ebuild at http://gpo.zugaina.org/dev-util/plantuml/RDep: you can download the ebuild and the files subfolder or you can add the zugaina repository with layman (reccomended).

To use the plugin with Python-Markdown you have two choices:

  • copy the file plantuml.py in the extensions folder of Python-Markdown. For example, for Python 2.7 you must do:

    $ sudo cp plantuml.py /usr/lib/python27/site-packages/markdown/extensions/
  • copy the file somewhere in your home. A good choice may be the user-site path, for example (bash syntax):

    $ export INSTALLPATH="`python -m site --user-site`/plantuml-markdown"
    $ mkdir -p "$INSTALLPATH"
    $ cp plantuml.py "$INSTALLPATH/mdx_plantuml.py"
    $ export PYTHONPATH="$INSTALLPATH"

    You must export PYTHONPATH before running markdown_py, or you can put the definition in ~/.bashrc.

After installed, you can use this plugin by activating it in the markdownm_py command. For example:

markdown_py -x plantuml mydoc.md > out.html

plantuml-markdown's People

Watchers

 avatar  avatar  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.