jekyll-plantastisch 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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: c27fffc770a9e01100476507c46206d81951e293c4a2eb9a5bdf5e38516b16d8
4
+ data.tar.gz: 5346b7be5c999432a3687a608ae4d22cc691f01aabb18ec55cbb65bce349179a
5
+ SHA512:
6
+ metadata.gz: 35a762c2232c2c6d7575ab241e7f85d6fccedcf057638090e8bf056b64b16c4dcc2530e371158c1cd172043a85b8a437bb43cde51a50204127e6126fef92900f
7
+ data.tar.gz: c34b6dc598970edf3fec7b267ad8e05643b63017a0f5338bd39bff44d18e6f9fed9467a0002cdc56802007ff6fa7b4f3e287f52e3f8e61b2d89d563b0d96c1cf
@@ -0,0 +1,12 @@
1
+ Make sure the title of the issue explains the problem you are having. Also, the description of the issue must clearly explain what is broken, not what you want us to implement. Go through this checklist and make sure you answer "YES" to all points:
2
+
3
+ - You have all pre-requisites listed in README.md installed
4
+ - You are sure that you are not reporting a duplicate (search all issues)
5
+ - You say "is broken" or "doesn't work" in the title
6
+ - You tell us what you are trying to do
7
+ - You explain the results you are getting
8
+ - You suggest an alternative result you would like to see
9
+
10
+ This article will help you understand what we are looking for: http://www.yegor256.com/2014/11/24/principles-of-bug-tracking.html
11
+
12
+ Thank you for your contribution!
@@ -0,0 +1,11 @@
1
+ Many thanks for your contribution, we truly appreciate it. We will appreciate it even more, if you make sure that you can say "YES" to each point in this short checklist:
2
+
3
+ - You made a small amount of changes (less than 100 lines, less than 10 files)
4
+ - You made changes related to only one bug (create separate PRs for separate problems)
5
+ - You are ready to defend your changes (there will be a code review)
6
+ - You don't touch what you don't understand
7
+ - You ran the build locally and it passed
8
+
9
+ This article will help you understand what we are looking for: http://www.yegor256.com/2015/02/09/serious-code-reviewer.html
10
+
11
+ Thank you for your contribution!
data/.gitignore ADDED
@@ -0,0 +1,4 @@
1
+ Gemfile.lock
2
+ *.gem
3
+ .bundle/
4
+ .DS_Store
data/.travis.yml ADDED
@@ -0,0 +1,12 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.2.2
4
+ cache: bundler
5
+ branches:
6
+ only:
7
+ - master
8
+ install:
9
+ - travis_retry bundle install
10
+ script:
11
+ - rake
12
+
data/Gemfile ADDED
@@ -0,0 +1,2 @@
1
+ source 'https://rubygems.org'
2
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ (The MIT License)
2
+
3
+ Copyright (c) 2018 Vagiz Duseev
4
+ Copyright (c) 2014-2017 Yegor Bugayenko
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ of this software and associated documentation files (the 'Software'), to deal
8
+ in the Software without restriction, including without limitation the rights
9
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ copies of the Software, and to permit persons to whom the Software is
11
+ furnished to do so, subject to the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be included in all
14
+ copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,65 @@
1
+ [![Gem Version](https://badge.fury.io/rb/jekyll-plantuml.svg)](http://badge.fury.io/rb/jekyll-plantuml)
2
+
3
+ ## Install Jekyll plugin
4
+
5
+ Install it first:
6
+
7
+ ```
8
+ gem install jekyll-plantuml
9
+ ```
10
+
11
+ With Jekyll 2, simply add the gem to your `_config.yml` gems list:
12
+
13
+ ```yaml
14
+ gems: ['jekyll-plantuml', ... your other plugins]
15
+ ```
16
+
17
+ Or for previous versions,
18
+ create a plugin file within your Jekyll project's `_plugins` directory:
19
+
20
+ ```ruby
21
+ # _plugins/plantuml-plugin.rb
22
+ require "jekyll-plantuml"
23
+ ```
24
+
25
+ Highly recommend to use Bundler. If you're using it, add this line
26
+ to your `Gemfile`:
27
+
28
+ ```
29
+ gem "jekyll-plantuml"
30
+ ```
31
+
32
+ ## Install plantuml.jar
33
+
34
+ Then, make sure [PlantUML](http://plantuml.sourceforge.net/download.html)
35
+ is installed on your build machine, and can
36
+ be executed with a simple `plantuml` command.
37
+
38
+ For Linux user, you could create a `/usr/bin/plantuml` with contents:
39
+
40
+ ```
41
+ #!/bin/bash
42
+
43
+ java -jar /home/user/Downloads/plantuml.jar "$1" "$2"
44
+ ```
45
+
46
+ Remember to change the path to `plantuml.jar` file.
47
+
48
+ Then set executable permission.
49
+
50
+ ```
51
+ chmod +x /usr/bin/plantuml
52
+ ```
53
+
54
+ ## Test
55
+
56
+ Now, it's time to create a diagram, in your Jekyll blog page:
57
+
58
+ ```
59
+ {% plantuml %}
60
+ @startuml
61
+ [First] - [Second]
62
+ @enduml
63
+ {% endplantuml %}
64
+ ```
65
+
data/Rakefile ADDED
@@ -0,0 +1,46 @@
1
+ # (The MIT License)
2
+ #
3
+ # Copyright (c) 2018 Vagiz Duseev
4
+ # Copyright (c) 2014-2017 Yegor Bugayenko
5
+ #
6
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ # of this software and associated documentation files (the 'Software'), to deal
8
+ # in the Software without restriction, including without limitation the rights
9
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ # copies of the Software, and to permit persons to whom the Software is
11
+ # furnished to do so, subject to the following conditions:
12
+ #
13
+ # The above copyright notice and this permission notice shall be included in all
14
+ # copies or substantial portions of the Software.
15
+ #
16
+ # THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ # SOFTWARE.
23
+
24
+ require 'rubygems'
25
+ require 'rake'
26
+ require 'rdoc'
27
+ require 'rake/clean'
28
+
29
+ def name
30
+ @name ||= File.basename(Dir['*.gemspec'].first, '.*')
31
+ end
32
+
33
+ def version
34
+ Gem::Specification.load(Dir['*.gemspec'].first).version
35
+ end
36
+
37
+ task default: [:clean]
38
+
39
+ require 'rdoc/task'
40
+ desc 'Build RDoc documentation'
41
+ Rake::RDocTask.new do |rdoc|
42
+ rdoc.rdoc_dir = 'rdoc'
43
+ rdoc.title = "#{name} #{version}"
44
+ rdoc.rdoc_files.include('README*')
45
+ rdoc.rdoc_files.include('lib/**/*.rb')
46
+ end
@@ -0,0 +1,26 @@
1
+ # coding: utf-8
2
+
3
+ lib = File.expand_path('../lib', __FILE__)
4
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
+ require 'version'
6
+
7
+ Gem::Specification.new do |s|
8
+ s.specification_version = 2 if s.respond_to? :specification_version=
9
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
10
+ s.rubygems_version = '2.2.2'
11
+ s.required_ruby_version = '>= 1.9.3'
12
+ s.name = 'jekyll-plantastisch'
13
+ s.version = PlantUML::VERSION
14
+ s.license = 'MIT'
15
+ s.summary = "Configurable Jekyll PlantUML Tag"
16
+ s.description = "PlantUML diagrams in Jekyll pages"
17
+ s.authors = ["Vagiz Duseev", "Yegor Bugayenko"]
18
+ s.email = 'vagiz@duseev.com'
19
+ s.homepage = 'http://github.com/vduseev/jekyll-plantastisch'
20
+ s.files = `git ls-files`.split($/)
21
+ s.executables = s.files.grep(%r{^bin/}) { |f| File.basename(f) }
22
+ s.test_files = s.files.grep(%r{^(test|spec|features)/})
23
+ s.rdoc_options = ["--charset=UTF-8"]
24
+ s.extra_rdoc_files = %w[README.md LICENSE.txt]
25
+ s.add_runtime_dependency('jekyll', '~> 2.0')
26
+ end
@@ -0,0 +1,60 @@
1
+ # (The MIT License)
2
+ #
3
+ # Copyright (c) 2018 Vagiz Duseev
4
+ # Copyright (c) 2014-2017 Yegor Bugayenko
5
+ #
6
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ # of this software and associated documentation files (the 'Software'), to deal
8
+ # in the Software without restriction, including without limitation the rights
9
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ # copies of the Software, and to permit persons to whom the Software is
11
+ # furnished to do so, subject to the following conditions:
12
+ #
13
+ # The above copyright notice and this permission notice shall be included in all
14
+ # copies or substantial portions of the Software.
15
+ #
16
+ # THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ # SOFTWARE.
23
+
24
+ require 'digest'
25
+ require 'fileutils'
26
+
27
+ module Jekyll
28
+ class PlantumlBlock < Liquid::Block
29
+ def initialize(tag_name, markup, tokens)
30
+ super
31
+ @html = (markup or '').strip
32
+ end
33
+
34
+ def render(context)
35
+ site = context.registers[:site]
36
+ name = Digest::MD5.hexdigest(super)
37
+ if !File.exists?(File.join(site.dest, "uml/#{name}.svg"))
38
+ uml = File.join(site.source, "uml/#{name}.uml")
39
+ svg = File.join(site.source, "uml/#{name}.svg")
40
+ if File.exists?(svg)
41
+ puts "File #{svg} already exists (#{File.size(svg)} bytes)"
42
+ else
43
+ FileUtils.mkdir_p(File.dirname(uml))
44
+ File.open(uml, 'w') { |f|
45
+ f.write(super)
46
+ }
47
+ system("plantuml -tsvg #{uml}")
48
+ site.static_files << Jekyll::StaticFile.new(
49
+ site, site.source, 'uml', "#{name}.svg"
50
+ )
51
+ puts "File #{svg} created (#{File.size(svg)} bytes)"
52
+ end
53
+ end
54
+ "<p><object data='#{site.baseurl}/uml/#{name}.svg' #{@html}
55
+ alt='PlantUML SVG diagram' class='plantuml'/></p>"
56
+ end
57
+ end
58
+ end
59
+
60
+ Liquid::Template.register_tag('plantuml', Jekyll::PlantumlBlock)
data/lib/version.rb ADDED
@@ -0,0 +1,26 @@
1
+ # (The MIT License)
2
+ #
3
+ # Copyright (c) 2018 Vagiz Duseev
4
+ # Copyright (c) 2014-2017 Yegor Bugayenko
5
+ #
6
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ # of this software and associated documentation files (the 'Software'), to deal
8
+ # in the Software without restriction, including without limitation the rights
9
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ # copies of the Software, and to permit persons to whom the Software is
11
+ # furnished to do so, subject to the following conditions:
12
+ #
13
+ # The above copyright notice and this permission notice shall be included in all
14
+ # copies or substantial portions of the Software.
15
+ #
16
+ # THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ # SOFTWARE.
23
+
24
+ module PlantUML
25
+ VERSION = '1.0.0'
26
+ end
metadata ADDED
@@ -0,0 +1,72 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: jekyll-plantastisch
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Vagiz Duseev
8
+ - Yegor Bugayenko
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2018-06-06 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: jekyll
16
+ requirement: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - "~>"
19
+ - !ruby/object:Gem::Version
20
+ version: '2.0'
21
+ type: :runtime
22
+ prerelease: false
23
+ version_requirements: !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - "~>"
26
+ - !ruby/object:Gem::Version
27
+ version: '2.0'
28
+ description: PlantUML diagrams in Jekyll pages
29
+ email: vagiz@duseev.com
30
+ executables: []
31
+ extensions: []
32
+ extra_rdoc_files:
33
+ - README.md
34
+ - LICENSE.txt
35
+ files:
36
+ - ".github/ISSUE_TEMPLATE.md"
37
+ - ".github/PULL_REQUEST_TEMPLATE.md"
38
+ - ".gitignore"
39
+ - ".travis.yml"
40
+ - Gemfile
41
+ - LICENSE.txt
42
+ - README.md
43
+ - Rakefile
44
+ - jekyll-plantastisch.gemspec
45
+ - lib/jekyll-plantastisch.rb
46
+ - lib/version.rb
47
+ homepage: http://github.com/vduseev/jekyll-plantastisch
48
+ licenses:
49
+ - MIT
50
+ metadata: {}
51
+ post_install_message:
52
+ rdoc_options:
53
+ - "--charset=UTF-8"
54
+ require_paths:
55
+ - lib
56
+ required_ruby_version: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - ">="
59
+ - !ruby/object:Gem::Version
60
+ version: 1.9.3
61
+ required_rubygems_version: !ruby/object:Gem::Requirement
62
+ requirements:
63
+ - - ">="
64
+ - !ruby/object:Gem::Version
65
+ version: '0'
66
+ requirements: []
67
+ rubyforge_project:
68
+ rubygems_version: 2.7.3
69
+ signing_key:
70
+ specification_version: 2
71
+ summary: Configurable Jekyll PlantUML Tag
72
+ test_files: []