asciidoctor-diagram 2.2.10 → 2.2.12.next1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (100) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.adoc +13 -0
  3. data/lib/asciidoctor-diagram/diagram_source.rb +2 -2
  4. data/lib/asciidoctor-diagram/plantuml/converter.rb +1 -0
  5. data/lib/asciidoctor-diagram/structurizr/renderers.rb +5 -0
  6. data/lib/asciidoctor-diagram/version.rb +1 -1
  7. metadata +5 -132
  8. data/Rakefile +0 -9
  9. data/docs/antora.yml +0 -5
  10. data/docs/modules/ROOT/images/a2s.svg +0 -44
  11. data/docs/modules/ROOT/images/actdiag.png +0 -0
  12. data/docs/modules/ROOT/images/asciidoctor-diagram-classes.png +0 -0
  13. data/docs/modules/ROOT/images/asciidoctor-diagram-process.png +0 -0
  14. data/docs/modules/ROOT/images/barcode.png +0 -0
  15. data/docs/modules/ROOT/images/barcode2.png +0 -0
  16. data/docs/modules/ROOT/images/blockdiag.png +0 -0
  17. data/docs/modules/ROOT/images/d2.png +0 -0
  18. data/docs/modules/ROOT/images/lilypond.png +0 -0
  19. data/docs/modules/ROOT/images/penrose.png +0 -0
  20. data/docs/modules/ROOT/nav.adoc +0 -41
  21. data/docs/modules/ROOT/pages/blocks.adoc +0 -140
  22. data/docs/modules/ROOT/pages/diagram_types/a2s.adoc +0 -47
  23. data/docs/modules/ROOT/pages/diagram_types/actdiag.adoc +0 -46
  24. data/docs/modules/ROOT/pages/diagram_types/barcode.adoc +0 -72
  25. data/docs/modules/ROOT/pages/diagram_types/blockdiag.adoc +0 -38
  26. data/docs/modules/ROOT/pages/diagram_types/bpmn.adoc +0 -21
  27. data/docs/modules/ROOT/pages/diagram_types/bytefield.adoc +0 -16
  28. data/docs/modules/ROOT/pages/diagram_types/d2.adoc +0 -43
  29. data/docs/modules/ROOT/pages/diagram_types/dbml.adoc +0 -16
  30. data/docs/modules/ROOT/pages/diagram_types/diagrams.adoc +0 -20
  31. data/docs/modules/ROOT/pages/diagram_types/ditaa.adoc +0 -31
  32. data/docs/modules/ROOT/pages/diagram_types/dpic.adoc +0 -16
  33. data/docs/modules/ROOT/pages/diagram_types/erd.adoc +0 -17
  34. data/docs/modules/ROOT/pages/diagram_types/gnuplot.adoc +0 -27
  35. data/docs/modules/ROOT/pages/diagram_types/graphviz.adoc +0 -21
  36. data/docs/modules/ROOT/pages/diagram_types/lilypond.adoc +0 -27
  37. data/docs/modules/ROOT/pages/diagram_types/meme.adoc +0 -34
  38. data/docs/modules/ROOT/pages/diagram_types/mermaid.adoc +0 -28
  39. data/docs/modules/ROOT/pages/diagram_types/msc.adoc +0 -23
  40. data/docs/modules/ROOT/pages/diagram_types/nomnoml.adoc +0 -16
  41. data/docs/modules/ROOT/pages/diagram_types/nwdiag.adoc +0 -22
  42. data/docs/modules/ROOT/pages/diagram_types/penrose.adoc +0 -50
  43. data/docs/modules/ROOT/pages/diagram_types/pikchr.adoc +0 -16
  44. data/docs/modules/ROOT/pages/diagram_types/plantuml.adoc +0 -24
  45. data/docs/modules/ROOT/pages/diagram_types/seqdiag.adoc +0 -18
  46. data/docs/modules/ROOT/pages/diagram_types/shaape.adoc +0 -18
  47. data/docs/modules/ROOT/pages/diagram_types/smcat.adoc +0 -18
  48. data/docs/modules/ROOT/pages/diagram_types/structurizr.adoc +0 -29
  49. data/docs/modules/ROOT/pages/diagram_types/svgbob.adoc +0 -21
  50. data/docs/modules/ROOT/pages/diagram_types/symbolator.adoc +0 -19
  51. data/docs/modules/ROOT/pages/diagram_types/syntrax.adoc +0 -28
  52. data/docs/modules/ROOT/pages/diagram_types/tikz.adoc +0 -21
  53. data/docs/modules/ROOT/pages/diagram_types/umlet.adoc +0 -19
  54. data/docs/modules/ROOT/pages/diagram_types/vega.adoc +0 -28
  55. data/docs/modules/ROOT/pages/diagram_types/wavedrom.adoc +0 -17
  56. data/docs/modules/ROOT/pages/enabling.adoc +0 -25
  57. data/docs/modules/ROOT/pages/generate.adoc +0 -15
  58. data/docs/modules/ROOT/pages/index.adoc +0 -12
  59. data/docs/modules/ROOT/pages/installation.adoc +0 -32
  60. data/docs/modules/ROOT/pages/output.adoc +0 -19
  61. data/docs/modules/ROOT/partials/shared-attrs.adoc +0 -12
  62. data/docs/modules/ROOT/partials/uris.adoc +0 -48
  63. data/examples/Gemfile +0 -3
  64. data/examples/README.adoc +0 -18
  65. data/examples/design.adoc +0 -78
  66. data/examples/features.adoc +0 -189
  67. data/spec/a2s_spec.rb +0 -33
  68. data/spec/barcode_spec.rb +0 -176
  69. data/spec/blockdiag_spec.rb +0 -20
  70. data/spec/bpmn_spec.rb +0 -60
  71. data/spec/bytefield_spec.rb +0 -96
  72. data/spec/d2_spec.rb +0 -87
  73. data/spec/dbml_spec.rb +0 -32
  74. data/spec/diagrams_spec.rb +0 -27
  75. data/spec/ditaa_spec.rb +0 -191
  76. data/spec/dpic_spec.rb +0 -23
  77. data/spec/erd_spec.rb +0 -96
  78. data/spec/gnuplot_spec.rb +0 -229
  79. data/spec/graphviz_py_spec.rb +0 -33
  80. data/spec/graphviz_spec.rb +0 -24
  81. data/spec/lilypond_spec.rb +0 -17
  82. data/spec/man.jpg +0 -0
  83. data/spec/meme_spec.rb +0 -67
  84. data/spec/mermaid_spec.rb +0 -161
  85. data/spec/msc_spec.rb +0 -37
  86. data/spec/nomnoml_spec.rb +0 -36
  87. data/spec/pikchr_spec.rb +0 -73
  88. data/spec/plantuml_spec.rb +0 -800
  89. data/spec/shaape_spec.rb +0 -20
  90. data/spec/shared_examples.rb +0 -766
  91. data/spec/smcat_spec.rb +0 -30
  92. data/spec/structurizr_spec.rb +0 -41
  93. data/spec/svgbob_spec.rb +0 -33
  94. data/spec/symbolator_spec.rb +0 -27
  95. data/spec/syntrax_spec.rb +0 -22
  96. data/spec/test_helper_methods.rb +0 -118
  97. data/spec/tikz_spec.rb +0 -181
  98. data/spec/umlet_spec.rb +0 -32
  99. data/spec/vega_spec.rb +0 -133
  100. data/spec/wavedrom_spec.rb +0 -21
