-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.rb
40 lines (30 loc) · 1.06 KB
/
init.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
require 'redmine'
Redmine::Plugin.register :redmine_wiki_astah do
name 'astah* Wiki-macro plugin'
author 'tckz'
description 'Embed image of the diagram which is described by astah*'
version '0.4.0'
requires_redmine :version_or_higher => '3.0.0'
url "http://passing.breeze.cc/mt/"
settings :default => {
"secret" => "specify some random text",
}, :partial => 'wiki_astah/settings'
Redmine::WikiFormatting::Macros.register do
desc <<'EOF'
Embed image which is exported from the diagram which is described by astah*.
!{{astah_diagram(asta=public:foo.asta, namespace/diagram)}}
!{{astah_diagram(asta=source:/repo/path/foo.asta, namespace/diagram)}}
!{{astah_diagram(option=value...,asta=public:foo.asta, namespace/diagram)}}
* options are:
** target={_blank|any}
** align=value(e.g. {right|left})
** width=value(e.g. 100px, 200%)
** height=value(e.g. 100px, 200%)
EOF
macro :astah_diagram do |wiki_content_obj, args|
m = WikiAstahHelper::Macro.new(self, wiki_content_obj)
m.astah_diagram(args).html_safe
end
end
end
# vim: set ts=2 sw=2 sts=2: