jekyll-diagrams 0.4.2 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -4
- data/.travis.yml +8 -5
- data/Gemfile +0 -2
- data/README.md +7 -7
- data/Rakefile +3 -3
- data/jekyll-diagrams.gemspec +12 -14
- data/lib/{jekyll/diagrams → jekyll-diagrams}/version.rb +1 -1
- data/test/fixtures/_config.yml +6 -0
- data/test/fixtures/_layouts/default.html +8 -0
- data/test/fixtures/_posts/2019-08-25-blockdiag.md +23 -0
- data/test/fixtures/_posts/2019-08-25-graphviz.md +48 -0
- data/test/jekyll-diagrams_test.rb +25 -0
- data/test/test_helper.rb +18 -0
- metadata +38 -20
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 94652913742bd24e2f69b464a8836a424358ecd5babb10724428b8c3991a70b3
|
4
|
+
data.tar.gz: b6b21032b1dfb7cc19c986cdfcf55d7eeee43d5aa54657a9fb58928965dfad31
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 552cf35767c1a2d057acfd791f819b24050d352b8797a6a9809689ac67be94ea23bec365a006cee4b4807b6a87f728f67e3bf30b5251901d667b487a3174fb5d
|
7
|
+
data.tar.gz: 2565847c3a1fdbd14dc10d574ca9f92d0069010da7748d1d4a6f0be16274a3a5e35f8c1a7c05b4742a39e0e68c9d0ad28ae86869ff1732e2e7a1880580c9505a
|
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
@@ -1,9 +1,12 @@
|
|
1
1
|
language: ruby
|
2
|
+
cache: bundler
|
2
3
|
rvm:
|
3
|
-
- 2.
|
4
|
-
- 2.
|
5
|
-
- 2.
|
4
|
+
- 2.4
|
5
|
+
- 2.5
|
6
|
+
- 2.6
|
6
7
|
|
7
8
|
before_install:
|
8
|
-
-
|
9
|
-
-
|
9
|
+
- sudo apt update && sudo apt install -y graphviz
|
10
|
+
- sudo apt install -y python3 python3-pip python3-setuptools
|
11
|
+
- sudo pip3 install blockdiag seqdiag actdiag nwdiag
|
12
|
+
- gem update --system && gem install bundler
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -2,7 +2,6 @@
|
|
2
2
|
|
3
3
|
[![Travis](https://img.shields.io/travis/zhustec/jekyll-diagrams.svg?style=flat-square)](https://travis-ci.com/zhustec/jekyll-diagrams)
|
4
4
|
[![Gem](https://img.shields.io/gem/v/jekyll-diagrams.svg?style=flat-square)](https://rubygems.org/gems/jekyll-diagrams)
|
5
|
-
[![Coveralls github](https://img.shields.io/coveralls/github/zhustec/jekyll-diagrams/master.svg?style=flat-square)](https://coveralls.io/github/zhustec/jekyll-diagrams)
|
6
5
|
[![Depfu](https://img.shields.io/depfu/zhustec/jekyll-diagrams.svg?style=flat-square)](https://depfu.com/repos/zhustec/jekyll-diagrams)
|
7
6
|
[![license](https://img.shields.io/github/license/zhustec/jekyll-diagrams.svg?style=flat-square)](https://github.com/zhustec/jekyll-diagrams/blob/master/LICENSE)
|
8
7
|
|
@@ -84,7 +83,7 @@ S -> A [label=a];
|
|
84
83
|
S -> B [label=b];
|
85
84
|
A -> D [label=c];
|
86
85
|
B -> D [label=d];
|
87
|
-
{%
|
86
|
+
{% enddigraph %}
|
88
87
|
```
|
89
88
|
|
90
89
|
### Blockdiag
|
@@ -132,14 +131,15 @@ seqdiag {
|
|
132
131
|
|
133
132
|
## Configuration
|
134
133
|
|
135
|
-
|
134
|
+
You need to provide a configuration.
|
135
|
+
A simple configuration is shown below:
|
136
136
|
|
137
137
|
```yaml
|
138
138
|
diagrams:
|
139
139
|
graphviz:
|
140
140
|
engine: dot
|
141
141
|
options: '-Tsvg'
|
142
|
-
|
142
|
+
blockdiag:
|
143
143
|
options: '-Tsvg --nodoctype'
|
144
144
|
```
|
145
145
|
|
@@ -164,11 +164,11 @@ digraph {
|
|
164
164
|
{% endgraphviz %}
|
165
165
|
```
|
166
166
|
|
167
|
-
`options` is the command line options, and will be appended to the command.
|
167
|
+
`options` is the command line options, and will be appended to the command.
|
168
168
|
|
169
|
-
###
|
169
|
+
### Blockdiag
|
170
170
|
|
171
|
-
`options` is the command line options, and will be appended to the command.
|
171
|
+
`options` is the command line options, and will be appended to the command.
|
172
172
|
|
173
173
|
## Contributing
|
174
174
|
|
data/Rakefile
CHANGED
data/jekyll-diagrams.gemspec
CHANGED
@@ -1,30 +1,28 @@
|
|
1
|
-
lib = File.expand_path('
|
1
|
+
lib = File.expand_path('lib', __dir__)
|
2
2
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
3
3
|
|
4
|
-
require 'jekyll
|
4
|
+
require 'jekyll-diagrams/version'
|
5
5
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
|
-
spec.required_ruby_version = '>= 2.3.7'
|
8
|
-
|
9
7
|
spec.name = 'jekyll-diagrams'
|
8
|
+
spec.summary = 'Jekyll plugins for diagrams support'
|
10
9
|
spec.version = Jekyll::Diagrams::VERSION
|
11
10
|
spec.authors = ['zhustec']
|
12
11
|
spec.email = ['zhustec@foxmail.com']
|
13
|
-
|
14
|
-
spec.summary = 'Jekyll plugins for diagrams support'
|
15
|
-
spec.description = 'Jekyll plugins for diagrams support, including Graphviz, Blockdiag, Seqdiag and so on.'
|
16
12
|
spec.homepage = 'https://github.com/zhustec/jekyll-diagrams'
|
17
13
|
spec.license = 'MIT'
|
14
|
+
spec.description = 'Jekyll plugins for diagrams support, including Graphviz, Blockdiag, Seqdiag and so on.'
|
18
15
|
|
19
|
-
spec.files =
|
20
|
-
|
21
|
-
end
|
16
|
+
spec.files = `git ls-files -z`.split("\x0")
|
17
|
+
spec.test_files = spec.files.grep(%r!^(test|spec|features)!)
|
22
18
|
|
23
19
|
spec.require_paths = ['lib']
|
24
20
|
|
25
|
-
spec.
|
21
|
+
spec.required_ruby_version = '>= 2.3.0'
|
22
|
+
|
23
|
+
spec.add_dependency 'jekyll', '>= 3.7', '< 5.0'
|
26
24
|
|
27
|
-
spec.add_development_dependency 'bundler'
|
28
|
-
spec.add_development_dependency 'rake'
|
29
|
-
spec.add_development_dependency 'minitest', '~> 5.
|
25
|
+
spec.add_development_dependency 'bundler'
|
26
|
+
spec.add_development_dependency 'rake'
|
27
|
+
spec.add_development_dependency 'minitest', '~> 5.0'
|
30
28
|
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
---
|
2
|
+
title: A post with blockdiag
|
3
|
+
description: A post with blockdiag
|
4
|
+
layout: default
|
5
|
+
---
|
6
|
+
|
7
|
+
{% blockdiag %}
|
8
|
+
blockdiag {
|
9
|
+
A -> B -> C -> D;
|
10
|
+
A -> E -> F -> G;
|
11
|
+
}
|
12
|
+
{% endblockdiag %}
|
13
|
+
|
14
|
+
{% seqdiag %}
|
15
|
+
seqdiag {
|
16
|
+
browser -> webserver [label = "GET /index.html"];
|
17
|
+
browser <-- webserver;
|
18
|
+
browser -> webserver [label = "POST /blog/comment"];
|
19
|
+
webserver -> database [label = "INSERT comment"];
|
20
|
+
webserver <-- database;
|
21
|
+
browser <-- webserver;
|
22
|
+
}
|
23
|
+
{% endseqdiag %}
|
@@ -0,0 +1,48 @@
|
|
1
|
+
---
|
2
|
+
title: A post with graphviz
|
3
|
+
description: A post with graphviz
|
4
|
+
layout: default
|
5
|
+
---
|
6
|
+
|
7
|
+
{% graphviz %}
|
8
|
+
digraph {
|
9
|
+
node [shape=circle, style=filled];
|
10
|
+
S [fillcolor=green];
|
11
|
+
A [fillcolor=yellow];
|
12
|
+
B [fillcolor=yellow];
|
13
|
+
C [fillcolor=yellow];
|
14
|
+
D [shape=doublecircle, fillcolor=green];
|
15
|
+
S -> A [label=a];
|
16
|
+
S -> B [label=b];
|
17
|
+
A -> D [label=c];
|
18
|
+
B -> D [label=d];
|
19
|
+
}
|
20
|
+
{% endgraphviz %}
|
21
|
+
|
22
|
+
{% digraph %}
|
23
|
+
node [shape=circle, style=filled];
|
24
|
+
S [fillcolor=green];
|
25
|
+
A [fillcolor=yellow];
|
26
|
+
B [fillcolor=yellow];
|
27
|
+
C [fillcolor=yellow];
|
28
|
+
D [shape=doublecircle, fillcolor=green];
|
29
|
+
S -> A [label=a];
|
30
|
+
S -> B [label=b];
|
31
|
+
A -> D [label=c];
|
32
|
+
B -> D [label=d];
|
33
|
+
{% enddigraph %}
|
34
|
+
|
35
|
+
{% graphviz neato %}
|
36
|
+
digraph {
|
37
|
+
node [shape=circle, style=filled];
|
38
|
+
S [fillcolor=green];
|
39
|
+
A [fillcolor=yellow];
|
40
|
+
B [fillcolor=yellow];
|
41
|
+
C [fillcolor=yellow];
|
42
|
+
D [shape=doublecircle, fillcolor=green];
|
43
|
+
S -> A [label=a];
|
44
|
+
S -> B [label=b];
|
45
|
+
A -> D [label=c];
|
46
|
+
B -> D [label=d];
|
47
|
+
}
|
48
|
+
{% endgraphviz %}
|
@@ -0,0 +1,25 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
class TestJekyllDiagrams < Minitest::Test
|
4
|
+
def setup
|
5
|
+
@config = Jekyll.configuration({
|
6
|
+
source: source_dir,
|
7
|
+
destination: dest_dir,
|
8
|
+
url: 'http://example.org'
|
9
|
+
})
|
10
|
+
|
11
|
+
@site = Jekyll::Site.new(@config)
|
12
|
+
@site.process
|
13
|
+
@graphviz_contents = File.read(dest_dir('2019/08/25/graphviz.html'))
|
14
|
+
@blockdiag_contents = File.read(dest_dir('2019/08/25/blockdiag.html'))
|
15
|
+
end
|
16
|
+
|
17
|
+
|
18
|
+
def test_render_graphviz
|
19
|
+
assert_match %r!<div class="graphviz">!, @graphviz_contents
|
20
|
+
end
|
21
|
+
|
22
|
+
def test_render_blockdiag
|
23
|
+
assert_match %r!<div class="diag \w+">!, @blockdiag_contents
|
24
|
+
end
|
25
|
+
end
|
data/test/test_helper.rb
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'jekyll'
|
2
|
+
require 'fileutils'
|
3
|
+
require File.expand_path('../lib/jekyll-diagrams', __dir__)
|
4
|
+
|
5
|
+
Jekyll.logger.log_level = :error
|
6
|
+
|
7
|
+
SOURCE_DIR = File.expand_path("fixtures", __dir__)
|
8
|
+
DEST_DIR = File.expand_path("dest", __dir__)
|
9
|
+
|
10
|
+
def source_dir(*files)
|
11
|
+
File.join(SOURCE_DIR, *files)
|
12
|
+
end
|
13
|
+
|
14
|
+
def dest_dir(*files)
|
15
|
+
File.join(DEST_DIR, *files)
|
16
|
+
end
|
17
|
+
|
18
|
+
require 'minitest/autorun'
|
metadata
CHANGED
@@ -1,71 +1,77 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-diagrams
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- zhustec
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-08-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '3.7'
|
20
|
+
- - "<"
|
18
21
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
22
|
+
version: '5.0'
|
20
23
|
type: :runtime
|
21
24
|
prerelease: false
|
22
25
|
version_requirements: !ruby/object:Gem::Requirement
|
23
26
|
requirements:
|
24
|
-
- - "
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '3.7'
|
30
|
+
- - "<"
|
25
31
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
32
|
+
version: '5.0'
|
27
33
|
- !ruby/object:Gem::Dependency
|
28
34
|
name: bundler
|
29
35
|
requirement: !ruby/object:Gem::Requirement
|
30
36
|
requirements:
|
31
|
-
- - "
|
37
|
+
- - ">="
|
32
38
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
39
|
+
version: '0'
|
34
40
|
type: :development
|
35
41
|
prerelease: false
|
36
42
|
version_requirements: !ruby/object:Gem::Requirement
|
37
43
|
requirements:
|
38
|
-
- - "
|
44
|
+
- - ">="
|
39
45
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
46
|
+
version: '0'
|
41
47
|
- !ruby/object:Gem::Dependency
|
42
48
|
name: rake
|
43
49
|
requirement: !ruby/object:Gem::Requirement
|
44
50
|
requirements:
|
45
|
-
- - "
|
51
|
+
- - ">="
|
46
52
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
53
|
+
version: '0'
|
48
54
|
type: :development
|
49
55
|
prerelease: false
|
50
56
|
version_requirements: !ruby/object:Gem::Requirement
|
51
57
|
requirements:
|
52
|
-
- - "
|
58
|
+
- - ">="
|
53
59
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
60
|
+
version: '0'
|
55
61
|
- !ruby/object:Gem::Dependency
|
56
62
|
name: minitest
|
57
63
|
requirement: !ruby/object:Gem::Requirement
|
58
64
|
requirements:
|
59
65
|
- - "~>"
|
60
66
|
- !ruby/object:Gem::Version
|
61
|
-
version: '5.
|
67
|
+
version: '5.0'
|
62
68
|
type: :development
|
63
69
|
prerelease: false
|
64
70
|
version_requirements: !ruby/object:Gem::Requirement
|
65
71
|
requirements:
|
66
72
|
- - "~>"
|
67
73
|
- !ruby/object:Gem::Version
|
68
|
-
version: '5.
|
74
|
+
version: '5.0'
|
69
75
|
description: Jekyll plugins for diagrams support, including Graphviz, Blockdiag, Seqdiag
|
70
76
|
and so on.
|
71
77
|
email:
|
@@ -82,10 +88,16 @@ files:
|
|
82
88
|
- Rakefile
|
83
89
|
- jekyll-diagrams.gemspec
|
84
90
|
- lib/jekyll-diagrams.rb
|
91
|
+
- lib/jekyll-diagrams/version.rb
|
85
92
|
- lib/jekyll/diagrams.rb
|
86
93
|
- lib/jekyll/diagrams/blockdiag.rb
|
87
94
|
- lib/jekyll/diagrams/graphviz.rb
|
88
|
-
-
|
95
|
+
- test/fixtures/_config.yml
|
96
|
+
- test/fixtures/_layouts/default.html
|
97
|
+
- test/fixtures/_posts/2019-08-25-blockdiag.md
|
98
|
+
- test/fixtures/_posts/2019-08-25-graphviz.md
|
99
|
+
- test/jekyll-diagrams_test.rb
|
100
|
+
- test/test_helper.rb
|
89
101
|
homepage: https://github.com/zhustec/jekyll-diagrams
|
90
102
|
licenses:
|
91
103
|
- MIT
|
@@ -98,7 +110,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
98
110
|
requirements:
|
99
111
|
- - ">="
|
100
112
|
- !ruby/object:Gem::Version
|
101
|
-
version: 2.3.
|
113
|
+
version: 2.3.0
|
102
114
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
103
115
|
requirements:
|
104
116
|
- - ">="
|
@@ -106,8 +118,14 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
106
118
|
version: '0'
|
107
119
|
requirements: []
|
108
120
|
rubyforge_project:
|
109
|
-
rubygems_version: 2.7.6
|
121
|
+
rubygems_version: 2.7.6.2
|
110
122
|
signing_key:
|
111
123
|
specification_version: 4
|
112
124
|
summary: Jekyll plugins for diagrams support
|
113
|
-
test_files:
|
125
|
+
test_files:
|
126
|
+
- test/fixtures/_config.yml
|
127
|
+
- test/fixtures/_layouts/default.html
|
128
|
+
- test/fixtures/_posts/2019-08-25-blockdiag.md
|
129
|
+
- test/fixtures/_posts/2019-08-25-graphviz.md
|
130
|
+
- test/jekyll-diagrams_test.rb
|
131
|
+
- test/test_helper.rb
|