data/spec/mermaid_spec.rb DELETED
@@ -1,161 +0,0 @@
1
- require_relative 'test_helper_methods'
2
-
3
- MERMAID_CODE = <<-eos
4
- graph LR
5
- A[Square Rect] -- Link text --> B((Circle))
6
- A --> C(Round Rect)
7
- B --> D{Rhombus}
8
- C --> D
9
- eos
10
-
11
- describe Asciidoctor::Diagram::MermaidInlineMacroProcessor do
12
- include_examples "inline_macro", :mermaid, MERMAID_CODE, [:png, :svg]
13
- end
14
-
15
- describe Asciidoctor::Diagram::MermaidBlockMacroProcessor do
16
- include_examples "block_macro", :mermaid, MERMAID_CODE, [:png, :svg]
17
-
18
- it "should respect the sequenceConfig attribute" do
19
- seq_diag = <<-eos
20
- sequenceDiagram
21
- Alice->>John: Hello John, how are you?
22
- John-->>Alice: Great!
23
- eos
24
-
25
- seq_config = <<-eos
26
- {
27
- "diagramMarginX": 0,
28
- "diagramMarginY": 0,
29
- "actorMargin": 0,
30
- "boxMargin": 0,
31
- "boxTextMargin": 0,
32
- "noteMargin": 0,
33
- "messageMargin": 0
34
- }
35
- eos
36
- File.write('seqconfig.txt', seq_config)
37
-
38
- File.write('mermaid.txt', seq_diag)
39
-
40
- doc = <<-eos
41
- = Hello, Mermaid!
42
- Doc Writer <doc@example.com>
43
-
44
- == First Section
45
-
46
- mermaid::mermaid.txt[target="with_config", sequenceConfig="seqconfig.txt"]
47
- mermaid::mermaid.txt[target="without_config"]
48
- eos
49
-
50
- load_asciidoc doc
51
- expect(File.exist?('with_config.png')).to be true
52
- expect(File.exist?('without_config.png')).to be true
53
- expect(File.size('with_config.png')).to_not be File.size('without_config.png')
54
- end
55
-
56
- it "should respect the width attribute" do
57
- seq_diag = <<-eos
58
- sequenceDiagram
59
- Alice->>Bob: Hello Bob, how are you?
60
- Bob->>Claire: Hello Claire, how are you?
61
- Claire->>Doug: Hello Doug, how are you?
62
- eos
63
-
64
- File.write('mermaid.txt', seq_diag)
65
-
66
- doc = <<-eos
67
- = Hello, Mermaid!
68
- Doc Writer <doc@example.com>
69
-
70
- == First Section
71
-
72
- mermaid::mermaid.txt[target="with_width", width="700"]
73
- mermaid::mermaid.txt[target="without_width"]
74
- eos
75
-
76
- load_asciidoc doc
77
- expect(File.exist?('with_width.png')).to be true
78
- expect(File.exist?('without_width.png')).to be true
79
- expect(File.size('with_width.png')).to_not be File.size('without_width.png')
80
- end
81
-
82
- it "should respect the theme attribute" do
83
- seq_diag = <<-eos
84
- sequenceDiagram
85
- Alice->>Bob: Hello Bob, how are you?
86
- Bob->>Claire: Hello Claire, how are you?
87
- Claire->>Doug: Hello Doug, how are you?
88
- eos
89
-
90
- File.write('mermaid.txt', seq_diag)
91
-
92
- doc = <<-eos
93
- = Hello, Mermaid!
94
- Doc Writer <doc@example.com>
95
-
96
- == First Section
97
-
98
- mermaid::mermaid.txt[target="default", format="svg"]
99
- mermaid::mermaid.txt[target="dark", format="svg", theme="dark"]
100
- eos
101
-
102
- load_asciidoc doc
103
- expect(File.exist?('default.svg')).to be true
104
- expect(File.exist?('dark.svg')).to be true
105
- expect(File.read('default.svg')).to_not be File.read('dark.svg')
106
- end
107
-
108
- it "should respect the puppeteerConfig attribute" do
109
- seq_diag = <<-eos
110
- sequenceDiagram
111
- Alice->>John: Hello John, how are you?
112
- John-->>Alice: Great!
113
- eos
114
-
115
- pptr_config = <<-eos
116
- {
117
- "args": ["--no-sandbox"]
118
- }
119
- eos
120
- File.write('pptrconfig.txt', pptr_config)
121
-
122
- File.write('mermaid.txt', seq_diag)
123
-
124
- doc = <<-eos
125
- = Hello, Mermaid!
126
- Doc Writer <doc@example.com>
127
-
128
- == First Section
129
-
130
- mermaid::mermaid.txt[target="with_config", puppeteerConfig="pptrconfig.txt"]
131
- mermaid::mermaid.txt[target="without_config"]
132
- eos
133
-
134
- load_asciidoc doc
135
- expect(File.exist?('with_config.png')).to be true
136
- expect(File.exist?('without_config.png')).to be true
137
- expect(File.size('with_config.png')).to be File.size('without_config.png')
138
- end
139
- end
140
-
141
- describe Asciidoctor::Diagram::MermaidBlockProcessor do
142
- include_examples "block", :mermaid, MERMAID_CODE, [:png, :svg]
143
-
144
- it "should report unsupported scaling factors" do
145
- doc = <<-eos
146
- = Hello, Mermaid!
147
- Doc Writer <doc@example.com>
148
-
149
- == First Section
150
-
151
- [mermaid, scale=1.5]
152
- ----
153
- sequenceDiagram
154
- Alice->>John: Hello John, how are you?
155
- John-->>Alice: Great!
156
- ----
157
- eos
158
-
159
- expect { load_asciidoc doc }.to raise_error(/support.*scale/i)
160
- end
161
- end
data/spec/msc_spec.rb DELETED
@@ -1,37 +0,0 @@
1
- require_relative 'test_helper_methods'
2
-
3
- MSC_CODE = <<-eos
4
- # MSC for some fictional process
5
- msc {
6
- hscale = "2";
7
-
8
- a,b,c;
9
-
10
- a->b [ label = "ab()" ] ;
11
- b->c [ label = "bc(TRUE)"];
12
- c=>c [ label = "process(1)" ];
13
- c=>c [ label = "process(2)" ];
14
- ...;
15
- c=>c [ label = "process(n)" ];
16
- c=>c [ label = "process(END)" ];
17
- a<<=c [ label = "callback()"];
18
- --- [ label = "If more to run", ID="*" ];
19
- a->a [ label = "next()"];
20
- a->c [ label = "ac1()\nac2()"];
21
- b<-c [ label = "cb(TRUE)"];
22
- b->b [ label = "stalled(...)"];
23
- a<-b [ label = "ab() = FALSE"];
24
- }
25
- eos
26
-
27
- describe Asciidoctor::Diagram::MscInlineMacroProcessor, :broken_on_windows do
28
- include_examples "inline_macro", :msc, MSC_CODE, [:png, :svg]
29
- end
30
-
31
- describe Asciidoctor::Diagram::MscBlockMacroProcessor, :broken_on_windows do
32
- include_examples "block_macro", :msc, MSC_CODE, [:png, :svg]
33
- end
34
-
35
- describe Asciidoctor::Diagram::MscBlockProcessor, :broken_on_windows do
36
- include_examples "block", :msc, MSC_CODE, [:png, :svg]
37
- end
data/spec/nomnoml_spec.rb DELETED
@@ -1,36 +0,0 @@
1
- require_relative 'test_helper_methods'
2
-
3
- NOMNOML_CODE = <<-eos
4
- [Pirate
5
- [beard]--[parrot]
6
- [beard]-:>[foul mouth]
7
- ]
8
-
9
- [<abstract>Marauder]<:--[Pirate]
10
- [Pirate]- 0..7[mischief]
11
- [jollyness]->[Pirate]
12
- [jollyness]->[rum]
13
- [jollyness]->[singing]
14
- [Pirate]-> *[rum]
15
- [Pirate]->[singing]
16
- [singing]<->[rum]
17
-
18
- [<start>st]->[<state>plunder]
19
- [plunder]->[<choice>more loot]
20
- [more loot]->[st]
21
- [more loot] no ->[<end>e]
22
-
23
- [<actor>Sailor] - [<usecase>shiver me;timbers]
24
- eos
25
-
26
- describe Asciidoctor::Diagram::NomnomlInlineMacroProcessor do
27
- include_examples "inline_macro", :nomnoml, NOMNOML_CODE, [:svg]
28
- end
29
-
30
- describe Asciidoctor::Diagram::NomnomlBlockMacroProcessor do
31
- include_examples "block_macro", :nomnoml, NOMNOML_CODE, [:svg]
32
- end
33
-
34
- describe Asciidoctor::Diagram::NomnomlBlockProcessor do
35
- include_examples "block", :nomnoml, NOMNOML_CODE, [:svg]
36
- end
data/spec/pikchr_spec.rb DELETED
@@ -1,73 +0,0 @@
1
- require_relative 'test_helper_methods'
2
-
3
- PIKCHR_CODE = <<-eos
4
- # Change from the original:
5
- # * Expand the macro by hand, as Pikchr does not support
6
- # macros
7
- #
8
- #define ndblock {
9
- # box wid boxwid/2 ht boxht/2
10
- # down; box same with .t at bottom of last box; box same
11
- #}
12
- boxht = .2; boxwid = .3; circlerad = .3; dx = 0.05
13
- down; box; box; box; box ht 3*boxht "." "." "."
14
- L: box; box; box invis wid 2*boxwid "hashtab:" with .e at 1st box .w
15
- right
16
- Start: box wid .5 with .sw at 1st box.ne + (.4,.2) "..."
17
- N1: box wid .2 "n1"; D1: box wid .3 "d1"
18
- N3: box wid .4 "n3"; D3: box wid .3 "d3"
19
- box wid .4 "..."
20
- N2: box wid .5 "n2"; D2: box wid .2 "d2"
21
- arrow right from 2nd box
22
- #ndblock
23
- box wid boxwid/2 ht boxht/2
24
- down; box same with .t at bottom of last box; box same
25
- spline -> right .2 from 3rd last box then to N1.sw + (dx,0)
26
- spline -> right .3 from 2nd last box then to D1.sw + (dx,0)
27
- arrow right from last box
28
- #ndblock
29
- box wid boxwid/2 ht boxht/2
30
- down; box same with .t at bottom of last box; box same
31
- spline -> right .2 from 3rd last box to N2.sw-(dx,.2) to N2.sw+(dx,0)
32
- spline -> right .3 from 2nd last box to D2.sw-(dx,.2) to D2.sw+(dx,0)
33
- arrow right 2*linewid from L
34
- #ndblock
35
- box wid boxwid/2 ht boxht/2
36
- down; box same with .t at bottom of last box; box same
37
- spline -> right .2 from 3rd last box to N3.sw + (dx,0)
38
- spline -> right .3 from 2nd last box to D3.sw + (dx,0)
39
- circlerad = .3
40
- circle invis "ndblock" at last box.e + (1.2,.2)
41
- arrow dashed from last circle.w to 5/8<last circle.w,2nd last box> chop
42
- box invis wid 2*boxwid "ndtable:" with .e at Start.w
43
- eos
44
-
45
- describe Asciidoctor::Diagram::PikchrInlineMacroProcessor, :broken_on_windows do
46
- include_examples "inline_macro", :pikchr, PIKCHR_CODE, [:svg]
47
- end
48
-
49
- describe Asciidoctor::Diagram::PikchrBlockMacroProcessor, :broken_on_windows do
50
- include_examples "block_macro", :pikchr, PIKCHR_CODE, [:svg]
51
- end
52
-
53
- describe Asciidoctor::Diagram::PikchrBlockProcessor, :broken_on_windows do
54
- include_examples "block", :pikchr, PIKCHR_CODE, [:svg]
55
-
56
- it "should report syntax errors" do
57
- doc = <<-eos
58
- = Hello, Pikchr!
59
- Doc Writer <doc@example.com>
60
-
61
- == First Section
62
-
63
- [pikchr]
64
- ----
65
- This should raise a syntax error.
66
- ----
67
- eos
68
-
69
- expect {
70
- load_asciidoc doc
71
- }.to raise_error(/error/i)
72
- end
73
- end