asciidoctor-diagram 2.2.3 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (114) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.adoc +159 -0
  3. data/README.adoc +17 -13
  4. data/lib/asciidoctor-diagram/a2s/converter.rb +7 -2
  5. data/lib/asciidoctor-diagram/barcode/converter.rb +83 -78
  6. data/lib/asciidoctor-diagram/blockdiag/converter.rb +12 -2
  7. data/lib/asciidoctor-diagram/bpmn/converter.rb +4 -1
  8. data/lib/asciidoctor-diagram/bytefield/converter.rb +4 -1
  9. data/lib/asciidoctor-diagram/d2/converter.rb +57 -0
  10. data/lib/asciidoctor-diagram/d2/extension.rb +18 -0
  11. data/lib/asciidoctor-diagram/d2.rb +8 -0
  12. data/lib/asciidoctor-diagram/dbml/converter.rb +27 -0
  13. data/lib/asciidoctor-diagram/dbml/extension.rb +18 -0
  14. data/lib/asciidoctor-diagram/dbml.rb +8 -0
  15. data/lib/asciidoctor-diagram/diagram_processor.rb +49 -9
  16. data/lib/asciidoctor-diagram/diagram_source.rb +35 -33
  17. data/lib/asciidoctor-diagram/diagrams/converter.rb +4 -1
  18. data/lib/asciidoctor-diagram/ditaa/converter.rb +15 -7
  19. data/lib/asciidoctor-diagram/ditaa/ditaa-2.2.0.jar +0 -0
  20. data/lib/asciidoctor-diagram/dpic/converter.rb +4 -1
  21. data/lib/asciidoctor-diagram/erd/converter.rb +5 -2
  22. data/lib/asciidoctor-diagram/gnuplot/converter.rb +7 -1
  23. data/lib/asciidoctor-diagram/graphviz/converter.rb +4 -1
  24. data/lib/asciidoctor-diagram/graphviz_py/converter.rb +4 -1
  25. data/lib/asciidoctor-diagram/http/converter.rb +16 -7
  26. data/lib/asciidoctor-diagram/http/server.rb +2 -2
  27. data/lib/asciidoctor-diagram/lilypond/converter.rb +3 -2
  28. data/lib/asciidoctor-diagram/meme/converter.rb +29 -3
  29. data/lib/asciidoctor-diagram/mermaid/converter.rb +4 -2
  30. data/lib/asciidoctor-diagram/msc/converter.rb +6 -2
  31. data/lib/asciidoctor-diagram/nomnoml/converter.rb +4 -1
  32. data/lib/asciidoctor-diagram/penrose/converter.rb +53 -0
  33. data/lib/asciidoctor-diagram/penrose/extension.rb +18 -0
  34. data/lib/asciidoctor-diagram/penrose.rb +8 -0
  35. data/lib/asciidoctor-diagram/pikchr/converter.rb +4 -1
  36. data/lib/asciidoctor-diagram/pintora/converter.rb +60 -0
  37. data/lib/asciidoctor-diagram/pintora/extension.rb +18 -0
  38. data/lib/asciidoctor-diagram/pintora.rb +8 -0
  39. data/lib/asciidoctor-diagram/plantuml/converter.rb +256 -43
  40. data/lib/asciidoctor-diagram/plantuml/plantuml-2.2.4.jar +0 -0
  41. data/lib/asciidoctor-diagram/shaape/converter.rb +4 -1
  42. data/lib/asciidoctor-diagram/smcat/converter.rb +5 -1
  43. data/lib/asciidoctor-diagram/structurizr/converter.rb +69 -0
  44. data/lib/asciidoctor-diagram/structurizr/extension.rb +52 -0
  45. data/lib/asciidoctor-diagram/structurizr/renderers.rb +63 -0
  46. data/lib/asciidoctor-diagram/structurizr/structurizr-2.2.2.jar +0 -0
  47. data/lib/asciidoctor-diagram/structurizr.rb +7 -0
  48. data/lib/asciidoctor-diagram/svgbob/converter.rb +6 -2
  49. data/lib/asciidoctor-diagram/symbolator/converter.rb +4 -1
  50. data/lib/asciidoctor-diagram/syntrax/converter.rb +72 -17
  51. data/lib/asciidoctor-diagram/syntrax/syntrax-2.2.0.jar +0 -0
  52. data/lib/asciidoctor-diagram/tikz/converter.rb +5 -2
  53. data/lib/asciidoctor-diagram/umlet/converter.rb +4 -1
  54. data/lib/asciidoctor-diagram/util/base64.rb +25 -0
  55. data/lib/asciidoctor-diagram/util/cli.rb +11 -3
  56. data/lib/asciidoctor-diagram/util/cli_generator.rb +1 -0
  57. data/lib/asciidoctor-diagram/util/java.rb +15 -7
  58. data/lib/asciidoctor-diagram/util/java_jruby.rb +14 -0
  59. data/lib/asciidoctor-diagram/util/java_socket.rb +4 -0
  60. data/lib/asciidoctor-diagram/util/server-2.2.3.jar +0 -0
  61. data/lib/asciidoctor-diagram/util/svg.rb +5 -3
  62. data/lib/asciidoctor-diagram/vega/converter.rb +5 -3
  63. data/lib/asciidoctor-diagram/version.rb +1 -1
  64. data/lib/asciidoctor-diagram/wavedrom/converter.rb +38 -24
  65. data/lib/asciidoctor-diagram.rb +5 -0
  66. metadata +32 -115
  67. data/Rakefile +0 -9
  68. data/docs/antora.yml +0 -3
  69. data/docs/modules/ROOT/images/asciidoctor-diagram-classes.png +0 -0
  70. data/docs/modules/ROOT/images/asciidoctor-diagram-process.png +0 -0
  71. data/docs/modules/ROOT/pages/index.adoc +0 -21
  72. data/docs/modules/ROOT/partials/advanced.adoc +0 -365
  73. data/docs/modules/ROOT/partials/create_diagram.adoc +0 -134
  74. data/docs/modules/ROOT/partials/generate.adoc +0 -15
  75. data/docs/modules/ROOT/partials/installation.adoc +0 -19
  76. data/docs/modules/ROOT/partials/uris.adoc +0 -41
  77. data/examples/Gemfile +0 -3
  78. data/examples/README.adoc +0 -18
  79. data/examples/design.adoc +0 -78
  80. data/examples/features.adoc +0 -189
  81. data/lib/asciidoctor-diagram/ditaa/ditaa-1.3.21.jar +0 -0
  82. data/lib/asciidoctor-diagram/plantuml/plantuml-1.3.21.jar +0 -0
  83. data/lib/asciidoctor-diagram/util/server-1.3.21.jar +0 -0
  84. data/spec/a2s_spec.rb +0 -33
  85. data/spec/barcode_spec.rb +0 -176
  86. data/spec/blockdiag_spec.rb +0 -20
  87. data/spec/bpmn_spec.rb +0 -60
  88. data/spec/bytefield_spec.rb +0 -96
  89. data/spec/diagrams_spec.rb +0 -27
  90. data/spec/ditaa_spec.rb +0 -191
  91. data/spec/dpic_spec.rb +0 -23
  92. data/spec/erd_spec.rb +0 -96
  93. data/spec/gnuplot_spec.rb +0 -229
  94. data/spec/graphviz_py_spec.rb +0 -33
  95. data/spec/graphviz_spec.rb +0 -24
  96. data/spec/lilypond_spec.rb +0 -17
  97. data/spec/man.jpg +0 -0
  98. data/spec/meme_spec.rb +0 -67
  99. data/spec/mermaid_spec.rb +0 -198
  100. data/spec/msc_spec.rb +0 -37
  101. data/spec/nomnoml_spec.rb +0 -36
  102. data/spec/pikchr_spec.rb +0 -73
  103. data/spec/plantuml_spec.rb +0 -772
  104. data/spec/shaape_spec.rb +0 -20
  105. data/spec/shared_examples.rb +0 -764
  106. data/spec/smcat_spec.rb +0 -30
  107. data/spec/svgbob_spec.rb +0 -33
  108. data/spec/symbolator_spec.rb +0 -27
  109. data/spec/syntrax_spec.rb +0 -22
  110. data/spec/test_helper.rb +0 -113
  111. data/spec/tikz_spec.rb +0 -181
  112. data/spec/umlet_spec.rb +0 -32
  113. data/spec/vega_spec.rb +0 -133
  114. data/spec/wavedrom_spec.rb +0 -21
