jekyll-diagrams 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2acdd1cfd11996e6bff65f52ec3b305401bc7bee
4
- data.tar.gz: 41e77e050c03a246f752faa4333db6d4e2e3b09d
3
+ metadata.gz: 2f9a02b6f4fc3193e404f44742644052dc32945c
4
+ data.tar.gz: b48381286520b33e927760edd67fd5cd8449a71f
5
5
  SHA512:
6
- metadata.gz: 69b4859fd220a7efc77d4d218c892bff96d9d3869f1ade3499220161fcff08d7d4d6624db75e44b01b375ae90caef1441b831496fabf77c21379578bc870d6f8
7
- data.tar.gz: a4fe990ece18cca948f9d5ad2cdea1604fedbfd17884ca9d170ff84170fe7ab2aaf75929b47f82720739638b2cfd341c7c7be8a3958a91795d32926b111a3757
6
+ metadata.gz: ba738682197288298ee956e952fee4a5e5aa31b0d19a8d7918c80c42c9c9b318151a160e3d8fceae6995edf157d8723ff3084b7abd862e1682e8bbacc0c93da1
7
+ data.tar.gz: e3a702f169a966278106854b8ae8be7eeef6786471d69e06f017a408a23fde6c9a878cba7915adbae0a27b8911b999818c1c6ce3719ac655825fa319143759c8
data/README.md CHANGED
@@ -1,40 +1,178 @@
1
- # Jekyll::Diagrams
1
+ # Jekyll Diagrams
2
2
 
