Skip to content
Wiki macro for redmine. The macro render graph-image from wiki contents as dot.
Ruby HTML CSS
Pull request Compare This branch is 23 commits behind master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
app
assets/stylesheets
config
lang
test
.gitignore
COPYRIGHT.txt
GPL.txt
README.rdoc
Rakefile
init.rb

README.rdoc

Redmine Wiki Graphviz-macro plugin

Redmine Wiki Graphviz-macro plugin will allow Redmine's wiki to render graph image.

Features

  • Add wiki macro {{graphviz}} and {{graphviz_me}}

  • Write wiki page as dot format, and the macros make it graph image.

{{graphviz}} macro

  • This macro render graph image from other wiki page's content.

    {{graphviz(Foo)}}
    {{graphviz(option=value,Foo)}}
    {{graphviz(layout=neato,target=_blank,with_source,Foo)}}
  • format={png|jpg}

  • layout={dot|neato|fdp|twopi|circo}

  • target={_blank|any}

  • with_source : Display both image and its source(dot)

  • no_map : Disable clickable map.

  • wiki=page : Link image to specified wiki page.

  • link_to_image : Link image to itself.

  • align=value : Additional attr for IMG.

    e.g.) right, left
  • width=value : Additional attr for IMG.

    It is recommended to use no_map option together.
    e.g.) 100px, 200%
  • height=value : Additional attr for IMG.

    It is recommended to use no_map option together.
    e.g.) 100px, 200%

{{graphviz_me}} macro

  • This macro render graph image from the wiki page which includes this macro.

  • Use this macro *commented out* like below. If it is not commented out, renderer fails syntax error.

    // {{graphviz_me()}}
    // {{graphviz_me(option=value)}}
  • options: See graphviz macro.

  • When previewing, this macro output the image into img@src with data scheme. Thus, old browsers can't render it.

Tips

  • On Windows, If you want to use the text which is NOT written in English(Such as Japanese) in the graph, You should specify “fontname” attribute to the object like below.

    somenode [label=“some text in Japanese”, fontname=“MS Gothic”]

    NOTE: “MS Gothic” is just example. You should specify it using real font name. “MS”(ZENAKU) + HANKAKU White space + “Gothic”(ZENAKU KATAKANA)

Requirement

  • Redmine 2.1.0 or later.

  • ruby 1.9

  • Graphviz www.graphviz.org

    • There are 2ways about setting up graphviz for this plugin.

    • The one is using Gv which is ruby binding of graphviz.

      • Recommended for unix system.

* The plugin uses fork() and IO.pipe to capture STDERR which holds error message output from Gv.

* The other one is using external dot command which is on the PATH.
  * For Windows system, Only this way of setting is available.

* The dot command is executed twice by the plugin when one graph is rendered. First one to render the image. Second one to create clickable map.

* Example of installed graphviz package.

  e.g.) CentOS 5.5 using Gv.
    graphviz-2.26.3-1.el5
    graphviz-gd-2.26.3-1.el5
    graphviz-ruby-2.26.3-1.el5
  e.g.) Ubuntu (10.04) using Gv.
    graphviz
    graphviz-dev
    libgv-ruby
  e.g.) Windows XP Pro SP3(ja) using external dot command.
    graphviz-2.26.3
  • memcached (optional)

Getting the plugin

github.com/tckz/redmine-wiki_graphviz_plugin

e.g.) git clone git@github.com:tckz/redmine-wiki_graphviz_plugin.git wiki_graphviz_plugin

Install

  1. Copy the plugin tree into #{RAILS_ROOT}/plugins/

    e.g.)
    #{RAILS_ROOT}/plugins/
        wiki_graphviz_plugin/
  2. Make sure the temporary directory writable by the process of redmine.

    #{RAILS_ROOT}/tmp/

    This plugin try to create follwing directory and create tmporary file under it.

    #{RAILS_ROOT}/tmp/wiki_graphviz_plugin/
  3. Restart Redmine.

Optional

  • If you want to use caching feature for rendered images, must configure your cache_store.

  • This plugin expects the store like ActiveSupport::Cache::MemCacheStore which provides marshaling when set/get the value.

  1. Setup caching environment, like memcached.

  2. Configure cache_store.

    e.g.) config/environments/production.rb
    config.action_controller.perform_caching = true
    config.action_controller.cache_store = :mem_cache_store, "localhost"
  3. Restart Redmine.

  4. Login to Redmine as an Administrator.

  5. Setup wiki graphviz-macro settings in the Plugin settings panel.

License

This plugin is licensed under the GNU GPL v2. See COPYRIGHT.txt and GPL.txt for details.

My environment

  • CentOS 6.3 x64

  • ruby-1.9.3p194

  • mysql-server-5.1.61-4.el6.x86_64

  • graphviz-2.26.0-7.el6.x86_64

  • redmine-2.1.0

Something went wrong with that request. Please try again.