data/spec/smcat_spec.rb DELETED
@@ -1,30 +0,0 @@
1
- require_relative 'test_helper'
2
-
3
- SMCAT_CODE = <<-eos
4
- initial,
5
- doing: entry/ write unit test
6
- do/ write code
7
- exit/ ...,
8
- # smcat recognizes initial
9
- # and final states by name
10
- # and renders them appropriately
11
- final;
12
-
13
- initial => "on backlog" : item adds most value;
14
- "on backlog" => doing : working on it;
15
- doing => testing : built & unit tested;
16
- testing => "on backlog" : test not ok;
17
- testing => final : test ok;
18
- eos
19
-
20
- describe Asciidoctor::Diagram::SmcatInlineMacroProcessor do
21
- include_examples "inline_macro", :smcat, SMCAT_CODE, [:svg]
22
- end
23
-
24
- describe Asciidoctor::Diagram::SmcatBlockMacroProcessor do
25
- include_examples "block_macro", :smcat, SMCAT_CODE, [:svg]
26
- end
27
-
28
- describe Asciidoctor::Diagram::SmcatBlockProcessor do
29
- include_examples "block", :smcat, SMCAT_CODE, [:svg]
30
- end
data/spec/svgbob_spec.rb DELETED
@@ -1,33 +0,0 @@
1
- require_relative 'test_helper'
2
-
3
- SVGBOB_CODE = <<-eos
4
- .--. .---. .---. .---. .---. .---. .---.
5
- | | OS API '---' '---' '---' '---' '---' '---'
6
- v | | | | | | |
7
- .-. .-. .-. | v v | v | v
8
- .-->'-' '-' '-' | .------------. | .-----------. | .-----.
9
- | \\ | / | | Filesystem | | | Scheduler | | | MMU |
10
- | v . v | '------------' | '-----------' | '-----'
11
- '_______/ \\_____| | | | |
12
- \\ / v | | v
13
- | ____ .----. | | .---------.
14
- '--> /___/ | IO |<----' | | Network |
15
- '----' | '---------'
16
- | | |
17
- v v v
18
- .---------------------------------------.
19
- | HAL |
20
- '---------------------------------------'
21
- eos
22
-
23
- describe Asciidoctor::Diagram::SvgBobInlineMacroProcessor do
24
- include_examples "inline_macro", :svgbob, SVGBOB_CODE, [:svg]
25
- end
26
-
27
- describe Asciidoctor::Diagram::SvgBobBlockMacroProcessor do
28
- include_examples "block_macro", :svgbob, SVGBOB_CODE, [:svg]
29
- end
30
-
31
- describe Asciidoctor::Diagram::SvgBobBlockProcessor do
32
- include_examples "block", :svgbob, SVGBOB_CODE, [:svg]
33
- end
@@ -1,27 +0,0 @@
1
- require_relative 'test_helper'
2
-
3
- SYMBOLATOR_CODE = <<-eos
4
- library ieee;
5
- use ieee.std_logic_1164.all;
6
-
7
- package demo is
8
- component demo_device is
9
- generic (
10
- SIZE : positive;
11
- RESET_ACTIVE_LEVEL : std_ulogic := '1'
12
- );
13
- end component;
14
- end package;
15
- eos
16
-
17
- describe Asciidoctor::Diagram::SymbolatorInlineMacroProcessor, :broken_on_windows, :broken_on_github do
18
- include_examples "inline_macro", :symbolator, SYMBOLATOR_CODE, [:png, :svg, :pdf]
19
- end
20
-
21
- describe Asciidoctor::Diagram::SymbolatorBlockMacroProcessor, :broken_on_windows, :broken_on_github do
22
- include_examples "block_macro", :symbolator, SYMBOLATOR_CODE, [:png, :svg, :pdf]
23
- end
24
-
25
- describe Asciidoctor::Diagram::SymbolatorBlockProcessor, :broken_on_windows, :broken_on_github do
26
- include_examples "block", :symbolator, SYMBOLATOR_CODE, [:png, :svg, :pdf]
27
- end
data/spec/syntrax_spec.rb DELETED
@@ -1,22 +0,0 @@
1
- require_relative 'test_helper'
2
-
3
- SYNTRAX_CODE = <<-eos
4
- indentstack(10,
5
- line(opt('-'), choice('0', line('1-9', loop(None, '0-9'))),
6
- opt('.', loop('0-9', None))),
7
-
8
- line(opt(choice('e', 'E'), choice(None, '+', '-'), loop('0-9', None)))
9
- )
10
- eos
11
-
12
- describe Asciidoctor::Diagram::SyntraxInlineMacroProcessor, :broken_on_windows, :broken_on_github do
13
- include_examples "inline_macro", :syntrax, SYNTRAX_CODE, [:png, :svg]
14
- end
15
-
16
- describe Asciidoctor::Diagram::SyntraxBlockMacroProcessor, :broken_on_windows, :broken_on_github do
17
- include_examples "block_macro", :syntrax, SYNTRAX_CODE, [:png, :svg]
18
- end
19
-
20
- describe Asciidoctor::Diagram::SyntraxBlockProcessor, :broken_on_windows, :broken_on_github do
21
- include_examples "block", :syntrax, SYNTRAX_CODE, [:png, :svg]
22
- end
data/spec/test_helper.rb DELETED
@@ -1,113 +0,0 @@
1
- require 'asciidoctor'
2
- require 'asciidoctor/cli/invoker'
3
-
4
- require 'fileutils'
5
- require 'stringio'
6
- require 'tmpdir'
7
-
8
- require_relative '../lib/asciidoctor-diagram'
9
- require_relative '../lib/asciidoctor-diagram/util/platform'
10
- require_relative 'shared_examples'
11
-
12
- module Asciidoctor
13
- class AbstractBlock
14
- def find(&block)
15
- blocks.each do |b|
16
- if block.call(b)
17
- return b
18
- end
19
-
20
- if (found_block = b.find(&block))
21
- return found_block
22
- end
23
- end
24
- nil
25
- end
26
- end
27
-
28
- class Table
29
- def find(&block)
30
- rows.by_section.each do |section, rows|
31
- rows.each do |row|
32
- row.each do |cell|
33
- inner_doc = cell.inner_document
34
- if !inner_doc.nil? && found_block = cell.inner_document.find(&block)
35
- return found_block
36
- end
37
- end
38
- end
39
- end
40
- nil
41
- end
42
- end
43
- end
44
-
45
- module Asciidoctor
46
- module Diagram
47
- module TestHelpers
48
- def load_asciidoc(source, options = {})
49
- options = options.dup
50
- options[:trace] = true
51
- options[:attributes] ||= {}
52
-
53
- options[:attributes]['phantomjs_19'] = ENV['PHANTOMJS_19']
54
-
55
- options[:attributes]['phantomjs_2'] = ENV['PHANTOMJS_2']
56
-
57
- fontpath = ENV['BLOCKDIAG_FONTPATH']
58
- if fontpath
59
- options[:attributes]['actdiag-fontpath'] = fontpath
60
- options[:attributes]['blockdiag-fontpath'] = fontpath
61
- options[:attributes]['seqdiag-fontpath'] = fontpath
62
- options[:attributes]['nwdiag-fontpath'] = fontpath
63
- options[:attributes]['rackdiag-fontpath'] = fontpath
64
- options[:attributes]['packetdiag-fontpath'] = fontpath
65
- options[:attributes]['seqdiag-fontpath'] = fontpath
66
- end
67
-
68
- unless options[:attributes]['diagram-on-error']
69
- options[:attributes]['diagram-on-error'] = 'abort'
70
- end
71
-
72
- ::Asciidoctor.load(StringIO.new(source), options.merge({:trace => true}))
73
- end
74
- end
75
- end
76
- end
77
-
78
- RSpec.configure do |c|
79
- c.formatter = :documentation
80
-
81
- c.include ::Asciidoctor::Diagram::TestHelpers
82
-
83
- case ::Asciidoctor::Diagram::Platform.os
84
- when :macosx
85
- c.filter_run_excluding :broken_on_osx => true
86
- when :windows
87
- c.filter_run_excluding :broken_on_windows => true
88
- end
89
-
90
- if ENV['GITHUB_ACTIONS']
91
- c.filter_run_excluding :broken_on_github => true
92
- end
93
-
94
- TEST_DIR = File.expand_path('testing')
95
-
96
- c.before(:suite) do
97
- FileUtils.rm_r TEST_DIR if Dir.exist? TEST_DIR
98
- FileUtils.mkdir_p TEST_DIR
99
- end
100
-
101
- c.around(:each) do |example|
102
- metadata = example.metadata
103
- group_dir = File.expand_path(metadata[:example_group][:full_description].gsub(/[^\w]+/, '_'), TEST_DIR)
104
- FileUtils.mkdir_p(group_dir) unless Dir.exist?(group_dir)
105
-
106
- test_dir = File.expand_path(metadata[:description].gsub(/[^\w]+/, '_'), group_dir)
107
- FileUtils.mkdir_p(test_dir) unless Dir.exist?(test_dir)
108
-
109
- Dir.chdir(test_dir) do
110
- example.run
111
- end
112
- end
113
- end
data/spec/tikz_spec.rb DELETED
@@ -1,181 +0,0 @@
1
- require_relative 'test_helper'
2
-
3
- TIKZ_CODE = <<-'eos'
4
- \begin{tikzpicture}[font=\LARGE]
5
-
6
- % Figure parameters (tta and k needs to have the same sign)
7
- % They can be modified at will
8
- \def \tta{ -10.00000000000000 } % Defines the first angle of perspective
9
- \def \k{ -3.00000000000000 } % Factor for second angle of perspective
10
- \def \l{ 6.00000000000000 } % Defines the width of the parallelepiped
11
- \def \d{ 5.00000000000000 } % Defines the depth of the parallelepiped
12
- \def \h{ 7.00000000000000 } % Defines the heigth of the parallelepiped
13
-
14
- % The vertices A,B,C,D define the reference plan (vertical)
15
- \coordinate (A) at (0,0);
16
- \coordinate (B) at ({-\h*sin(\tta)},{\h*cos(\tta)});
17
- \coordinate (C) at ({-\h*sin(\tta)-\d*sin(\k*\tta)},
18
- {\h*cos(\tta)+\d*cos(\k*\tta)});
19
- \coordinate (D) at ({-\d*sin(\k*\tta)},{\d*cos(\k*\tta)});
20
-
21
- % The vertices Ap,Bp,Cp,Dp define a plane translated from the
22
- % reference plane by the width of the parallelepiped
23
- \coordinate (Ap) at (\l,0);
24
- \coordinate (Bp) at ({\l-\h*sin(\tta)},{\h*cos(\tta)});
25
- \coordinate (Cp) at ({\l-\h*sin(\tta)-\d*sin(\k*\tta)},
26
- {\h*cos(\tta)+\d*cos(\k*\tta)});
27
- \coordinate (Dp) at ({\l-\d*sin(\k*\tta)},{\d*cos(\k*\tta)});
28
-
29
- % Marking the vertices of the tetrahedron (red)
30
- % and of the parallelepiped (black)
31
- \fill[black] (A) circle [radius=2pt];
32
- \fill[red] (B) circle [radius=2pt];
33
- \fill[black] (C) circle [radius=2pt];
34
- \fill[red] (D) circle [radius=2pt];
35
- \fill[red] (Ap) circle [radius=2pt];
36
- \fill[black] (Bp) circle [radius=2pt];
37
- \fill[red] (Cp) circle [radius=2pt];
38
- \fill[black] (Dp) circle [radius=2pt];
39
-
40
- % painting first the three visible faces of the tetrahedron
41
- \filldraw[draw=red,bottom color=red!50!black, top color=cyan!50]
42
- (B) -- (Cp) -- (D);
43
- \filldraw[draw=red,bottom color=red!50!black, top color=cyan!50]
44
- (B) -- (D) -- (Ap);
45
- \filldraw[draw=red,bottom color=red!50!black, top color=cyan!50]
46
- (B) -- (Cp) -- (Ap);
47
-
48
- % Draw the edges of the tetrahedron
49
- \draw[red,-,very thick] (Ap) -- (D)
50
- (Ap) -- (B)
51
- (Ap) -- (Cp)
52
- (B) -- (D)
53
- (Cp) -- (D)
54
- (B) -- (Cp);
55
-
56
- % Draw the visible edges of the parallelepiped
57
- \draw [-,thin] (B) -- (A)
58
- (Ap) -- (Bp)
59
- (B) -- (C)
60
- (D) -- (C)
61
- (A) -- (D)
62
- (Ap) -- (A)
63
- (Cp) -- (C)
64
- (Bp) -- (B)
65
- (Bp) -- (Cp);
66
-
67
- % Draw the hidden edges of the parallelepiped
68
- \draw [gray,-,thin] (Dp) -- (Cp);
69
- (Dp) -- (D);
70
- (Ap) -- (Dp);
71
-
72
- % Name the vertices (the names are not consistent
73
- % with the node name, but it makes the programming easier)
74
- \draw (Ap) node [right] {$A$}
75
- (Bp) node [right, gray] {$F$}
76
- (Cp) node [right] {$D$}
77
- (C) node [left,gray] {$E$}
78
- (D) node [left] {$B$}
79
- (A) node [left,gray] {$G$}
80
- (B) node [above left=+5pt] {$C$}
81
- (Dp) node [right,gray] {$H$};
82
-
83
- % Drawing again vertex $C$, node (B) because it disappeared behind the edges.
84
- % Drawing again vertex $H$, node (Dp) because it disappeared behind the edges.
85
- \fill[red] (B) circle [radius=2pt];
86
- \fill[gray] (Dp) circle [radius=2pt];
87
-
88
- % From the reference and this example one can easily draw
89
- % the twin tetrahedron jointly to this one.
90
- % Drawing the edges of the twin tetrahedron
91
- % switching the p_s: A <-> Ap, etc...
92
- \draw[red,-,dashed, thin] (A) -- (Dp)
93
- (A) -- (Bp)
94
- (A) -- (C)
95
- (Bp) -- (Dp)
96
- (C) -- (Dp)
97
- (Bp) -- (C);
98
- \end{tikzpicture}
99
- eos
100
-
101
- describe Asciidoctor::Diagram::TikZInlineMacroProcessor, :broken_on_windows do
102
- include_examples "inline_macro", :tikz, TIKZ_CODE, [:pdf]
103
- end
104
-
105
- describe Asciidoctor::Diagram::TikZBlockMacroProcessor, :broken_on_windows do
106
- include_examples "block_macro", :tikz, TIKZ_CODE, [:pdf]
107
- end
108
-
109
- describe Asciidoctor::Diagram::TikZBlockProcessor, :broken_on_windows do
110
- include_examples "block", :tikz, TIKZ_CODE, [:pdf]
111
-
112
- it "should support the preamble attribute" do
113
- File.write("tikz.txt", TIKZ_CODE)
114
-
115
- doc = <<'eos'
116
- = Hello, tikz!
117
- Doc Writer <doc@example.com>
118
-
119
- == First Section
120
-
121
- [tikz, preamble="true"]
122
- ----
123
- \usepackage{tkz-euclide}
124
- \usepackage{etoolbox}
125
- \usepackage{MnSymbol}
126
- \usetikzlibrary{angles,patterns,calc}
127
- \usepackage[most]{tcolorbox}
128
- \usepackage{pgfplots}
129
- \pgfplotsset{compat=1.7}
130
- ~~~~
131
- \begin{tikzpicture}
132
- \tikzset{>=stealth}
133
- % draw axises and labels. We store a single coordinate to have the
134
- % direction of the x axis
135
- \draw[->] (-4,0) -- ++(8,0) coordinate (X) node[below] {$x$};
136
- \draw[->] (0,-4) -- ++(0,8) node[left] {$y$};
137
-
138
- \newcommand\CircleRadius{3cm}
139
- \draw (0,0) circle (\CircleRadius);
140
- % special method of noting the position of a point
141
- \coordinate (P) at (-495:\CircleRadius);
142
-
143
- \draw[thick]
144
- (0,0)
145
- coordinate (O) % store origin
146
- node[] {} % label
147
- --
148
- node[below left, pos=1] {$P(-\frac{\sqrt{2}}{2}, -\frac{\sqrt{2}}{2})$} % some labels
149
- node[below right, midway] {$r$}
150
- (P)
151
- --
152
- node[midway,left] {$y$}
153
- (P |- O) coordinate (Px) % projection onto horizontal line through
154
- % O, saved for later
155
- --
156
- node[midway, below] {$x$}
157
- cycle % closed path
158
-
159
- % pic trick is from the angles library, requires the three points of
160
- % the marked angle to be named
161
-
162
- pic [] {angle=X--O--P};
163
- \draw[->,red] (5mm, 0mm) arc (0:-495:5mm) node[midway,xshift=-4mm,yshift=3.5mm] {$-495^\circ$};
164
- % right angle marker
165
- \draw ($(Px)+(0.3, 0)$) -- ++(0, -0.3) -- ++(-0.3,0);
166
- \end{tikzpicture}
167
- ----
168
- eos
169
-
170
- d = load_asciidoc doc
171
- expect(d).to_not be_nil
172
-
173
- b = d.find { |bl| bl.context == :image }
174
- expect(b).to_not be_nil
175
-
176
- expect(b.content_model).to eq :empty
177
-
178
- target = b.attributes['target']
179
- expect(target).to_not be_nil
180
- end
181
- end
data/spec/umlet_spec.rb DELETED
@@ -1,32 +0,0 @@
1
- require_relative 'test_helper'
2
-
3
- CODE = <<-eos
4
- <?xml version="1.0" encoding="UTF-8" standalone="no"?>
5
- <diagram program="umlet" version="14.2">
6
- <zoom_level>10</zoom_level>
7
- <element>
8
- <id>UMLActor</id>
9
- <coordinates>
10
- <x>20</x>
11
- <y>20</y>
12
- <w>60</w>
13
- <h>120</h>
14
- </coordinates>
15
- <panel_attributes>Hello
16
- AsciiDoc</panel_attributes>
17
- <additional_attributes/>
18
- </element>
19
- </diagram>
20
- eos
21
-
22
- describe Asciidoctor::Diagram::UmletInlineMacroProcessor do
23
- include_examples "inline_macro", :umlet, CODE, [:svg]
24
- end
25
-
26
- describe Asciidoctor::Diagram::UmletBlockMacroProcessor do
27
- include_examples "block_macro", :umlet, CODE, [:svg]
28
- end
29
-
30
- describe Asciidoctor::Diagram::UmletBlockProcessor do
31
- include_examples "block", :umlet, CODE, [:svg]
32
- end
data/spec/vega_spec.rb DELETED
@@ -1,133 +0,0 @@
1
- require_relative 'test_helper'
2
-
3
- VEGA_CODE = <<-eos
4
- {
5
- "$schema": "https://vega.github.io/schema/vega/v3.json",
6
- "width": 400,
7
- "height": 200,
8
- "padding": 5,
9
-
10
- "data": [
11
- {
12
- "name": "table",
13
- "values": [
14
- {"category": "A", "amount": 28},
15
- {"category": "B", "amount": 55},
16
- {"category": "C", "amount": 43},
17
- {"category": "D", "amount": 91},
18
- {"category": "E", "amount": 81},
19
- {"category": "F", "amount": 53},
20
- {"category": "G", "amount": 19},
21
- {"category": "H", "amount": 87}
22
- ]
23
- }
24
- ],
25
-
26
- "signals": [
27
- {
28
- "name": "tooltip",
29
- "value": {},
30
- "on": [
31
- {"events": "rect:mouseover", "update": "datum"},
32
- {"events": "rect:mouseout", "update": "{}"}
33
- ]
34
- }
35
- ],
36
-
37
- "scales": [
38
- {
39
- "name": "xscale",
40
- "type": "band",
41
- "domain": {"data": "table", "field": "category"},
42
- "range": "width",
43
- "padding": 0.05,
44
- "round": true
45
- },
46
- {
47
- "name": "yscale",
48
- "domain": {"data": "table", "field": "amount"},
49
- "nice": true,
50
- "range": "height"
51
- }
52
- ],
53
-
54
- "axes": [
55
- { "orient": "bottom", "scale": "xscale" },
56
- { "orient": "left", "scale": "yscale" }
57
- ],
58
-
59
- "marks": [
60
- {
61
- "type": "rect",
62
- "from": {"data":"table"},
63
- "encode": {
64
- "enter": {
65
- "x": {"scale": "xscale", "field": "category"},
66
- "width": {"scale": "xscale", "band": 1},
67
- "y": {"scale": "yscale", "field": "amount"},
68
- "y2": {"scale": "yscale", "value": 0}
69
- },
70
- "update": {
71
- "fill": {"value": "steelblue"}
72
- },
73
- "hover": {
74
- "fill": {"value": "red"}
75
- }
76
- }
77
- },
78
- {
79
- "type": "text",
80
- "encode": {
81
- "enter": {
82
- "align": {"value": "center"},
83
- "baseline": {"value": "bottom"},
84
- "fill": {"value": "#333"}
85
- },
86
- "update": {
87
- "x": {"scale": "xscale", "signal": "tooltip.category", "band": 0.5},
88
- "y": {"scale": "yscale", "signal": "tooltip.amount", "offset": -2},
89
- "text": {"signal": "tooltip.amount"},
90
- "fillOpacity": [
91
- {"test": "datum === tooltip", "value": 0},
92
- {"value": 1}
93
- ]
94
- }
95
- }
96
- }
97
- ]
98
- }
99
- eos
100
-
101
- VEGALITE_CODE = <<-eos
102
- {
103
- "$schema": "https://vega.github.io/schema/vega-lite/v2.json",
104
- "description": "A simple bar chart with embedded data.",
105
- "data": {
106
- "values": [
107
- {"a": "A","b": 28}, {"a": "B","b": 55}, {"a": "C","b": 43},
108
- {"a": "D","b": 91}, {"a": "E","b": 81}, {"a": "F","b": 53},
109
- {"a": "G","b": 19}, {"a": "H","b": 87}, {"a": "I","b": 52}
110
- ]
111
- },
112
- "mark": "bar",
113
- "encoding": {
114
- "x": {"field": "a", "type": "ordinal"},
115
- "y": {"field": "b", "type": "quantitative"}
116
- }
117
- }
118
- eos
119
-
120
- describe Asciidoctor::Diagram::VegaInlineMacroProcessor, :broken_on_windows do
121
- include_examples "inline_macro", :vega, VEGA_CODE, [:svg]
122
- # include_examples "inline_macro", :vegalite, VEGALITE_CODE, [:svg]
123
- end
124
-
125
- describe Asciidoctor::Diagram::VegaBlockMacroProcessor, :broken_on_windows do
126
- include_examples "block_macro", :vega, VEGA_CODE, [:svg]
127
- # include_examples "block_macro", :vegalite, VEGALITE_CODE, [:svg]
128
- end
129
-
130
- describe Asciidoctor::Diagram::VegaBlockProcessor, :broken_on_windows do
131
- include_examples "block", :vega, VEGA_CODE, [:svg]
132
- # include_examples "block", :vegalite, VEGALITE_CODE, [:svg]
133
- end
@@ -1,21 +0,0 @@
1
- require_relative 'test_helper'
2
-
3
- WAVEDROM_CODE = <<-eos
4
- { signal : [
5
- { name: "clk", wave: "p......" },
6
- { name: "bus", wave: "x.34.5x", data: "head body tail" },
7
- { name: "wire", wave: "0.1..0." },
8
- ]}
9
- eos
10
-
11
- describe Asciidoctor::Diagram::WavedromInlineMacroProcessor, :broken_on_windows, :broken_on_github do
12
- include_examples "inline_macro", :wavedrom, WAVEDROM_CODE, [:png, :svg]
13
- end
14
-
15
- describe Asciidoctor::Diagram::WavedromBlockMacroProcessor, :broken_on_windows, :broken_on_github do
16
- include_examples "block_macro", :wavedrom, WAVEDROM_CODE, [:png, :svg]
17
- end
18
-
19
- describe Asciidoctor::Diagram::WavedromBlockProcessor, :broken_on_windows, :broken_on_github do
20
- include_examples "block", :wavedrom, WAVEDROM_CODE, [:png, :svg]
21
- end