octopress-graphviz-tag 1.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.
- checksums.yaml +7 -0
- data/.clash.yml +2 -0
- data/.gitignore +14 -0
- data/.ruby-gemset +1 -0
- data/.ruby-version +1 -0
- data/.travis.yml +5 -0
- data/Gemfile +10 -0
- data/LICENSE.txt +22 -0
- data/README.md +84 -0
- data/Rakefile +2 -0
- data/lib/octopress-graphviz-tag.rb +137 -0
- data/lib/octopress-graphviz-tag/utils.rb +23 -0
- data/lib/octopress-graphviz-tag/version.rb +7 -0
- data/octopress-graphviz-tag.gemspec +27 -0
- data/test/_config.yml +3 -0
- data/test/_expected/index.html +139 -0
- data/test/_site/index.html +139 -0
- data/test/index.md +44 -0
- metadata +135 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 619ba13afeffab7d5bff1140d285538f0ccdc92f
|
4
|
+
data.tar.gz: bf1afe889abf883054c799986ecee500499dbc85
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 997936c1b4bba667b2353b5deeaa10e10c9467a1779c6d1578919788d414332ba35ec783784b0d32dd150c036e27db3d3fca28289aa699bcb34c429974448daa
|
7
|
+
data.tar.gz: df4096a60f294539975f708f45e075dbcbe83c38fc348f5febdadf38ac3a5e36406abd35e231ca9e21896561f415c36ccbac957006780be0c55f4359576fcf1c
|
data/.clash.yml
ADDED
data/.gitignore
ADDED
data/.ruby-gemset
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
blog-ng
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
ruby-2.2.0
|
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2015 Stefano Tortarolo
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,84 @@
|
|
1
|
+
# Octopress Pullquote Tag
|
2
|
+
|
3
|
+
Elegant pull-quotes for Jekyll sites.
|
4
|
+
|
5
|
+
[](https://travis-ci.org/octopress/pullquote-tag)
|
6
|
+
[](https://rubygems.org/gems/octopress-graphviz-tag)
|
7
|
+
[](http://octopress.mit-license.org)
|
8
|
+
|
9
|
+
## Installation
|
10
|
+
|
11
|
+
### Using Bundler
|
12
|
+
|
13
|
+
Add this gem to your site's Gemfile in the `:jekyll_plugins` group:
|
14
|
+
|
15
|
+
group :jekyll_plugins do
|
16
|
+
gem 'octopress-graphviz-tag'
|
17
|
+
end
|
18
|
+
|
19
|
+
Then install the gem with Bundler
|
20
|
+
|
21
|
+
$ bundle
|
22
|
+
|
23
|
+
### Manual Installation
|
24
|
+
|
25
|
+
$ gem install octopress-graphviz-tag
|
26
|
+
|
27
|
+
Then add the gem to your Jekyll configuration.
|
28
|
+
|
29
|
+
gems:
|
30
|
+
-octopress-graphviz-tag
|
31
|
+
|
32
|
+
## Usage
|
33
|
+
|
34
|
+
1. Surround the paragraph you want to quote from with a `{% pullquote %}` tag.
|
35
|
+
2. Surround the quote you want to use with `{"` and `"}`.
|
36
|
+
|
37
|
+
For example:
|
38
|
+
|
39
|
+
```
|
40
|
+
{% pullquote %}
|
41
|
+
When writing long-form posts, I find it helpful to include pull-quotes, which help
|
42
|
+
those scanning a post discern whether or not a post is helpful. It is important to
|
43
|
+
note, {" pull-quotes are merely visual in presentation and should not appear twice in the text. "} That
|
44
|
+
is why it is preferred to use a CSS only technique for styling pull-quotes.
|
45
|
+
{% endpullquote %}
|
46
|
+
```
|
47
|
+
|
48
|
+
This will output the following:
|
49
|
+
|
50
|
+
```html
|
51
|
+
<p><span data-pullquote="pullquotes are merely visual in presentation and should not appear twice in the text."></span>
|
52
|
+
When writing long-form posts, I find it helpful to include pull-quotes, which help
|
53
|
+
those scanning a post discern whether or not a post is helpful. It is important to
|
54
|
+
note, pull-quotes are merely visual in presentation and should not appear twice in the text. That
|
55
|
+
is why it is preferred to use a CSS only technique for styling pull-quotes.</p>
|
56
|
+
```
|
57
|
+
|
58
|
+
### Styling & Classnames
|
59
|
+
|
60
|
+
This plugin does not currently ship with its own CSS for styling. Octopress themes will have styling for this or you may look to [Maykel Loomans](http://miekd.com/articles/pull-quotes-with-html5-and-css/) for inspiration.
|
61
|
+
|
62
|
+
By default pull-quotes will be given the classname `pullquote-right`. For center or left aligned pull quotes, add the alignment to the
|
63
|
+
tag like this.
|
64
|
+
|
65
|
+
```
|
66
|
+
{% pullquote %} #=> class='pullquote-right'
|
67
|
+
{% pullquote left %} #=> class='pullquote-left'
|
68
|
+
{% pullquote center %} #=> class='pullquote-center'
|
69
|
+
```
|
70
|
+
|
71
|
+
Any other text added to the pull-quote tag will be added as a classname too.
|
72
|
+
|
73
|
+
```
|
74
|
+
{% pullquote big %} #=> class='pullquote-right big'
|
75
|
+
{% pullquote left highlight %} #=> class='pullquote-left highlight'
|
76
|
+
```
|
77
|
+
|
78
|
+
## Contributing
|
79
|
+
|
80
|
+
1. Fork it ( https://github.com/octopress/pullquote-tag/fork )
|
81
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
82
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
83
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
84
|
+
5. Create a new Pull Request
|
data/Rakefile
ADDED
@@ -0,0 +1,137 @@
|
|
1
|
+
# -*- coding:utf-8; mode:ruby; -*-
|
2
|
+
require "octopress-graphviz-tag/version"
|
3
|
+
require "octopress-graphviz-tag/utils"
|
4
|
+
|
5
|
+
['open3', 'win32/open3'].each do |lib|
|
6
|
+
begin
|
7
|
+
require lib
|
8
|
+
break
|
9
|
+
rescue LoadError
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
module Jekyll
|
14
|
+
class GraphvizBlock < Liquid::Block
|
15
|
+
DIV_CLASS_ATTR = 'graphviz-wrapper'
|
16
|
+
DEFAULT_GRAPH_NAME = 'Graphviz'
|
17
|
+
DOT_OPTS = '-Tsvg'
|
18
|
+
DOT_EXEC = 'dot'
|
19
|
+
DOT_EXTS = (ENV['PATHEXT'] || '.exe;.bat;.com').split(";")
|
20
|
+
DOT_EXTS.unshift ''
|
21
|
+
DOT_PATH = ENV['PATH'].split(File::PATH_SEPARATOR)
|
22
|
+
.map{|a|File.join a, DOT_EXEC}
|
23
|
+
.map{|a|DOT_EXTS.map{|ex| a+ex}}.flatten
|
24
|
+
.find{|c|File.executable_real? c}
|
25
|
+
raise "not found a executable file: #{DOT_EXEC}" if DOT_PATH.nil?
|
26
|
+
DOT_CMD = "#{DOT_PATH} #{DOT_OPTS}"
|
27
|
+
|
28
|
+
def initialize(tag_name, markup, tokens)
|
29
|
+
super
|
30
|
+
@tag_name = tag_name
|
31
|
+
|
32
|
+
@title = markup or ""
|
33
|
+
@title.strip!
|
34
|
+
|
35
|
+
@src = ""
|
36
|
+
end
|
37
|
+
|
38
|
+
def render(context)
|
39
|
+
code = super
|
40
|
+
title = if @title.empty? then DEFAULT_GRAPH_NAME else @title end
|
41
|
+
|
42
|
+
case @tag_name
|
43
|
+
when 'graphviz' then render_graphviz code
|
44
|
+
when 'graph' then render_graph 'graph', title, code
|
45
|
+
when 'digraph' then render_graph 'digraph', title, code
|
46
|
+
else raise "unknown liquid tag name: #{@tag_name}"
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
def render_graphviz(code)
|
51
|
+
@src = code
|
52
|
+
svg = generate_svg code
|
53
|
+
filter_for_inline_svg svg
|
54
|
+
end
|
55
|
+
|
56
|
+
def filter_for_inline_svg(code)
|
57
|
+
code = remove_declarations code
|
58
|
+
code = remove_xmlns_attrs code
|
59
|
+
code = add_desc_attrs code
|
60
|
+
code = insert_desc_elements code
|
61
|
+
code = wrap_with_div code
|
62
|
+
code = remove_generated_comment code
|
63
|
+
code
|
64
|
+
end
|
65
|
+
|
66
|
+
# Remove version banner
|
67
|
+
def remove_generated_comment(code)
|
68
|
+
code.sub(/<!-- Generated by graphviz version(.*?)-->/im, '')
|
69
|
+
end
|
70
|
+
|
71
|
+
def generate_svg code
|
72
|
+
Open3.popen3( DOT_CMD ) do |stdin, stdout, stderr|
|
73
|
+
stdout.binmode
|
74
|
+
stdin.print code
|
75
|
+
stdin.close
|
76
|
+
|
77
|
+
err = stderr.read
|
78
|
+
if not (err.nil? || err.strip.empty?)
|
79
|
+
raise "Error from #{DOT_CMD}:\n#{err}"
|
80
|
+
end
|
81
|
+
|
82
|
+
svg = stdout.read
|
83
|
+
svg.force_encoding 'UTF-8'
|
84
|
+
|
85
|
+
return svg
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
89
|
+
def remove_declarations(svg)
|
90
|
+
svg.sub(/<!DOCTYPE .+?>/im,'').sub(/<\?xml .+?\?>/im, '')
|
91
|
+
end
|
92
|
+
|
93
|
+
def remove_xmlns_attrs(svg)
|
94
|
+
svg.sub(%[xmlns="http://www.w3.org/2000/svg"], '')
|
95
|
+
.sub(%[xmlns:xlink="http://www.w3.org/1999/xlink"], '')
|
96
|
+
end
|
97
|
+
|
98
|
+
def add_desc_attrs(svg)
|
99
|
+
svg.sub!("<svg", %[<svg aria-label="#{CGI::escapeHTML @title}"])
|
100
|
+
svg.sub!("<svg", %[<svg role="img"])
|
101
|
+
|
102
|
+
return svg
|
103
|
+
end
|
104
|
+
|
105
|
+
def insert_desc_elements(svg)
|
106
|
+
inserted_elements = %[<title>#{CGI::escapeHTML @title}</title>\n]
|
107
|
+
inserted_elements << %[<desc>#{CGI::escapeHTML @src}</desc>\n]
|
108
|
+
svg.sub!(/(<svg [^>]*>)/, "\\1\n#{inserted_elements}")
|
109
|
+
|
110
|
+
return svg
|
111
|
+
end
|
112
|
+
|
113
|
+
def wrap_with_div(svg)
|
114
|
+
%[<div class="#{DIV_CLASS_ATTR}">#{svg}</div>]
|
115
|
+
end
|
116
|
+
|
117
|
+
def render_graph(type, title, code)
|
118
|
+
render_graphviz %[#{type} "#{title}" { #{code} }]
|
119
|
+
end
|
120
|
+
end
|
121
|
+
end
|
122
|
+
|
123
|
+
Liquid::Template.register_tag('graphviz', Jekyll::GraphvizBlock)
|
124
|
+
Liquid::Template.register_tag('graph', Jekyll::GraphvizBlock)
|
125
|
+
Liquid::Template.register_tag('digraph', Jekyll::GraphvizBlock)
|
126
|
+
|
127
|
+
if defined? Octopress::Docs
|
128
|
+
Octopress::Docs.add({
|
129
|
+
name: "Octopress Graphviz Tag",
|
130
|
+
gem: "octopress-graphviz-tag",
|
131
|
+
description: "Graphviz support for Octopress.",
|
132
|
+
path: File.expand_path(File.join(File.dirname(__FILE__), "../")),
|
133
|
+
source_url: "https://github.com/astratto/graphviz-tag",
|
134
|
+
version: Octopress::Tags::Graphviz::VERSION
|
135
|
+
})
|
136
|
+
end
|
137
|
+
|
@@ -0,0 +1,23 @@
|
|
1
|
+
module Octopress
|
2
|
+
module Tags
|
3
|
+
module Graphviz
|
4
|
+
module Utils
|
5
|
+
def self.parse_content(content, context)
|
6
|
+
path = context.environments.first['page']['path']
|
7
|
+
ext = File.extname(path[1..-1])[1..-1]
|
8
|
+
site = context.registers[:site]
|
9
|
+
mdext = site.config['markdown_ext']
|
10
|
+
txext = site.config['textile_ext']
|
11
|
+
|
12
|
+
if mdext.include? ext
|
13
|
+
site.getConverterImpl(Jekyll::Converters::Markdown).convert(content)
|
14
|
+
elsif txext.include? ext
|
15
|
+
site.getConverterImpl(Jekyll::Converters::Textile).convert(content)
|
16
|
+
else
|
17
|
+
"<p>" + content.strip.gsub(/\n\n/, "<p>\n\n</p>") + "</p>"
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'octopress-graphviz-tag/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "octopress-graphviz-tag"
|
8
|
+
spec.version = Octopress::Tags::Graphviz::VERSION
|
9
|
+
spec.authors = ["Stefano Tortarolo"]
|
10
|
+
spec.email = ["stefano.tortarolo@gmail.com"]
|
11
|
+
spec.summary = %q{Graphviz support for Octopress.}
|
12
|
+
spec.homepage = "https://github.com/astratto/graphviz-tag"
|
13
|
+
spec.license = "MIT"
|
14
|
+
|
15
|
+
spec.files = `git ls-files -z`.split("\x0")
|
16
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
17
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
18
|
+
spec.require_paths = ["lib"]
|
19
|
+
|
20
|
+
spec.add_runtime_dependency "jekyll"
|
21
|
+
spec.add_runtime_dependency "rubypants-unicode"
|
22
|
+
|
23
|
+
spec.add_development_dependency "bundler", "~> 1.6"
|
24
|
+
spec.add_development_dependency "rake"
|
25
|
+
spec.add_development_dependency "clash"
|
26
|
+
|
27
|
+
end
|
data/test/_config.yml
ADDED
@@ -0,0 +1,139 @@
|
|
1
|
+
<div class="graphviz-wrapper">
|
2
|
+
|
3
|
+
|
4
|
+
<!-- Title: G Pages: 1 -->
|
5
|
+
<svg role="img" aria-label="<strong><em>A.</em></strong> Example one" width="220pt" height="180pt"
|
6
|
+
viewBox="0.00 0.00 220.00 180.00" >
|
7
|
+
<title><strong><em>A.</em></strong> Example one</title>
|
8
|
+
<desc>
|
9
|
+
digraph G {
|
10
|
+
Graph[bgcolor="transparent", rankdir="LR"];
|
11
|
+
node[style="filled", shape="circle", fillcolor="aliceblue", color="deepskyblue3", penwidth=2];
|
12
|
+
|
13
|
+
subgraph cluster_0 {
|
14
|
+
m1[label="1"];
|
15
|
+
m2[label="2"];
|
16
|
+
m3[label="3", fillcolor="lightskyblue1"];
|
17
|
+
|
18
|
+
m1 -> m2 -> m3;
|
19
|
+
|
20
|
+
penwidth=2;
|
21
|
+
label = "Mainstream";
|
22
|
+
color="deepskyblue1";
|
23
|
+
}
|
24
|
+
|
25
|
+
subgraph cluster_1 {
|
26
|
+
l1[label="1"];
|
27
|
+
l2[label="2"];
|
28
|
+
l3[label="3'", fillcolor="darkseagreen1"];
|
29
|
+
|
30
|
+
l1 -> l2 -> l3;
|
31
|
+
|
32
|
+
penwidth=2;
|
33
|
+
label = "Local";
|
34
|
+
color="darkseagreen2";
|
35
|
+
}
|
36
|
+
}
|
37
|
+
</desc>
|
38
|
+
|
39
|
+
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 176)">
|
40
|
+
<title>G</title>
|
41
|
+
<g id="clust1" class="cluster"><title>cluster_0</title>
|
42
|
+
<polygon fill="none" stroke="#00bfff" stroke-width="2" points="8,-8 8,-82 204,-82 204,-8 8,-8"/>
|
43
|
+
<text text-anchor="middle" x="106" y="-66.8" font-family="Times,serif" font-size="14.00">Mainstream</text>
|
44
|
+
</g>
|
45
|
+
<g id="clust2" class="cluster"><title>cluster_1</title>
|
46
|
+
<polygon fill="none" stroke="#b4eeb4" stroke-width="2" points="8,-90 8,-164 204,-164 204,-90 8,-90"/>
|
47
|
+
<text text-anchor="middle" x="106" y="-148.8" font-family="Times,serif" font-size="14.00">Local</text>
|
48
|
+
</g>
|
49
|
+
<!-- m1 -->
|
50
|
+
<g id="node1" class="node"><title>m1</title>
|
51
|
+
<ellipse fill="aliceblue" stroke="#009acd" stroke-width="2" cx="34" cy="-34" rx="18" ry="18"/>
|
52
|
+
<text text-anchor="middle" x="34" y="-29.8" font-family="Times,serif" font-size="14.00">1</text>
|
53
|
+
</g>
|
54
|
+
<!-- m2 -->
|
55
|
+
<g id="node2" class="node"><title>m2</title>
|
56
|
+
<ellipse fill="aliceblue" stroke="#009acd" stroke-width="2" cx="106" cy="-34" rx="18" ry="18"/>
|
57
|
+
<text text-anchor="middle" x="106" y="-29.8" font-family="Times,serif" font-size="14.00">2</text>
|
58
|
+
</g>
|
59
|
+
<!-- m1->m2 -->
|
60
|
+
<g id="edge1" class="edge"><title>m1->m2</title>
|
61
|
+
<path fill="none" stroke="black" d="M52.3034,-34C60.0173,-34 69.2875,-34 77.8876,-34"/>
|
62
|
+
<polygon fill="black" stroke="black" points="77.8957,-37.5001 87.8957,-34 77.8956,-30.5001 77.8957,-37.5001"/>
|
63
|
+
</g>
|
64
|
+
<!-- m3 -->
|
65
|
+
<g id="node3" class="node"><title>m3</title>
|
66
|
+
<ellipse fill="#b0e2ff" stroke="#009acd" stroke-width="2" cx="178" cy="-34" rx="18" ry="18"/>
|
67
|
+
<text text-anchor="middle" x="178" y="-29.8" font-family="Times,serif" font-size="14.00">3</text>
|
68
|
+
</g>
|
69
|
+
<!-- m2->m3 -->
|
70
|
+
<g id="edge2" class="edge"><title>m2->m3</title>
|
71
|
+
<path fill="none" stroke="black" d="M124.303,-34C132.017,-34 141.288,-34 149.888,-34"/>
|
72
|
+
<polygon fill="black" stroke="black" points="149.896,-37.5001 159.896,-34 149.896,-30.5001 149.896,-37.5001"/>
|
73
|
+
</g>
|
74
|
+
<!-- l1 -->
|
75
|
+
<g id="node4" class="node"><title>l1</title>
|
76
|
+
<ellipse fill="aliceblue" stroke="#009acd" stroke-width="2" cx="34" cy="-116" rx="18" ry="18"/>
|
77
|
+
<text text-anchor="middle" x="34" y="-111.8" font-family="Times,serif" font-size="14.00">1</text>
|
78
|
+
</g>
|
79
|
+
<!-- l2 -->
|
80
|
+
<g id="node5" class="node"><title>l2</title>
|
81
|
+
<ellipse fill="aliceblue" stroke="#009acd" stroke-width="2" cx="106" cy="-116" rx="18" ry="18"/>
|
82
|
+
<text text-anchor="middle" x="106" y="-111.8" font-family="Times,serif" font-size="14.00">2</text>
|
83
|
+
</g>
|
84
|
+
<!-- l1->l2 -->
|
85
|
+
<g id="edge3" class="edge"><title>l1->l2</title>
|
86
|
+
<path fill="none" stroke="black" d="M52.3034,-116C60.0173,-116 69.2875,-116 77.8876,-116"/>
|
87
|
+
<polygon fill="black" stroke="black" points="77.8957,-119.5 87.8957,-116 77.8956,-112.5 77.8957,-119.5"/>
|
88
|
+
</g>
|
89
|
+
<!-- l3 -->
|
90
|
+
<g id="node6" class="node"><title>l3</title>
|
91
|
+
<ellipse fill="#c1ffc1" stroke="#009acd" stroke-width="2" cx="178" cy="-116" rx="18" ry="18"/>
|
92
|
+
<text text-anchor="middle" x="178" y="-111.8" font-family="Times,serif" font-size="14.00">3'</text>
|
93
|
+
</g>
|
94
|
+
<!-- l2->l3 -->
|
95
|
+
<g id="edge4" class="edge"><title>l2->l3</title>
|
96
|
+
<path fill="none" stroke="black" d="M124.303,-116C132.017,-116 141.288,-116 149.888,-116"/>
|
97
|
+
<polygon fill="black" stroke="black" points="149.896,-119.5 159.896,-116 149.896,-112.5 149.896,-119.5"/>
|
98
|
+
</g>
|
99
|
+
</g>
|
100
|
+
</svg>
|
101
|
+
</div>
|
102
|
+
|
103
|
+
<div class="graphviz-wrapper">
|
104
|
+
|
105
|
+
|
106
|
+
<!-- Title: H Pages: 1 -->
|
107
|
+
<svg role="img" aria-label="<strong><em>B.</em></strong> Example two" width="44pt" height="116pt"
|
108
|
+
viewBox="0.00 0.00 44.00 116.00" >
|
109
|
+
<title><strong><em>B.</em></strong> Example two</title>
|
110
|
+
<desc>
|
111
|
+
graph H {
|
112
|
+
node[style="filled", shape="circle", fillcolor="aliceblue", color="deepskyblue3", penwidth=2];
|
113
|
+
|
114
|
+
m1[label="1"];
|
115
|
+
m2[label="2"];
|
116
|
+
m1 -- m2;
|
117
|
+
}
|
118
|
+
</desc>
|
119
|
+
|
120
|
+
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 112)">
|
121
|
+
<title>H</title>
|
122
|
+
<polygon fill="white" stroke="none" points="-4,4 -4,-112 40,-112 40,4 -4,4"/>
|
123
|
+
<!-- m1 -->
|
124
|
+
<g id="node1" class="node"><title>m1</title>
|
125
|
+
<ellipse fill="aliceblue" stroke="#009acd" stroke-width="2" cx="18" cy="-90" rx="18" ry="18"/>
|
126
|
+
<text text-anchor="middle" x="18" y="-85.8" font-family="Times,serif" font-size="14.00">1</text>
|
127
|
+
</g>
|
128
|
+
<!-- m2 -->
|
129
|
+
<g id="node2" class="node"><title>m2</title>
|
130
|
+
<ellipse fill="aliceblue" stroke="#009acd" stroke-width="2" cx="18" cy="-18" rx="18" ry="18"/>
|
131
|
+
<text text-anchor="middle" x="18" y="-13.8" font-family="Times,serif" font-size="14.00">2</text>
|
132
|
+
</g>
|
133
|
+
<!-- m1--m2 -->
|
134
|
+
<g id="edge1" class="edge"><title>m1--m2</title>
|
135
|
+
<path fill="none" stroke="black" d="M18,-71.6966C18,-60.8463 18,-46.9167 18,-36.1043"/>
|
136
|
+
</g>
|
137
|
+
</g>
|
138
|
+
</svg>
|
139
|
+
</div>
|
@@ -0,0 +1,139 @@
|
|
1
|
+
<div class="graphviz-wrapper">
|
2
|
+
|
3
|
+
|
4
|
+
<!-- Title: G Pages: 1 -->
|
5
|
+
<svg role="img" aria-label="<strong><em>A.</em></strong> Example one" width="220pt" height="180pt"
|
6
|
+
viewBox="0.00 0.00 220.00 180.00" >
|
7
|
+
<title><strong><em>A.</em></strong> Example one</title>
|
8
|
+
<desc>
|
9
|
+
digraph G {
|
10
|
+
Graph[bgcolor="transparent", rankdir="LR"];
|
11
|
+
node[style="filled", shape="circle", fillcolor="aliceblue", color="deepskyblue3", penwidth=2];
|
12
|
+
|
13
|
+
subgraph cluster_0 {
|
14
|
+
m1[label="1"];
|
15
|
+
m2[label="2"];
|
16
|
+
m3[label="3", fillcolor="lightskyblue1"];
|
17
|
+
|
18
|
+
m1 -> m2 -> m3;
|
19
|
+
|
20
|
+
penwidth=2;
|
21
|
+
label = "Mainstream";
|
22
|
+
color="deepskyblue1";
|
23
|
+
}
|
24
|
+
|
25
|
+
subgraph cluster_1 {
|
26
|
+
l1[label="1"];
|
27
|
+
l2[label="2"];
|
28
|
+
l3[label="3'", fillcolor="darkseagreen1"];
|
29
|
+
|
30
|
+
l1 -> l2 -> l3;
|
31
|
+
|
32
|
+
penwidth=2;
|
33
|
+
label = "Local";
|
34
|
+
color="darkseagreen2";
|
35
|
+
}
|
36
|
+
}
|
37
|
+
</desc>
|
38
|
+
|
39
|
+
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 176)">
|
40
|
+
<title>G</title>
|
41
|
+
<g id="clust1" class="cluster"><title>cluster_0</title>
|
42
|
+
<polygon fill="none" stroke="#00bfff" stroke-width="2" points="8,-8 8,-82 204,-82 204,-8 8,-8"/>
|
43
|
+
<text text-anchor="middle" x="106" y="-66.8" font-family="Times,serif" font-size="14.00">Mainstream</text>
|
44
|
+
</g>
|
45
|
+
<g id="clust2" class="cluster"><title>cluster_1</title>
|
46
|
+
<polygon fill="none" stroke="#b4eeb4" stroke-width="2" points="8,-90 8,-164 204,-164 204,-90 8,-90"/>
|
47
|
+
<text text-anchor="middle" x="106" y="-148.8" font-family="Times,serif" font-size="14.00">Local</text>
|
48
|
+
</g>
|
49
|
+
<!-- m1 -->
|
50
|
+
<g id="node1" class="node"><title>m1</title>
|
51
|
+
<ellipse fill="aliceblue" stroke="#009acd" stroke-width="2" cx="34" cy="-34" rx="18" ry="18"/>
|
52
|
+
<text text-anchor="middle" x="34" y="-29.8" font-family="Times,serif" font-size="14.00">1</text>
|
53
|
+
</g>
|
54
|
+
<!-- m2 -->
|
55
|
+
<g id="node2" class="node"><title>m2</title>
|
56
|
+
<ellipse fill="aliceblue" stroke="#009acd" stroke-width="2" cx="106" cy="-34" rx="18" ry="18"/>
|
57
|
+
<text text-anchor="middle" x="106" y="-29.8" font-family="Times,serif" font-size="14.00">2</text>
|
58
|
+
</g>
|
59
|
+
<!-- m1->m2 -->
|
60
|
+
<g id="edge1" class="edge"><title>m1->m2</title>
|
61
|
+
<path fill="none" stroke="black" d="M52.3034,-34C60.0173,-34 69.2875,-34 77.8876,-34"/>
|
62
|
+
<polygon fill="black" stroke="black" points="77.8957,-37.5001 87.8957,-34 77.8956,-30.5001 77.8957,-37.5001"/>
|
63
|
+
</g>
|
64
|
+
<!-- m3 -->
|
65
|
+
<g id="node3" class="node"><title>m3</title>
|
66
|
+
<ellipse fill="#b0e2ff" stroke="#009acd" stroke-width="2" cx="178" cy="-34" rx="18" ry="18"/>
|
67
|
+
<text text-anchor="middle" x="178" y="-29.8" font-family="Times,serif" font-size="14.00">3</text>
|
68
|
+
</g>
|
69
|
+
<!-- m2->m3 -->
|
70
|
+
<g id="edge2" class="edge"><title>m2->m3</title>
|
71
|
+
<path fill="none" stroke="black" d="M124.303,-34C132.017,-34 141.288,-34 149.888,-34"/>
|
72
|
+
<polygon fill="black" stroke="black" points="149.896,-37.5001 159.896,-34 149.896,-30.5001 149.896,-37.5001"/>
|
73
|
+
</g>
|
74
|
+
<!-- l1 -->
|
75
|
+
<g id="node4" class="node"><title>l1</title>
|
76
|
+
<ellipse fill="aliceblue" stroke="#009acd" stroke-width="2" cx="34" cy="-116" rx="18" ry="18"/>
|
77
|
+
<text text-anchor="middle" x="34" y="-111.8" font-family="Times,serif" font-size="14.00">1</text>
|
78
|
+
</g>
|
79
|
+
<!-- l2 -->
|
80
|
+
<g id="node5" class="node"><title>l2</title>
|
81
|
+
<ellipse fill="aliceblue" stroke="#009acd" stroke-width="2" cx="106" cy="-116" rx="18" ry="18"/>
|
82
|
+
<text text-anchor="middle" x="106" y="-111.8" font-family="Times,serif" font-size="14.00">2</text>
|
83
|
+
</g>
|
84
|
+
<!-- l1->l2 -->
|
85
|
+
<g id="edge3" class="edge"><title>l1->l2</title>
|
86
|
+
<path fill="none" stroke="black" d="M52.3034,-116C60.0173,-116 69.2875,-116 77.8876,-116"/>
|
87
|
+
<polygon fill="black" stroke="black" points="77.8957,-119.5 87.8957,-116 77.8956,-112.5 77.8957,-119.5"/>
|
88
|
+
</g>
|
89
|
+
<!-- l3 -->
|
90
|
+
<g id="node6" class="node"><title>l3</title>
|
91
|
+
<ellipse fill="#c1ffc1" stroke="#009acd" stroke-width="2" cx="178" cy="-116" rx="18" ry="18"/>
|
92
|
+
<text text-anchor="middle" x="178" y="-111.8" font-family="Times,serif" font-size="14.00">3'</text>
|
93
|
+
</g>
|
94
|
+
<!-- l2->l3 -->
|
95
|
+
<g id="edge4" class="edge"><title>l2->l3</title>
|
96
|
+
<path fill="none" stroke="black" d="M124.303,-116C132.017,-116 141.288,-116 149.888,-116"/>
|
97
|
+
<polygon fill="black" stroke="black" points="149.896,-119.5 159.896,-116 149.896,-112.5 149.896,-119.5"/>
|
98
|
+
</g>
|
99
|
+
</g>
|
100
|
+
</svg>
|
101
|
+
</div>
|
102
|
+
|
103
|
+
<div class="graphviz-wrapper">
|
104
|
+
|
105
|
+
|
106
|
+
<!-- Title: H Pages: 1 -->
|
107
|
+
<svg role="img" aria-label="<strong><em>B.</em></strong> Example two" width="44pt" height="116pt"
|
108
|
+
viewBox="0.00 0.00 44.00 116.00" >
|
109
|
+
<title><strong><em>B.</em></strong> Example two</title>
|
110
|
+
<desc>
|
111
|
+
graph H {
|
112
|
+
node[style="filled", shape="circle", fillcolor="aliceblue", color="deepskyblue3", penwidth=2];
|
113
|
+
|
114
|
+
m1[label="1"];
|
115
|
+
m2[label="2"];
|
116
|
+
m1 -- m2;
|
117
|
+
}
|
118
|
+
</desc>
|
119
|
+
|
120
|
+
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 112)">
|
121
|
+
<title>H</title>
|
122
|
+
<polygon fill="white" stroke="none" points="-4,4 -4,-112 40,-112 40,4 -4,4"/>
|
123
|
+
<!-- m1 -->
|
124
|
+
<g id="node1" class="node"><title>m1</title>
|
125
|
+
<ellipse fill="aliceblue" stroke="#009acd" stroke-width="2" cx="18" cy="-90" rx="18" ry="18"/>
|
126
|
+
<text text-anchor="middle" x="18" y="-85.8" font-family="Times,serif" font-size="14.00">1</text>
|
127
|
+
</g>
|
128
|
+
<!-- m2 -->
|
129
|
+
<g id="node2" class="node"><title>m2</title>
|
130
|
+
<ellipse fill="aliceblue" stroke="#009acd" stroke-width="2" cx="18" cy="-18" rx="18" ry="18"/>
|
131
|
+
<text text-anchor="middle" x="18" y="-13.8" font-family="Times,serif" font-size="14.00">2</text>
|
132
|
+
</g>
|
133
|
+
<!-- m1--m2 -->
|
134
|
+
<g id="edge1" class="edge"><title>m1--m2</title>
|
135
|
+
<path fill="none" stroke="black" d="M18,-71.6966C18,-60.8463 18,-46.9167 18,-36.1043"/>
|
136
|
+
</g>
|
137
|
+
</g>
|
138
|
+
</svg>
|
139
|
+
</div>
|
data/test/index.md
ADDED
@@ -0,0 +1,44 @@
|
|
1
|
+
---
|
2
|
+
---
|
3
|
+
|
4
|
+
{% graphviz <strong><em>A.</em></strong> Example one %}
|
5
|
+
digraph G {
|
6
|
+
Graph[bgcolor="transparent", rankdir="LR"];
|
7
|
+
node[style="filled", shape="circle", fillcolor="aliceblue", color="deepskyblue3", penwidth=2];
|
8
|
+
|
9
|
+
subgraph cluster_0 {
|
10
|
+
m1[label="1"];
|
11
|
+
m2[label="2"];
|
12
|
+
m3[label="3", fillcolor="lightskyblue1"];
|
13
|
+
|
14
|
+
m1 -> m2 -> m3;
|
15
|
+
|
16
|
+
penwidth=2;
|
17
|
+
label = "Mainstream";
|
18
|
+
color="deepskyblue1";
|
19
|
+
}
|
20
|
+
|
21
|
+
subgraph cluster_1 {
|
22
|
+
l1[label="1"];
|
23
|
+
l2[label="2"];
|
24
|
+
l3[label="3'", fillcolor="darkseagreen1"];
|
25
|
+
|
26
|
+
l1 -> l2 -> l3;
|
27
|
+
|
28
|
+
penwidth=2;
|
29
|
+
label = "Local";
|
30
|
+
color="darkseagreen2";
|
31
|
+
}
|
32
|
+
}
|
33
|
+
{% endgraphviz %}
|
34
|
+
|
35
|
+
|
36
|
+
{% graphviz <strong><em>B.</em></strong> Example two %}
|
37
|
+
graph H {
|
38
|
+
node[style="filled", shape="circle", fillcolor="aliceblue", color="deepskyblue3", penwidth=2];
|
39
|
+
|
40
|
+
m1[label="1"];
|
41
|
+
m2[label="2"];
|
42
|
+
m1 -- m2;
|
43
|
+
}
|
44
|
+
{% endgraphviz %}
|
metadata
ADDED
@@ -0,0 +1,135 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: octopress-graphviz-tag
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Stefano Tortarolo
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-02-08 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: jekyll
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rubypants-unicode
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: bundler
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '1.6'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '1.6'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rake
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: clash
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
description:
|
84
|
+
email:
|
85
|
+
- stefano.tortarolo@gmail.com
|
86
|
+
executables: []
|
87
|
+
extensions: []
|
88
|
+
extra_rdoc_files: []
|
89
|
+
files:
|
90
|
+
- ".clash.yml"
|
91
|
+
- ".gitignore"
|
92
|
+
- ".ruby-gemset"
|
93
|
+
- ".ruby-version"
|
94
|
+
- ".travis.yml"
|
95
|
+
- Gemfile
|
96
|
+
- LICENSE.txt
|
97
|
+
- README.md
|
98
|
+
- Rakefile
|
99
|
+
- lib/octopress-graphviz-tag.rb
|
100
|
+
- lib/octopress-graphviz-tag/utils.rb
|
101
|
+
- lib/octopress-graphviz-tag/version.rb
|
102
|
+
- octopress-graphviz-tag.gemspec
|
103
|
+
- test/_config.yml
|
104
|
+
- test/_expected/index.html
|
105
|
+
- test/_site/index.html
|
106
|
+
- test/index.md
|
107
|
+
homepage: https://github.com/astratto/graphviz-tag
|
108
|
+
licenses:
|
109
|
+
- MIT
|
110
|
+
metadata: {}
|
111
|
+
post_install_message:
|
112
|
+
rdoc_options: []
|
113
|
+
require_paths:
|
114
|
+
- lib
|
115
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
116
|
+
requirements:
|
117
|
+
- - ">="
|
118
|
+
- !ruby/object:Gem::Version
|
119
|
+
version: '0'
|
120
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
125
|
+
requirements: []
|
126
|
+
rubyforge_project:
|
127
|
+
rubygems_version: 2.4.5
|
128
|
+
signing_key:
|
129
|
+
specification_version: 4
|
130
|
+
summary: Graphviz support for Octopress.
|
131
|
+
test_files:
|
132
|
+
- test/_config.yml
|
133
|
+
- test/_expected/index.html
|
134
|
+
- test/_site/index.html
|
135
|
+
- test/index.md
|