3
- [![Build Status](https://travis-ci.org/farkasity/jekyll-diagrams.svg?branch=master)](https://travis-ci.org/farkasity/jekyll-diagrams.svg?branch=master)
3
+ [![Build Status](https://travis-ci.org/farkasity/jekyll-diagrams.svg?branch=master)](https://travis-ci.org/farkasity/jekyll-diagrams.svg)
4
4
  [![Build status](https://ci.appveyor.com/api/projects/status/f5l7k3971pmjbjcq?svg=true)](https://ci.appveyor.com/project/farkasity/jekyll-diagrams)
5
5
  [![Dependency Status](https://gemnasium.com/farkasity/jekyll-diagrams.svg)](https://gemnasium.com/farkasity/jekyll-diagrams)
6
6
  [![Code Climate](https://codeclimate.com/github/farkasity/jekyll-diagrams/badges/gpa.svg)](https://codeclimate.com/github/farkasity/jekyll-diagrams)
7
7
  [![Inline Docs](https://inch-ci.org/github/farkasity/jekyll-diagrams.svg)](https://inch-ci.org/github/farkasity/jekyll-diagrams)
8
8
 
9
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/jekyll/diagrams`. To experiment with that code, run `bin/console` for an interactive prompt.
9
+ Jekyll Diagrams is a jekyll plugins for creating amazing diagrams, including:
10
+
11
+ - Graphviz
12
+ - Blockdiag, Seqdiag, Actdiag and Nwdiag
10
13
 
11
14
  ## Installation
12
15
 
13
- Add this line to your application's Gemfile:
16
+ ### When using bundler
17
+
18
+ Add these lines to your application's `Gemfile` file:
14
19
 
15
20
  ```ruby
16
- gem 'jekyll-diagrams'
21
+ group :jekyll_plugins do
22
+ gem 'jekyll-diagrams'
23
+ end
17
24
  ```
18
25
 
19
26
  And then execute:
20
27
 
21
- $ bundle
28
+ ```bash
29
+ $ bundle
30
+ ```
31
+
32
+ ### Or installing manually
22
33
 
23
- Or install it yourself as:
34
+ ```bash
35
+ $ gem install jekyll-diagrams
36
+ ```
24
37
 
25
- $ gem install jekyll-diagrams
38
+ And then add this line to your application's `_config.yml` file:
39
+
40
+ ```yaml
41
+ gems:
42
+ - jekyll-diagrams
43
+ ```
26
44
 
27
45
  ## Usage
28
46
 
29
- ## Development
47
+ ### Graphviz
48
+
49
+ You need first install graphviz with package manager on your system. e.g.
50
+
51
+ * Gentoo Linux : `emerge graphviz`
52
+ * Arch Linux : `pacman -S graphviz`
53
+
54
+ Then you can use `graphviz`, `graph`, and `digraph` Liquid Tag for creating amazing Graphviz images!
55
+
56
+ ```
57
+ {% graphviz %}
58
+ digraph {
59
+ node [shape=circle, style=filled];
60
+ S [fillcolor=green];
61
+ A [fillcolor=yellow];
62
+ B [fillcolor=yellow];
63
+ C [fillcolor=yellow];
64
+ D [shape=doublecircle, fillcolor=green];
65
+ S -> A [label=a];
66
+ S -> B [label=b];
67
+ A -> D [label=c];
68
+ B -> D [label=d];
69
+ }
70
+ {% endgraphviz %}
71
+ ```
72
+
73
+ You can also use `diagraph` and `graph` tag. e.g.
74
+
75
+ ```
76
+ {% digraph %}
77
+ node [shape=circle, style=filled];
78
+ S [fillcolor=green];
79
+ A [fillcolor=yellow];
80
+ B [fillcolor=yellow];
81
+ C [fillcolor=yellow];
82
+ D [shape=doublecircle, fillcolor=green];
83
+ S -> A [label=a];
84
+ S -> B [label=b];
85
+ A -> D [label=c];
86
+ B -> D [label=d];
87
+ {% endgraphviz %}
88
+ ```
89
+
90
+ ### Diag
91
+
92
+ Diag contains:
93
+
94
+ * `blockdiag` : simple block-diagram image generator
95
+ * `seqdiag` : simple sequence-diagram image generator
96
+ * `actdiag` : simple activity-diagram image generator
97
+ * `nwdiag` : simple network-diagram image generators
98
+
99
+ Fisrt you should install them via `pip`:
100
+
101
+ ```bash
102
+ $ pip install blockdiag seqdiag actdiag nwdiag
103
+ ```
104
+
105
+ And set `$PATH` to make sure your system can find it in `$PATH`.
106
+
107
+ Then you can use `blockdiag`, `seqdiag`, `actdiag` and `nwdiag` Liquid Tag. e.g.
108
+
109
+ ```
110
+ {% blockdiag %}
111
+ blockdiag {
112
+ A -> B -> C -> D;
113
+ A -> E -> F -> G;
114
+ }
115
+ {% endblockdiag %}
116
+ ```
117
+
118
+ And `seqdiag`:
119
+
120
+ ```
121
+ {% seqdiag %}
122
+ seqdiag {
123
+ browser -> webserver [label = "GET /index.html"];
124
+ browser <-- webserver;
125
+ browser -> webserver [label = "POST /blog/comment"];
126
+ webserver -> database [label = "INSERT comment"];
127
+ webserver <-- database;
128
+ browser <-- webserver;
129
+ }
130
+ {% endseqdiag %}
131
+ ```
132
+
133
+ ## Configuration
134
+
135
+ A simple configuration shows below:
136
+
137
+ ```yaml
138
+ diagrams:
139
+ graphviz:
140
+ engine: dot
141
+ options: '-Tsvg'
142
+ diag:
143
+ options: '-Tsvg --nodoctype'
144
+ ```
145
+
146
+ ### Graphviz
147
+
148
+ `engine` is the default image render engine. Default is set to `dot`. You can also specify for every single image via:
149
+
150
+ ```
151
+ {% graphviz neato %}
152
+ digraph {
153
+ node [shape=circle, style=filled];
154
+ S [fillcolor=green];
155
+ A [fillcolor=yellow];
156
+ B [fillcolor=yellow];
157
+ C [fillcolor=yellow];
158
+ D [shape=doublecircle, fillcolor=green];
159
+ S -> A [label=a];
160
+ S -> B [label=b];
161
+ A -> D [label=c];
162
+ B -> D [label=d];
163
+ }
164
+ {% endgraphviz %}
165
+ ```
166
+
167
+ `options` is the command line options, and will be appended to the command. Default is set to '-Tsvg'.
30
168
 
31
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
169
+ ### Diag
32
170
 
33
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
171
+ `options` is the command line options, and will be appended to the command. Default is set to '-Tsvg --nodoctype'.
34
172
 
35
173
  ## Contributing
36
174
 
37
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/jekyll-diagrams. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
175
+ Bug reports and pull requests are welcome on GitHub at https://github.com/farkasity/jekyll-diagrams. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
38
176
 
39
177
  ## License
40
178
 
@@ -9,8 +9,8 @@ Gem::Specification.new do |spec|
9
9
  spec.authors = ["farkasity"]
10
10
  spec.email = ["farkasity@gmail.com"]
11
11
 
12
- spec.summary = "Jekyll plugins for diagrams support, including Graphviz."
13
- spec.description = "Jekyll plugins for diagrams support, including Graphviz."
12
+ spec.summary = "Jekyll plugins for diagrams support, including Graphviz, Blockdiag, Seqdiag and so on."
13
+ spec.description = "Jekyll plugins for diagrams support, including Graphviz, Blockdiag, Seqdiag and so on."
14
14
  spec.homepage = "https://github.com/farkasity/jekyll-diagrams"
15
15
  spec.license = "MIT"
16
16
 
@@ -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[@tag_name])
15
+         @renderer = DiagRenderer.new(config['diag'])
16
16
 
17
17
          render_diagram(super)
18
18
        end
@@ -53,7 +53,7 @@ module Jekyll
53
53
  private
54
54
 
55
55
  def wrap_div(svg, engine)
56
- "<div class='#{engine}'>#{svg}</div>"
56
+ "<div class='diag #{engine}'>#{svg}</div>"
57
57
  end
58
58
  end
59
59
  end
@@ -21,15 +21,15 @@ module Jekyll
21
21
 
22
22
        def render_diagram(code)
23
23
          code = case @tag_name
24
-          when 'graphviz'
25
- code
26
-          when 'graph'
27
- "graph {\n#{code}\n}"
28
-          when 'digraph'
29
- "digraph {\n#{code}\n}"
30
-          else
31
- raise "unknown liquid tag name: #{@tag_name}"
32
-          end
24
+         when 'graphviz'
25
+ code
26
+         when 'graph'
27
+ "graph {\n#{code}\n}"
28
+        when 'digraph'
29
+ "digraph {\n#{code}\n}"
30
+        else
31
+ raise "unknown liquid tag name: #{@tag_name}"
32
+         end
33
33
 
34
34
  @renderer.render(code, @engine)
35
35
        end
@@ -66,7 +66,7 @@ module Jekyll
66
66
  private
67
67
 
68
68
  def strip_metainfo(svg)
69
- svg.gsub(/(?:.*\n){4}/, '')
69
+ svg.gsub(/(?:.*\n){6}/, '')
70
70
  end
71
71
 
72
72
  def wrap_div(svg)
@@ -1,5 +1,5 @@
1
1
  module Jekyll
2
2
  module Diagrams
3
- VERSION = "0.1.0"
3
+ VERSION = "0.2.0"
4
4
  end
5
5
  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.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - farkasity
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-25 00:00:00.000000000 Z
11
+ date: 2016-03-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll
@@ -66,7 +66,8 @@ dependencies:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: '5.0'
69
- description: Jekyll plugins for diagrams support, including Graphviz.
69
+ description: Jekyll plugins for diagrams support, including Graphviz, Blockdiag, Seqdiag
70
+ and so on.
70
71
  email:
71
72
  - farkasity@gmail.com
72
73
  executables: []
@@ -109,5 +110,6 @@ rubyforge_project:
109
110
  rubygems_version: 2.5.1
110
111
  signing_key:
111
112
  specification_version: 4
112
- summary: Jekyll plugins for diagrams support, including Graphviz.
113
+ summary: Jekyll plugins for diagrams support, including Graphviz, Blockdiag, Seqdiag
114
+ and so on.
113
115
  test_files: []