asciidoctor-diagram 2.2.11 → 2.2.12.next1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.adoc +7 -0
- data/lib/asciidoctor-diagram/plantuml/converter.rb +1 -0
- data/lib/asciidoctor-diagram/structurizr/renderers.rb +5 -0
- data/lib/asciidoctor-diagram/version.rb +1 -1
- metadata +5 -132
- data/Rakefile +0 -9
- data/docs/antora.yml +0 -5
- data/docs/modules/ROOT/images/a2s.svg +0 -44
- data/docs/modules/ROOT/images/actdiag.png +0 -0
- data/docs/modules/ROOT/images/asciidoctor-diagram-classes.png +0 -0
- data/docs/modules/ROOT/images/asciidoctor-diagram-process.png +0 -0
- data/docs/modules/ROOT/images/barcode.png +0 -0
- data/docs/modules/ROOT/images/barcode2.png +0 -0
- data/docs/modules/ROOT/images/blockdiag.png +0 -0
- data/docs/modules/ROOT/images/d2.png +0 -0
- data/docs/modules/ROOT/images/lilypond.png +0 -0
- data/docs/modules/ROOT/images/penrose.png +0 -0
- data/docs/modules/ROOT/nav.adoc +0 -41
- data/docs/modules/ROOT/pages/blocks.adoc +0 -140
- data/docs/modules/ROOT/pages/diagram_types/a2s.adoc +0 -47
- data/docs/modules/ROOT/pages/diagram_types/actdiag.adoc +0 -46
- data/docs/modules/ROOT/pages/diagram_types/barcode.adoc +0 -72
- data/docs/modules/ROOT/pages/diagram_types/blockdiag.adoc +0 -38
- data/docs/modules/ROOT/pages/diagram_types/bpmn.adoc +0 -21
- data/docs/modules/ROOT/pages/diagram_types/bytefield.adoc +0 -16
- data/docs/modules/ROOT/pages/diagram_types/d2.adoc +0 -43
- data/docs/modules/ROOT/pages/diagram_types/dbml.adoc +0 -16
- data/docs/modules/ROOT/pages/diagram_types/diagrams.adoc +0 -20
- data/docs/modules/ROOT/pages/diagram_types/ditaa.adoc +0 -31
- data/docs/modules/ROOT/pages/diagram_types/dpic.adoc +0 -16
- data/docs/modules/ROOT/pages/diagram_types/erd.adoc +0 -17
- data/docs/modules/ROOT/pages/diagram_types/gnuplot.adoc +0 -27
- data/docs/modules/ROOT/pages/diagram_types/graphviz.adoc +0 -21
- data/docs/modules/ROOT/pages/diagram_types/lilypond.adoc +0 -27
- data/docs/modules/ROOT/pages/diagram_types/meme.adoc +0 -34
- data/docs/modules/ROOT/pages/diagram_types/mermaid.adoc +0 -28
- data/docs/modules/ROOT/pages/diagram_types/msc.adoc +0 -23
- data/docs/modules/ROOT/pages/diagram_types/nomnoml.adoc +0 -16
- data/docs/modules/ROOT/pages/diagram_types/nwdiag.adoc +0 -22
- data/docs/modules/ROOT/pages/diagram_types/penrose.adoc +0 -50
- data/docs/modules/ROOT/pages/diagram_types/pikchr.adoc +0 -16
- data/docs/modules/ROOT/pages/diagram_types/plantuml.adoc +0 -24
- data/docs/modules/ROOT/pages/diagram_types/seqdiag.adoc +0 -18
- data/docs/modules/ROOT/pages/diagram_types/shaape.adoc +0 -18
- data/docs/modules/ROOT/pages/diagram_types/smcat.adoc +0 -18
- data/docs/modules/ROOT/pages/diagram_types/structurizr.adoc +0 -29
- data/docs/modules/ROOT/pages/diagram_types/svgbob.adoc +0 -21
- data/docs/modules/ROOT/pages/diagram_types/symbolator.adoc +0 -19
- data/docs/modules/ROOT/pages/diagram_types/syntrax.adoc +0 -28
- data/docs/modules/ROOT/pages/diagram_types/tikz.adoc +0 -21
- data/docs/modules/ROOT/pages/diagram_types/umlet.adoc +0 -19
- data/docs/modules/ROOT/pages/diagram_types/vega.adoc +0 -28
- data/docs/modules/ROOT/pages/diagram_types/wavedrom.adoc +0 -17
- data/docs/modules/ROOT/pages/enabling.adoc +0 -25
- data/docs/modules/ROOT/pages/generate.adoc +0 -15
- data/docs/modules/ROOT/pages/index.adoc +0 -12
- data/docs/modules/ROOT/pages/installation.adoc +0 -32
- data/docs/modules/ROOT/pages/output.adoc +0 -19
- data/docs/modules/ROOT/partials/shared-attrs.adoc +0 -12
- data/docs/modules/ROOT/partials/uris.adoc +0 -48
- data/examples/Gemfile +0 -3
- data/examples/README.adoc +0 -18
- data/examples/design.adoc +0 -78
- data/examples/features.adoc +0 -189
- data/spec/a2s_spec.rb +0 -33
- data/spec/barcode_spec.rb +0 -176
- data/spec/blockdiag_spec.rb +0 -20
- data/spec/bpmn_spec.rb +0 -60
- data/spec/bytefield_spec.rb +0 -96
- data/spec/d2_spec.rb +0 -87
- data/spec/dbml_spec.rb +0 -32
- data/spec/diagrams_spec.rb +0 -27
- data/spec/ditaa_spec.rb +0 -191
- data/spec/dpic_spec.rb +0 -23
- data/spec/erd_spec.rb +0 -96
- data/spec/gnuplot_spec.rb +0 -229
- data/spec/graphviz_py_spec.rb +0 -33
- data/spec/graphviz_spec.rb +0 -24
- data/spec/lilypond_spec.rb +0 -17
- data/spec/man.jpg +0 -0
- data/spec/meme_spec.rb +0 -67
- data/spec/mermaid_spec.rb +0 -161
- data/spec/msc_spec.rb +0 -37
- data/spec/nomnoml_spec.rb +0 -36
- data/spec/pikchr_spec.rb +0 -73
- data/spec/plantuml_spec.rb +0 -800
- data/spec/shaape_spec.rb +0 -20
- data/spec/shared_examples.rb +0 -766
- data/spec/smcat_spec.rb +0 -30
- data/spec/structurizr_spec.rb +0 -41
- data/spec/svgbob_spec.rb +0 -33
- data/spec/symbolator_spec.rb +0 -27
- data/spec/syntrax_spec.rb +0 -22
- data/spec/test_helper_methods.rb +0 -118
- data/spec/tikz_spec.rb +0 -181
- data/spec/umlet_spec.rb +0 -32
- data/spec/vega_spec.rb +0 -133
- data/spec/wavedrom_spec.rb +0 -21
data/spec/smcat_spec.rb
DELETED
@@ -1,30 +0,0 @@
|
|
1
|
-
require_relative 'test_helper_methods'
|
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/structurizr_spec.rb
DELETED
@@ -1,41 +0,0 @@
|
|
1
|
-
require_relative 'test_helper_methods'
|
2
|
-
|
3
|
-
STRUCTURIZR_CODE = <<-eos
|
4
|
-
workspace {
|
5
|
-
|
6
|
-
model {
|
7
|
-
user = person "User"
|
8
|
-
softwareSystem = softwareSystem "Software System" {
|
9
|
-
webapp = container "Web Application" {
|
10
|
-
user -> this "Uses"
|
11
|
-
}
|
12
|
-
container "Database" {
|
13
|
-
webapp -> this "Reads from and writes to"
|
14
|
-
}
|
15
|
-
}
|
16
|
-
}
|
17
|
-
|
18
|
-
views {
|
19
|
-
systemContext softwareSystem {
|
20
|
-
include *
|
21
|
-
autolayout lr
|
22
|
-
}
|
23
|
-
|
24
|
-
container softwareSystem {
|
25
|
-
include *
|
26
|
-
autolayout lr
|
27
|
-
}
|
28
|
-
|
29
|
-
theme default
|
30
|
-
}
|
31
|
-
|
32
|
-
}
|
33
|
-
eos
|
34
|
-
|
35
|
-
describe Asciidoctor::Diagram::StructurizrBlockMacroProcessor, :broken_on_windows, :broken_on_github do
|
36
|
-
include_examples "block_macro", :structurizr, STRUCTURIZR_CODE, [:png, :png]
|
37
|
-
end
|
38
|
-
|
39
|
-
describe Asciidoctor::Diagram::StructurizrBlockProcessor, :broken_on_windows, :broken_on_github do
|
40
|
-
include_examples "block", :structurizr, STRUCTURIZR_CODE, [:png, :png]
|
41
|
-
end
|
data/spec/svgbob_spec.rb
DELETED
@@ -1,33 +0,0 @@
|
|
1
|
-
require_relative 'test_helper_methods'
|
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, :txt]
|
29
|
-
end
|
30
|
-
|
31
|
-
describe Asciidoctor::Diagram::SvgBobBlockProcessor do
|
32
|
-
include_examples "block", :svgbob, SVGBOB_CODE, [:svg, :txt]
|
33
|
-
end
|
data/spec/symbolator_spec.rb
DELETED
@@ -1,27 +0,0 @@
|
|
1
|
-
require_relative 'test_helper_methods'
|
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_methods'
|
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_methods.rb
DELETED
@@ -1,118 +0,0 @@
|
|
1
|
-
require 'rspec'
|
2
|
-
|
3
|
-
require 'asciidoctor'
|
4
|
-
require 'asciidoctor/cli/invoker'
|
5
|
-
|
6
|
-
require 'fileutils'
|
7
|
-
require 'stringio'
|
8
|
-
require 'tmpdir'
|
9
|
-
|
10
|
-
require_relative '../lib/asciidoctor-diagram'
|
11
|
-
require_relative '../lib/asciidoctor-diagram/util/platform'
|
12
|
-
require_relative 'shared_examples'
|
13
|
-
|
14
|
-
module Asciidoctor
|
15
|
-
class AbstractBlock
|
16
|
-
def find(&block)
|
17
|
-
blocks.each do |b|
|
18
|
-
if block.call(b)
|
19
|
-
return b
|
20
|
-
end
|
21
|
-
|
22
|
-
if (found_block = b.find(&block))
|
23
|
-
return found_block
|
24
|
-
end
|
25
|
-
end
|
26
|
-
nil
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
|
-
class Table
|
31
|
-
def find(&block)
|
32
|
-
rows.by_section.each do |section, rows|
|
33
|
-
rows.each do |row|
|
34
|
-
row.each do |cell|
|
35
|
-
inner_doc = cell.inner_document
|
36
|
-
if !inner_doc.nil? && found_block = cell.inner_document.find(&block)
|
37
|
-
return found_block
|
38
|
-
end
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|
42
|
-
nil
|
43
|
-
end
|
44
|
-
end
|
45
|
-
end
|
46
|
-
|
47
|
-
module Asciidoctor
|
48
|
-
module Diagram
|
49
|
-
module TestHelpers
|
50
|
-
include ::Asciidoctor::Logging
|
51
|
-
|
52
|
-
def load_asciidoc(source, options = {})
|
53
|
-
options = options.dup
|
54
|
-
options[:trace] = true
|
55
|
-
options[:attributes] ||= {}
|
56
|
-
|
57
|
-
options[:attributes]['phantomjs_19'] = ENV['PHANTOMJS_19']
|
58
|
-
|
59
|
-
options[:attributes]['phantomjs_2'] = ENV['PHANTOMJS_2']
|
60
|
-
|
61
|
-
fontpath = ENV['BLOCKDIAG_FONTPATH']
|
62
|
-
if fontpath
|
63
|
-
options[:attributes]['actdiag-fontpath'] = fontpath
|
64
|
-
options[:attributes]['blockdiag-fontpath'] = fontpath
|
65
|
-
options[:attributes]['seqdiag-fontpath'] = fontpath
|
66
|
-
options[:attributes]['nwdiag-fontpath'] = fontpath
|
67
|
-
options[:attributes]['rackdiag-fontpath'] = fontpath
|
68
|
-
options[:attributes]['packetdiag-fontpath'] = fontpath
|
69
|
-
options[:attributes]['seqdiag-fontpath'] = fontpath
|
70
|
-
end
|
71
|
-
|
72
|
-
unless options[:attributes]['diagram-on-error']
|
73
|
-
options[:attributes]['diagram-on-error'] = 'abort'
|
74
|
-
end
|
75
|
-
|
76
|
-
logger.level = ::Logger::Severity::DEBUG
|
77
|
-
::Asciidoctor.load(StringIO.new(source), options.merge({:trace => true, :verbose => 2}))
|
78
|
-
end
|
79
|
-
end
|
80
|
-
end
|
81
|
-
end
|
82
|
-
|
83
|
-
RSpec.configure do |c|
|
84
|
-
c.formatter = :documentation
|
85
|
-
|
86
|
-
c.include ::Asciidoctor::Diagram::TestHelpers
|
87
|
-
|
88
|
-
case ::Asciidoctor::Diagram::Platform.os
|
89
|
-
when :macosx
|
90
|
-
c.filter_run_excluding :broken_on_osx => true
|
91
|
-
when :windows
|
92
|
-
c.filter_run_excluding :broken_on_windows => true
|
93
|
-
end
|
94
|
-
|
95
|
-
if ENV['GITHUB_ACTIONS']
|
96
|
-
c.filter_run_excluding :broken_on_github => true
|
97
|
-
end
|
98
|
-
|
99
|
-
TEST_DIR = File.expand_path('testing')
|
100
|
-
|
101
|
-
c.before(:suite) do
|
102
|
-
FileUtils.rm_r TEST_DIR if Dir.exist? TEST_DIR
|
103
|
-
FileUtils.mkdir_p TEST_DIR
|
104
|
-
end
|
105
|
-
|
106
|
-
c.around(:each) do |example|
|
107
|
-
metadata = example.metadata
|
108
|
-
group_dir = File.expand_path(metadata[:example_group][:full_description].gsub(/[^\w]+/, '_'), TEST_DIR)
|
109
|
-
FileUtils.mkdir_p(group_dir) unless Dir.exist?(group_dir)
|
110
|
-
|
111
|
-
test_dir = File.expand_path(metadata[:description].gsub(/[^\w]+/, '_'), group_dir)
|
112
|
-
FileUtils.mkdir_p(test_dir) unless Dir.exist?(test_dir)
|
113
|
-
|
114
|
-
Dir.chdir(test_dir) do
|
115
|
-
example.run
|
116
|
-
end
|
117
|
-
end
|
118
|
-
end
|
data/spec/tikz_spec.rb
DELETED
@@ -1,181 +0,0 @@
|
|
1
|
-
require_relative 'test_helper_methods'
|
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_methods'
|
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_methods'
|
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
|
data/spec/wavedrom_spec.rb
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
require_relative 'test_helper_methods'
|
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
|