jekyll-diagrams 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/CHANGELOG.md +9 -0
- data/README.md +1 -6
- data/jekyll-diagrams.gemspec +13 -10
- data/lib/jekyll/diagrams.rb +2 -7
- data/lib/jekyll/diagrams/{diag.rb → blockdiag.rb} +6 -8
- data/lib/jekyll/diagrams/graphviz.rb +5 -21
- data/lib/jekyll/diagrams/version.rb +1 -1
- metadata +17 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2363c12f9feccc9d62b42b335307218642bbd9f3
|
4
|
+
data.tar.gz: 927580c844617a7c9281e0c92bab521efcfcac29
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 274271edf000544b632ebb574bb6ba056ddb6449478aacda752e5ada3a26487232e5d7b05e708b5e46673f3ca195fa002d7826394a006c0ffc6d5d887f14efb4
|
7
|
+
data.tar.gz: 01a5f3d8a2f589f188281ea4b97b66931b289d6a0aa4aa9be2f9a3e292892409388b3ca03becca9ee98dd34d1ec016d608d2a5e8b2fcabc96d2ffefa0d11da9b
|
data/.gitignore
CHANGED
data/CHANGELOG.md
ADDED
data/README.md
CHANGED
@@ -1,11 +1,6 @@
|
|
1
1
|
# Jekyll Diagrams
|
2
2
|
|
3
3
|
[![Gem Version](https://badge.fury.io/rb/jekyll-diagrams.svg)](https://badge.fury.io/rb/jekyll-diagrams)
|
4
|
-
[![Build Status](https://travis-ci.org/farkasity/jekyll-diagrams.svg?branch=master)](https://travis-ci.org/farkasity/jekyll-diagrams.svg)
|
5
|
-
[![Build status](https://ci.appveyor.com/api/projects/status/f5l7k3971pmjbjcq?svg=true)](https://ci.appveyor.com/project/farkasity/jekyll-diagrams)
|
6
|
-
[![Dependency Status](https://gemnasium.com/farkasity/jekyll-diagrams.svg)](https://gemnasium.com/farkasity/jekyll-diagrams)
|
7
|
-
[![Code Climate](https://codeclimate.com/github/farkasity/jekyll-diagrams/badges/gpa.svg)](https://codeclimate.com/github/farkasity/jekyll-diagrams)
|
8
|
-
[![Inline Docs](https://inch-ci.org/github/farkasity/jekyll-diagrams.svg)](https://inch-ci.org/github/farkasity/jekyll-diagrams)
|
9
4
|
|
10
5
|
Jekyll Diagrams is a jekyll plugins for creating amazing diagrams, including:
|
11
6
|
|
@@ -167,7 +162,7 @@ digraph {
|
|
167
162
|
|
168
163
|
`options` is the command line options, and will be appended to the command. Default is set to '-Tsvg'.
|
169
164
|
|
170
|
-
###
|
165
|
+
### Blockiag
|
171
166
|
|
172
167
|
`options` is the command line options, and will be appended to the command. Default is set to '-Tsvg --nodoctype'.
|
173
168
|
|
data/jekyll-diagrams.gemspec
CHANGED
@@ -1,25 +1,28 @@
|
|
1
1
|
# coding: utf-8
|
2
|
-
|
3
|
-
$LOAD_PATH.unshift
|
2
|
+
|
3
|
+
$LOAD_PATH.unshift File.expand_path('../lib', __FILE__)
|
4
|
+
|
4
5
|
require 'jekyll/diagrams/version'
|
5
6
|
|
6
7
|
Gem::Specification.new do |spec|
|
8
|
+
spec.required_ruby_version = ">= 1.9.3"
|
9
|
+
|
7
10
|
spec.name = "jekyll-diagrams"
|
8
11
|
spec.version = Jekyll::Diagrams::VERSION
|
9
|
-
spec.authors = ["
|
10
|
-
spec.email =
|
12
|
+
spec.authors = ["zhustec"]
|
13
|
+
spec.email = "zhustec@foxmail.com"
|
11
14
|
|
12
|
-
spec.summary = "Jekyll
|
15
|
+
spec.summary = "Jekyll diagrams support"
|
13
16
|
spec.description = "Jekyll plugins for diagrams support, including Graphviz, Blockdiag, Seqdiag and so on."
|
14
|
-
spec.homepage = "https://github.com/
|
17
|
+
spec.homepage = "https://github.com/zhustec/jekyll-diagrams"
|
15
18
|
spec.license = "MIT"
|
16
19
|
|
17
20
|
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
18
21
|
spec.require_paths = ["lib"]
|
19
22
|
|
20
|
-
spec.add_dependency "jekyll", "~> 3.
|
23
|
+
spec.add_dependency "jekyll", "~> 3.6"
|
21
24
|
|
22
|
-
spec.add_development_dependency "bundler", "~> 1.
|
23
|
-
spec.add_development_dependency "rake", "~>
|
24
|
-
spec.add_development_dependency "minitest", "~> 5.
|
25
|
+
spec.add_development_dependency "bundler", "~> 1.15"
|
26
|
+
spec.add_development_dependency "rake", "~> 12.1"
|
27
|
+
spec.add_development_dependency "minitest", "~> 5.1"
|
25
28
|
end
|
data/lib/jekyll/diagrams.rb
CHANGED
@@ -3,7 +3,7 @@ require 'tempfile'
|
|
3
3
|
|
4
4
|
module Jekyll
|
5
5
|
module Diagrams
|
6
|
-
class
|
6
|
+
class BlockdiagBlock < Liquid::Block
|
7
7
|
def initialize(tag_name, text, tokens)
|
8
8
|
super
|
9
9
|
@tag_name = tag_name
|
@@ -12,7 +12,7 @@ module Jekyll
|
|
12
12
|
def render(context)
|
13
13
|
config = context.registers[:site].config["diagrams"]
|
14
14
|
|
15
|
-
@renderer = DiagRenderer.new(config['
|
15
|
+
@renderer = DiagRenderer.new(config['blockdiag'])
|
16
16
|
|
17
17
|
render_diagram(super)
|
18
18
|
end
|
@@ -59,9 +59,7 @@ module Jekyll
|
|
59
59
|
end
|
60
60
|
end
|
61
61
|
|
62
|
-
|
63
|
-
|
64
|
-
Liquid::Template.register_tag
|
65
|
-
|
66
|
-
Liquid::Template.register_tag('rackdiag', Jekyll::Diagrams::DiagBlock)
|
67
|
-
Liquid::Template.register_tag('packetdiag', Jekyll::Diagrams::DiagBlock)
|
62
|
+
|
63
|
+
%w(blockdiag seqdiag actdiag nwdiag rackdiag packetdiag).each do |tag|
|
64
|
+
Liquid::Template.register_tag tag, Jekyll::Diagrams::BlockdiagBlock
|
65
|
+
end
|
@@ -21,12 +21,10 @@ module Jekyll
|
|
21
21
|
|
22
22
|
def render_diagram(code)
|
23
23
|
code = case @tag_name
|
24
|
+
when 'graph', 'digraph'
|
25
|
+
"#@tag_name {\n#{code}\n}"
|
24
26
|
when 'graphviz'
|
25
27
|
code
|
26
|
-
when 'graph'
|
27
|
-
"graph {\n#{code}\n}"
|
28
|
-
when 'digraph'
|
29
|
-
"digraph {\n#{code}\n}"
|
30
28
|
else
|
31
29
|
raise "unknown liquid tag name: #{@tag_name}"
|
32
30
|
end
|
@@ -59,26 +57,12 @@ module Jekyll
|
|
59
57
|
|
60
58
|
svg.force_encoding 'UTF-8'
|
61
59
|
|
62
|
-
svg = strip_metainfo(svg)
|
63
|
-
wrap_div(svg)
|
64
|
-
end
|
65
|
-
|
66
|
-
private
|
67
|
-
|
68
|
-
def strip_metainfo(svg)
|
69
|
-
svg.sub(/(?:.*\n){6}/, '')
|
70
|
-
.sub(%[xmlns="http://www.w3.org/2000/svg"], '')
|
71
|
-
.sub(%[xmlns:xlink="http://www.w3.org/1999/xlink"], '')
|
72
|
-
end
|
73
|
-
|
74
|
-
def wrap_div(svg)
|
75
60
|
"<div class='graphviz'>#{svg}</div>"
|
76
61
|
end
|
77
62
|
end
|
78
63
|
end
|
79
64
|
end
|
80
65
|
|
81
|
-
|
82
|
-
Liquid::Template.register_tag(
|
83
|
-
|
84
|
-
Liquid::Template.register_tag('digraph', Jekyll::Diagrams::GraphvizBlock)
|
66
|
+
%w(graphviz graph digraph).each do |tag|
|
67
|
+
Liquid::Template.register_tag(tag, Jekyll::Diagrams::GraphvizBlock)
|
68
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-diagrams
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
-
|
7
|
+
- zhustec
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-10-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|
@@ -16,60 +16,59 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 3.
|
19
|
+
version: '3.6'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 3.
|
26
|
+
version: '3.6'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '1.
|
33
|
+
version: '1.15'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '1.
|
40
|
+
version: '1.15'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rake
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
47
|
+
version: '12.1'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
54
|
+
version: '12.1'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: minitest
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '5.
|
61
|
+
version: '5.1'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '5.
|
68
|
+
version: '5.1'
|
69
69
|
description: Jekyll plugins for diagrams support, including Graphviz, Blockdiag, Seqdiag
|
70
70
|
and so on.
|
71
|
-
email:
|
72
|
-
- farkasity@gmail.com
|
71
|
+
email: zhustec@foxmail.com
|
73
72
|
executables: []
|
74
73
|
extensions: []
|
75
74
|
extra_rdoc_files: []
|
@@ -78,6 +77,7 @@ files:
|
|
78
77
|
- ".gitignore"
|
79
78
|
- ".rubocop.yml"
|
80
79
|
- ".travis.yml"
|
80
|
+
- CHANGELOG.md
|
81
81
|
- CODE_OF_CONDUCT.md
|
82
82
|
- Gemfile
|
83
83
|
- LICENSE
|
@@ -86,10 +86,10 @@ files:
|
|
86
86
|
- jekyll-diagrams.gemspec
|
87
87
|
- lib/jekyll-diagrams.rb
|
88
88
|
- lib/jekyll/diagrams.rb
|
89
|
-
- lib/jekyll/diagrams/
|
89
|
+
- lib/jekyll/diagrams/blockdiag.rb
|
90
90
|
- lib/jekyll/diagrams/graphviz.rb
|
91
91
|
- lib/jekyll/diagrams/version.rb
|
92
|
-
homepage: https://github.com/
|
92
|
+
homepage: https://github.com/zhustec/jekyll-diagrams
|
93
93
|
licenses:
|
94
94
|
- MIT
|
95
95
|
metadata: {}
|
@@ -101,7 +101,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
101
101
|
requirements:
|
102
102
|
- - ">="
|
103
103
|
- !ruby/object:Gem::Version
|
104
|
-
version:
|
104
|
+
version: 1.9.3
|
105
105
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
106
106
|
requirements:
|
107
107
|
- - ">="
|
@@ -112,6 +112,5 @@ rubyforge_project:
|
|
112
112
|
rubygems_version: 2.5.1
|
113
113
|
signing_key:
|
114
114
|
specification_version: 4
|
115
|
-
summary: Jekyll
|
116
|
-
and so on.
|
115
|
+
summary: Jekyll diagrams support
|
117
116
|
test_files: []
|