drawio_dsl 0.8.4 → 0.8.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.builders/.data/shapes.json +18 -0
- data/.builders/.templates/basic/drawio_extensions.rb +2 -1
- data/.builders/.templates/basic/drawio_shapes.rb +1 -1
- data/.builders/blueprint/shapes.rb +2 -0
- data/.builders/generators/20-drawio-extensions.rb +1 -1
- data/.builders/generators/domain_diagram.rb +448 -15
- data/.builders/generators/parking-map.png +0 -0
- data/.builders/generators/parking_app.rb +110 -0
- data/.builders/generators/printspeak-architecture-generator.rb +15 -10
- data/.builders/generators/project-plan.rb +7 -4
- data/.builders/generators/sample_diagrams/20-styles.rb +2 -2
- data/.builders/generators/sample_diagrams/30-html-shapes.rb +36 -14
- data/.builders/generators/sample_diagrams/35-ids-and-arrows.rb +0 -2
- data/CHANGELOG.md +21 -0
- data/README.md +5 -3
- data/docs/domain-modal/domain_model.drawio +265 -0
- data/docs/domain-modal/domain_model.svg +3 -0
- data/docs/domain-modal/domain_model_custom.drawio +408 -0
- data/docs/domain-modal/domain_model_custom.svg +1 -0
- data/docs/domain-modal.md +9 -0
- data/docs/parking_app.drawio +25 -0
- data/docs/parking_app.svg +3 -0
- data/docs/printspeak-architecture-generator.drawio +31 -0
- data/docs/printspeak-architecture-generator.svg +3 -0
- data/docs/project-plan/project.drawio +63 -54
- data/docs/project-plan/project_done.svg +1 -1
- data/docs/project-plan/project_in_progress.svg +1 -1
- data/docs/project-plan/project_todo.svg +1 -1
- data/docs/samples/styles-glass.svg +1 -1
- data/docs/samples/styles-plain.svg +1 -1
- data/docs/samples/styles-rounded.svg +1 -1
- data/docs/samples/styles-shadow.svg +1 -1
- data/docs/samples/styles-sketch.svg +1 -1
- data/lib/drawio_dsl/configuration_shapes.rb +4 -0
- data/lib/drawio_dsl/dom_builder.rb +1 -1
- data/lib/drawio_dsl/dom_builder_shapes.rb +12 -0
- data/lib/drawio_dsl/drawio.rb +0 -19
- data/lib/drawio_dsl/drawio_extensions.rb +3 -2
- data/lib/drawio_dsl/drawio_extensions_active.rb +1 -1
- data/lib/drawio_dsl/drawio_page.rb +22 -0
- data/lib/drawio_dsl/drawio_shapes.rb +32 -20
- data/lib/drawio_dsl/formatters/base_formatter.rb +121 -1
- data/lib/drawio_dsl/formatters/html_builder.rb +40 -1
- data/lib/drawio_dsl/formatters/interface_formatter.rb +14 -2
- data/lib/drawio_dsl/formatters/klass_formatter.rb +14 -2
- data/lib/drawio_dsl/formatters/style_builder.rb +1 -1
- data/lib/drawio_dsl/schema/_.rb +2 -0
- data/lib/drawio_dsl/schema/shapes/db_json.rb +9 -0
- data/lib/drawio_dsl/schema/shapes/group.rb +9 -0
- data/lib/drawio_dsl/schema/shapes/shape.rb +2 -2
- data/lib/drawio_dsl/version.rb +1 -1
- data/lib/drawio_dsl/xml_builder.rb +1 -1
- data/lib/drawio_dsl.rb +1 -0
- data/package-lock.json +2 -2
- data/package.json +1 -1
- metadata +16 -4
- data/docs/domain.drawio +0 -31
- data/docs/domain_model.svg +0 -3
@@ -31,9 +31,11 @@ module DrawioDsl
|
|
31
31
|
:cross,
|
32
32
|
:envelop,
|
33
33
|
:database,
|
34
|
+
:db_json,
|
34
35
|
:diamond,
|
35
36
|
:document,
|
36
37
|
:ellipse,
|
38
|
+
:group,
|
37
39
|
:hexagon,
|
38
40
|
:interface,
|
39
41
|
:klass,
|
@@ -79,9 +81,11 @@ module DrawioDsl
|
|
79
81
|
cross: ShapeDefaults.new(type: :cross, x: 0, category: :element, y: 0, w: 50, h: 50, style_modifiers: 'verticalLabelPosition=bottom;verticalAlign=top;html=1;shape=mxgraph.basic.x'),
|
80
82
|
envelop: ShapeDefaults.new(type: :envelop, x: 0, category: :element, y: 0, w: 160, h: 100, style_modifiers: 'shape=message'),
|
81
83
|
database: ShapeDefaults.new(type: :database, x: 0, category: :element, y: 0, w: 160, h: 80, style_modifiers: 'shape=mxgraph.flowchart.database;strokeWidth=1'),
|
84
|
+
db_json: ShapeDefaults.new(type: :db_json, x: 0, category: :element, y: 0, w: 160, h: 40, style_modifiers: 'shape=mxgraph.flowchart.database;strokeWidth=1'),
|
82
85
|
diamond: ShapeDefaults.new(type: :diamond, x: 0, category: :element, y: 0, w: 100, h: 100, style_modifiers: 'rhombus'),
|
83
86
|
document: ShapeDefaults.new(type: :document, x: 0, category: :element, y: 0, w: 160, h: 160, style_modifiers: 'shape=mxgraph.basic.document'),
|
84
87
|
ellipse: ShapeDefaults.new(type: :ellipse, x: 0, category: :element, y: 0, w: 200, h: 120, style_modifiers: 'ellipse'),
|
88
|
+
group: ShapeDefaults.new(type: :group, x: 0, category: :element, y: 0, w: 210, h: 210, style_modifiers: 'fontSize=20;verticalAlign=top'),
|
85
89
|
hexagon: ShapeDefaults.new(type: :hexagon, x: 0, category: :element, y: 0, w: 200, h: 120, style_modifiers: 'shape=hexagon'),
|
86
90
|
interface: ShapeDefaults.new(type: :interface, x: 0, category: :element, y: 0, w: 160, h: 160, style_modifiers: 'align=left;overflow=fill;fontSize=12;fontFamily=Helvetica'),
|
87
91
|
klass: ShapeDefaults.new(type: :klass, x: 0, category: :element, y: 0, w: 160, h: 160, style_modifiers: 'align=left;overflow=fill;fontSize=12;fontFamily=Helvetica'),
|
@@ -142,6 +142,12 @@ module DrawioDsl
|
|
142
142
|
add_shape(database)
|
143
143
|
end
|
144
144
|
|
145
|
+
def add_db_json(id = nil, **opts, &block)
|
146
|
+
opts = { id: id }.merge(opts) if id
|
147
|
+
db_json = DrawioDsl::Schema::DbJson.new(current_page, **opts, &block)
|
148
|
+
add_shape(db_json)
|
149
|
+
end
|
150
|
+
|
145
151
|
def add_diamond(id = nil, **opts, &block)
|
146
152
|
opts = { id: id }.merge(opts) if id
|
147
153
|
diamond = DrawioDsl::Schema::Diamond.new(current_page, **opts, &block)
|
@@ -160,6 +166,12 @@ module DrawioDsl
|
|
160
166
|
add_shape(ellipse)
|
161
167
|
end
|
162
168
|
|
169
|
+
def add_group(id = nil, **opts, &block)
|
170
|
+
opts = { id: id }.merge(opts) if id
|
171
|
+
group = DrawioDsl::Schema::Group.new(current_page, **opts, &block)
|
172
|
+
add_shape(group)
|
173
|
+
end
|
174
|
+
|
163
175
|
def add_hexagon(id = nil, **opts, &block)
|
164
176
|
opts = { id: id }.merge(opts) if id
|
165
177
|
hexagon = DrawioDsl::Schema::Hexagon.new(current_page, **opts, &block)
|
data/lib/drawio_dsl/drawio.rb
CHANGED
@@ -67,23 +67,4 @@ module DrawioDsl
|
|
67
67
|
self
|
68
68
|
end
|
69
69
|
end
|
70
|
-
|
71
|
-
# DrawioDsl::DrawioPage is created when you call .page on the draw-io DSL.
|
72
|
-
class DrawioPage < KDirector::Directors::ChildDirector
|
73
|
-
include DrawioDsl::DrawioShapes
|
74
|
-
|
75
|
-
def initialize(parent, **opts)
|
76
|
-
super(parent, **opts)
|
77
|
-
|
78
|
-
builder.add_page(**opts)
|
79
|
-
end
|
80
|
-
|
81
|
-
def grid_layout(**opts)
|
82
|
-
builder.add_grid_layout(**opts)
|
83
|
-
end
|
84
|
-
|
85
|
-
def flex_layout(**opts)
|
86
|
-
builder.add_flex_layout(**opts)
|
87
|
-
end
|
88
|
-
end
|
89
70
|
end
|
@@ -2,8 +2,9 @@
|
|
2
2
|
|
3
3
|
module DrawioDsl
|
4
4
|
# :nocov:
|
5
|
-
|
6
|
-
|
5
|
+
# 1000's of extension shapes derived from Extensions.js that can be used via the add_shape method
|
6
|
+
class DrawioExtensions
|
7
|
+
include DrawioDsl::DrawioExtensionsActive
|
7
8
|
|
8
9
|
attr_reader :sections
|
9
10
|
attr_reader :current_section
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module DrawioDsl
|
4
|
+
# DrawioDsl::DrawioPage is created when you call .page on the draw-io DSL.
|
5
|
+
class DrawioPage < KDirector::Directors::ChildDirector
|
6
|
+
include DrawioDsl::DrawioShapes
|
7
|
+
|
8
|
+
def initialize(parent, **opts)
|
9
|
+
super(parent, **opts)
|
10
|
+
|
11
|
+
builder.add_page(**opts)
|
12
|
+
end
|
13
|
+
|
14
|
+
def grid_layout(**opts)
|
15
|
+
builder.add_grid_layout(**opts)
|
16
|
+
end
|
17
|
+
|
18
|
+
def flex_layout(**opts)
|
19
|
+
builder.add_flex_layout(**opts)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -1,11 +1,11 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module DrawioDsl
|
4
|
-
#
|
4
|
+
# List of DSL methods for each common shape
|
5
5
|
# :nocov:
|
6
6
|
module DrawioShapes
|
7
7
|
def random(**opts)
|
8
|
-
case rand(
|
8
|
+
case rand(44)
|
9
9
|
when 0
|
10
10
|
line(**opts)
|
11
11
|
when 1
|
@@ -53,42 +53,46 @@ module DrawioDsl
|
|
53
53
|
when 22
|
54
54
|
database(**opts)
|
55
55
|
when 23
|
56
|
-
|
56
|
+
db_json(**opts)
|
57
57
|
when 24
|
58
|
-
|
58
|
+
diamond(**opts)
|
59
59
|
when 25
|
60
|
-
|
60
|
+
document(**opts)
|
61
61
|
when 26
|
62
|
-
|
62
|
+
ellipse(**opts)
|
63
63
|
when 27
|
64
|
-
|
64
|
+
group(**opts)
|
65
65
|
when 28
|
66
|
-
|
66
|
+
hexagon(**opts)
|
67
67
|
when 29
|
68
|
-
|
68
|
+
interface(**opts)
|
69
69
|
when 30
|
70
|
-
|
70
|
+
klass(**opts)
|
71
71
|
when 31
|
72
|
-
|
72
|
+
note(**opts)
|
73
73
|
when 32
|
74
|
-
|
74
|
+
process(**opts)
|
75
75
|
when 33
|
76
|
-
|
76
|
+
rectangle(**opts)
|
77
77
|
when 34
|
78
|
-
|
78
|
+
rectangle2(**opts)
|
79
79
|
when 35
|
80
|
-
|
80
|
+
square(**opts)
|
81
81
|
when 36
|
82
|
-
|
82
|
+
step(**opts)
|
83
83
|
when 37
|
84
|
-
|
84
|
+
tick(**opts)
|
85
85
|
when 38
|
86
|
-
|
86
|
+
todo(**opts)
|
87
87
|
when 39
|
88
|
-
|
88
|
+
face(**opts)
|
89
89
|
when 40
|
90
|
-
|
90
|
+
triangle(**opts)
|
91
91
|
when 41
|
92
|
+
embed_row(**opts)
|
93
|
+
when 42
|
94
|
+
embed_col50(**opts)
|
95
|
+
when 43
|
92
96
|
embed_col200(**opts)
|
93
97
|
end
|
94
98
|
end
|
@@ -185,6 +189,10 @@ module DrawioDsl
|
|
185
189
|
builder.add_database(id, **opts, &block)
|
186
190
|
end
|
187
191
|
|
192
|
+
def db_json(id = nil, **opts, &block)
|
193
|
+
builder.add_db_json(id, **opts, &block)
|
194
|
+
end
|
195
|
+
|
188
196
|
def diamond(id = nil, **opts, &block)
|
189
197
|
builder.add_diamond(id, **opts, &block)
|
190
198
|
end
|
@@ -197,6 +205,10 @@ module DrawioDsl
|
|
197
205
|
builder.add_ellipse(id, **opts, &block)
|
198
206
|
end
|
199
207
|
|
208
|
+
def group(id = nil, **opts, &block)
|
209
|
+
builder.add_group(id, **opts, &block)
|
210
|
+
end
|
211
|
+
|
200
212
|
def hexagon(id = nil, **opts, &block)
|
201
213
|
builder.add_hexagon(id, **opts, &block)
|
202
214
|
end
|
@@ -4,7 +4,7 @@
|
|
4
4
|
module DrawioDsl
|
5
5
|
# HTML formatters can be used on shapes to render HTML using a DSL
|
6
6
|
module Formatters
|
7
|
-
#
|
7
|
+
# Base for any HTML formatter
|
8
8
|
class BaseFormatter
|
9
9
|
attr_reader :html
|
10
10
|
|
@@ -12,6 +12,78 @@ module DrawioDsl
|
|
12
12
|
@html = DrawioDsl::Formatters::HtmlBuilder.new(element_style_defaults)
|
13
13
|
end
|
14
14
|
|
15
|
+
def hr(size: 1)
|
16
|
+
html.hr(size: size)
|
17
|
+
|
18
|
+
self
|
19
|
+
end
|
20
|
+
|
21
|
+
def b(content, **opts)
|
22
|
+
html.b(content, **opts)
|
23
|
+
|
24
|
+
self
|
25
|
+
end
|
26
|
+
|
27
|
+
def p(content, **opts)
|
28
|
+
html.p(content, **opts)
|
29
|
+
|
30
|
+
self
|
31
|
+
end
|
32
|
+
|
33
|
+
def h1(content, **opts)
|
34
|
+
html.h1(content, **opts)
|
35
|
+
|
36
|
+
self
|
37
|
+
end
|
38
|
+
|
39
|
+
def h2(content, **opts)
|
40
|
+
html.h2(content, **opts)
|
41
|
+
|
42
|
+
self
|
43
|
+
end
|
44
|
+
|
45
|
+
def h3(content, **opts)
|
46
|
+
html.h3(content, **opts)
|
47
|
+
|
48
|
+
self
|
49
|
+
end
|
50
|
+
|
51
|
+
def h4(content, **opts)
|
52
|
+
html.h4(content, **opts)
|
53
|
+
|
54
|
+
self
|
55
|
+
end
|
56
|
+
|
57
|
+
def h5(content, **opts)
|
58
|
+
html.h5(content, **opts)
|
59
|
+
|
60
|
+
self
|
61
|
+
end
|
62
|
+
|
63
|
+
def h6(content, **opts)
|
64
|
+
html.h6(content, **opts)
|
65
|
+
|
66
|
+
self
|
67
|
+
end
|
68
|
+
|
69
|
+
def ul_s(**opts)
|
70
|
+
html.ul_s(**opts)
|
71
|
+
|
72
|
+
self
|
73
|
+
end
|
74
|
+
|
75
|
+
def ul_e(**opts)
|
76
|
+
html.ul_e(**opts)
|
77
|
+
|
78
|
+
self
|
79
|
+
end
|
80
|
+
|
81
|
+
def li(content, **opts)
|
82
|
+
html.li(content, **opts)
|
83
|
+
|
84
|
+
self
|
85
|
+
end
|
86
|
+
|
15
87
|
def empty?
|
16
88
|
html.empty?
|
17
89
|
end
|
@@ -19,6 +91,54 @@ module DrawioDsl
|
|
19
91
|
def as_html(new_line: false)
|
20
92
|
html.as_html(new_line: new_line)
|
21
93
|
end
|
94
|
+
|
95
|
+
private
|
96
|
+
|
97
|
+
# useful defaults
|
98
|
+
|
99
|
+
def ratio
|
100
|
+
@ratio ||= 1.2
|
101
|
+
end
|
102
|
+
|
103
|
+
def base_margin_bottom
|
104
|
+
@base_margin_bottom ||= 4
|
105
|
+
end
|
106
|
+
|
107
|
+
def p_margin_bottom
|
108
|
+
@p_margin_bottom ||= base_margin_bottom
|
109
|
+
end
|
110
|
+
|
111
|
+
def b_margin_bottom
|
112
|
+
@b_margin_bottom ||= base_margin_bottom
|
113
|
+
end
|
114
|
+
|
115
|
+
def li_margin_bottom
|
116
|
+
@li_margin_bottom ||= base_margin_bottom
|
117
|
+
end
|
118
|
+
|
119
|
+
def h6_margin_bottom
|
120
|
+
@h6_margin_bottom ||= base_margin_bottom
|
121
|
+
end
|
122
|
+
|
123
|
+
def h5_margin_bottom
|
124
|
+
@h5_margin_bottom ||= h6_margin_bottom * ratio
|
125
|
+
end
|
126
|
+
|
127
|
+
def h4_margin_bottom
|
128
|
+
@h4_margin_bottom ||= h5_margin_bottom * ratio
|
129
|
+
end
|
130
|
+
|
131
|
+
def h3_margin_bottom
|
132
|
+
@h3_margin_bottom ||= h4_margin_bottom * ratio
|
133
|
+
end
|
134
|
+
|
135
|
+
def h2_margin_bottom
|
136
|
+
@h2_margin_bottom ||= h3_margin_bottom * ratio
|
137
|
+
end
|
138
|
+
|
139
|
+
def h1_margin_bottom
|
140
|
+
@h1_margin_bottom ||= h2_margin_bottom * ratio
|
141
|
+
end
|
22
142
|
end
|
23
143
|
end
|
24
144
|
end
|
@@ -4,7 +4,7 @@
|
|
4
4
|
module DrawioDsl
|
5
5
|
# HTML formatters can be used on shapes to render HTML using a DSL
|
6
6
|
module Formatters
|
7
|
-
#
|
7
|
+
# HTML builder has methods for common HTML elements that get written sequentially
|
8
8
|
class HtmlBuilder
|
9
9
|
attr_reader :element_style_defaults
|
10
10
|
|
@@ -12,6 +12,9 @@ module DrawioDsl
|
|
12
12
|
@element_style_defaults = element_style_defaults
|
13
13
|
end
|
14
14
|
|
15
|
+
# Access the default styles for a HTML element
|
16
|
+
#
|
17
|
+
# Formatters can define the defaults styles for HTML elements such as <p>, <h1>, etc.
|
15
18
|
def default_for(tag)
|
16
19
|
element_style_defaults[tag] || {}
|
17
20
|
end
|
@@ -48,6 +51,42 @@ module DrawioDsl
|
|
48
51
|
add_line("<p#{style_for(:p, **opts)}>#{content}</p>")
|
49
52
|
end
|
50
53
|
|
54
|
+
def h1(content, **opts)
|
55
|
+
add_line("<h1#{style_for(:h1, **opts)}>#{content}</h1>")
|
56
|
+
end
|
57
|
+
|
58
|
+
def h2(content, **opts)
|
59
|
+
add_line("<h2#{style_for(:h2, **opts)}>#{content}</h2>")
|
60
|
+
end
|
61
|
+
|
62
|
+
def h3(content, **opts)
|
63
|
+
add_line("<h3#{style_for(:h3, **opts)}>#{content}</h3>")
|
64
|
+
end
|
65
|
+
|
66
|
+
def h4(content, **opts)
|
67
|
+
add_line("<h4#{style_for(:h4, **opts)}>#{content}</h4>")
|
68
|
+
end
|
69
|
+
|
70
|
+
def h5(content, **opts)
|
71
|
+
add_line("<h5#{style_for(:h5, **opts)}>#{content}</h5>")
|
72
|
+
end
|
73
|
+
|
74
|
+
def h6(content, **opts)
|
75
|
+
add_line("<h6#{style_for(:h6, **opts)}>#{content}</h6>")
|
76
|
+
end
|
77
|
+
|
78
|
+
def li(content, **opts)
|
79
|
+
add_line("<li#{style_for(:li, **opts)}>#{content}</li>")
|
80
|
+
end
|
81
|
+
|
82
|
+
def ul_s(**opts)
|
83
|
+
add_line("<ul#{style_for(:ul, **opts)}>")
|
84
|
+
end
|
85
|
+
|
86
|
+
def ul_e(**_opts)
|
87
|
+
add_line('</ul>')
|
88
|
+
end
|
89
|
+
|
51
90
|
def add_line(line)
|
52
91
|
lines << line
|
53
92
|
end
|
@@ -4,10 +4,22 @@
|
|
4
4
|
module DrawioDsl
|
5
5
|
# HTML formatters can be used on shapes to render HTML using a DSL
|
6
6
|
module Formatters
|
7
|
-
#
|
7
|
+
# Format the HTML to display an interface on a class diagram
|
8
8
|
class InterfaceFormatter < BaseFormatter
|
9
9
|
def initialize
|
10
|
-
super(
|
10
|
+
super(
|
11
|
+
{
|
12
|
+
p: { margin: '0px', margin_left: '4px', margin_bottom: "#{p_margin_bottom}px" },
|
13
|
+
b: { margin: '0px', margin_left: '4px', margin_bottom: "#{b_margin_bottom}px" },
|
14
|
+
h1: { margin: '0px', margin_left: '4px', margin_bottom: "#{h1_margin_bottom}px" },
|
15
|
+
h2: { margin: '0px', margin_left: '4px', margin_bottom: "#{h2_margin_bottom}px" },
|
16
|
+
h3: { margin: '0px', margin_left: '4px', margin_bottom: "#{h3_margin_bottom}px" },
|
17
|
+
h4: { margin: '0px', margin_left: '4px', margin_bottom: "#{h4_margin_bottom}px" },
|
18
|
+
h5: { margin: '0px', margin_left: '4px', margin_bottom: "#{h5_margin_bottom}px" },
|
19
|
+
h6: { margin: '0px', margin_left: '4px', margin_bottom: "#{h6_margin_bottom}px" },
|
20
|
+
li: { margin: '0px', margin_left: '4px', margin_bottom: "#{li_margin_bottom}px" }
|
21
|
+
}
|
22
|
+
)
|
11
23
|
end
|
12
24
|
|
13
25
|
def header(name, description: nil, interface_type: 'Interface')
|
@@ -4,10 +4,22 @@
|
|
4
4
|
module DrawioDsl
|
5
5
|
# HTML formatters can be used on shapes to render HTML using a DSL
|
6
6
|
module Formatters
|
7
|
-
#
|
7
|
+
# Format the HTML to display an class on a class diagram
|
8
8
|
class KlassFormatter < BaseFormatter
|
9
9
|
def initialize
|
10
|
-
super(
|
10
|
+
super(
|
11
|
+
{
|
12
|
+
p: { margin: '0px', margin_left: '4px', margin_bottom: "#{p_margin_bottom}px" },
|
13
|
+
b: { margin: '0px', margin_left: '4px', margin_bottom: "#{b_margin_bottom}px" },
|
14
|
+
h1: { margin: '0px', margin_left: '4px', margin_bottom: "#{h1_margin_bottom}px" },
|
15
|
+
h2: { margin: '0px', margin_left: '4px', margin_bottom: "#{h2_margin_bottom}px" },
|
16
|
+
h3: { margin: '0px', margin_left: '4px', margin_bottom: "#{h3_margin_bottom}px" },
|
17
|
+
h4: { margin: '0px', margin_left: '4px', margin_bottom: "#{h4_margin_bottom}px" },
|
18
|
+
h5: { margin: '0px', margin_left: '4px', margin_bottom: "#{h5_margin_bottom}px" },
|
19
|
+
h6: { margin: '0px', margin_left: '4px', margin_bottom: "#{h6_margin_bottom}px" },
|
20
|
+
li: { margin: '0px', margin_left: '4px', margin_bottom: "#{li_margin_bottom}px" }
|
21
|
+
}
|
22
|
+
)
|
11
23
|
end
|
12
24
|
|
13
25
|
def header(name, description: nil)
|
@@ -4,7 +4,7 @@
|
|
4
4
|
module DrawioDsl
|
5
5
|
# HTML formatters can be used on shapes to render HTML using a DSL
|
6
6
|
module Formatters
|
7
|
-
#
|
7
|
+
# Build the style attribute for a HTML element
|
8
8
|
class StyleBuilder
|
9
9
|
MAPPINGS = {
|
10
10
|
margin: 'margin',
|
data/lib/drawio_dsl/schema/_.rb
CHANGED
@@ -35,9 +35,11 @@ require_relative 'shapes/container4'
|
|
35
35
|
require_relative 'shapes/cross'
|
36
36
|
require_relative 'shapes/envelop'
|
37
37
|
require_relative 'shapes/database'
|
38
|
+
require_relative 'shapes/db_json'
|
38
39
|
require_relative 'shapes/diamond'
|
39
40
|
require_relative 'shapes/document'
|
40
41
|
require_relative 'shapes/ellipse'
|
42
|
+
require_relative 'shapes/group'
|
41
43
|
require_relative 'shapes/hexagon'
|
42
44
|
require_relative 'shapes/interface'
|
43
45
|
require_relative 'shapes/klass'
|
@@ -119,8 +119,8 @@ module DrawioDsl
|
|
119
119
|
# rubocop:enable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
|
120
120
|
|
121
121
|
def as_xml(xml)
|
122
|
-
log.error category
|
123
|
-
log.error type
|
122
|
+
# log.error category
|
123
|
+
# log.error type
|
124
124
|
draw_element(xml) if category == :element
|
125
125
|
draw_line(xml) if category == :line
|
126
126
|
end
|
data/lib/drawio_dsl/version.rb
CHANGED
data/lib/drawio_dsl.rb
CHANGED
@@ -21,6 +21,7 @@ require_relative 'drawio_dsl/layout_engine'
|
|
21
21
|
require_relative 'drawio_dsl/drawio_shapes'
|
22
22
|
require_relative 'drawio_dsl/drawio_extensions_active'
|
23
23
|
require_relative 'drawio_dsl/drawio_extensions'
|
24
|
+
require_relative 'drawio_dsl/drawio_page'
|
24
25
|
require_relative 'drawio_dsl/drawio'
|
25
26
|
|
26
27
|
module DrawioDsl
|
data/package-lock.json
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
{
|
2
2
|
"name": "drawio_dsl",
|
3
|
-
"version": "0.8.
|
3
|
+
"version": "0.8.7",
|
4
4
|
"lockfileVersion": 2,
|
5
5
|
"requires": true,
|
6
6
|
"packages": {
|
7
7
|
"": {
|
8
8
|
"name": "drawio_dsl",
|
9
|
-
"version": "0.8.
|
9
|
+
"version": "0.8.7",
|
10
10
|
"devDependencies": {
|
11
11
|
"@klueless-js/semantic-release-rubygem": "github:klueless-js/semantic-release-rubygem",
|
12
12
|
"@semantic-release/changelog": "^6.0.1",
|
data/package.json
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: drawio_dsl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Cruwys
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-03-
|
11
|
+
date: 2022-03-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: k_config
|
@@ -89,6 +89,8 @@ files:
|
|
89
89
|
- ".builders/generators/10-transform-drawio-js.rb"
|
90
90
|
- ".builders/generators/20-drawio-extensions.rb"
|
91
91
|
- ".builders/generators/domain_diagram.rb"
|
92
|
+
- ".builders/generators/parking-map.png"
|
93
|
+
- ".builders/generators/parking_app.rb"
|
92
94
|
- ".builders/generators/printspeak-architecture-generator.rb"
|
93
95
|
- ".builders/generators/project-plan.rb"
|
94
96
|
- ".builders/generators/sample_diagrams/05-samples.rb"
|
@@ -113,8 +115,11 @@ files:
|
|
113
115
|
- Rakefile
|
114
116
|
- bin/console
|
115
117
|
- bin/setup
|
116
|
-
- docs/domain.
|
117
|
-
- docs/domain_model.
|
118
|
+
- docs/domain-modal.md
|
119
|
+
- docs/domain-modal/domain_model.drawio
|
120
|
+
- docs/domain-modal/domain_model.svg
|
121
|
+
- docs/domain-modal/domain_model_custom.drawio
|
122
|
+
- docs/domain-modal/domain_model_custom.svg
|
118
123
|
- docs/extensions.md
|
119
124
|
- docs/extensions/analyti_cs.svg
|
120
125
|
- docs/extensions/android_inputs.svg
|
@@ -269,6 +274,10 @@ files:
|
|
269
274
|
- docs/extensions/venn_gradient.svg
|
270
275
|
- docs/extensions/venn_plain.svg
|
271
276
|
- docs/extensions/vessels.svg
|
277
|
+
- docs/parking_app.drawio
|
278
|
+
- docs/parking_app.svg
|
279
|
+
- docs/printspeak-architecture-generator.drawio
|
280
|
+
- docs/printspeak-architecture-generator.svg
|
272
281
|
- docs/project-plan.md
|
273
282
|
- docs/project-plan/project.drawio
|
274
283
|
- docs/project-plan/project_done.svg
|
@@ -301,6 +310,7 @@ files:
|
|
301
310
|
- lib/drawio_dsl/drawio_extensions.json
|
302
311
|
- lib/drawio_dsl/drawio_extensions.rb
|
303
312
|
- lib/drawio_dsl/drawio_extensions_active.rb
|
313
|
+
- lib/drawio_dsl/drawio_page.rb
|
304
314
|
- lib/drawio_dsl/drawio_shapes.rb
|
305
315
|
- lib/drawio_dsl/formatters/_.rb
|
306
316
|
- lib/drawio_dsl/formatters/base_formatter.rb
|
@@ -334,6 +344,7 @@ files:
|
|
334
344
|
- lib/drawio_dsl/schema/shapes/container4.rb
|
335
345
|
- lib/drawio_dsl/schema/shapes/cross.rb
|
336
346
|
- lib/drawio_dsl/schema/shapes/database.rb
|
347
|
+
- lib/drawio_dsl/schema/shapes/db_json.rb
|
337
348
|
- lib/drawio_dsl/schema/shapes/diamond.rb
|
338
349
|
- lib/drawio_dsl/schema/shapes/document.rb
|
339
350
|
- lib/drawio_dsl/schema/shapes/ellipse.rb
|
@@ -342,6 +353,7 @@ files:
|
|
342
353
|
- lib/drawio_dsl/schema/shapes/embed_row.rb
|
343
354
|
- lib/drawio_dsl/schema/shapes/envelop.rb
|
344
355
|
- lib/drawio_dsl/schema/shapes/face.rb
|
356
|
+
- lib/drawio_dsl/schema/shapes/group.rb
|
345
357
|
- lib/drawio_dsl/schema/shapes/h1.rb
|
346
358
|
- lib/drawio_dsl/schema/shapes/h2.rb
|
347
359
|
- lib/drawio_dsl/schema/shapes/h3.rb
|