jekyll-kroki 0.3.3 → 0.5.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 +4 -4
- data/.devcontainer/devcontainer.json +2 -1
- data/.rubocop.yml +13 -2
- data/README.md +14 -4
- data/jekyll-kroki.gemspec +11 -6
- data/lib/jekyll/kroki/version.rb +1 -1
- data/lib/jekyll/kroki.rb +121 -53
- metadata +61 -8
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 39c2c3f9463c5788864d00c4ed80e9aa826a1aa1d1380dbff2be92407958f0e5
|
|
4
|
+
data.tar.gz: 38340a5a1deaa705a0b7cde596e5eb007da3d84526b2641e9cad6e9f38e86809
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: dbedea8bbf380c047c91cee38bc7fade0c9a6a0e3aa8735b7a18e3361219cb796fb3b89b17583db402f0b03bf083f13892d53a7677cc904d12f6be6990bfee98
|
|
7
|
+
data.tar.gz: 6c3cf11ca513c6b16331547bcd69003b77dd62c3a09b46c52e440684a5001f8c47318962037faa3a0bce5cf1e99c2dfe4a2f5f4e00f4bc0eb893ef0fb174efa6
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "Ruby",
|
|
3
|
-
"image": "mcr.microsoft.com/devcontainers/ruby:3.
|
|
3
|
+
"image": "mcr.microsoft.com/devcontainers/ruby:3.4-bullseye",
|
|
4
4
|
"customizations": {
|
|
5
5
|
"vscode": {
|
|
6
6
|
"extensions": [
|
|
7
|
+
"GitHub.vscode-github-actions",
|
|
7
8
|
"streetsidesoftware.code-spell-checker"
|
|
8
9
|
]
|
|
9
10
|
}
|
data/.rubocop.yml
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
|
+
plugins:
|
|
2
|
+
- rubocop-minitest
|
|
3
|
+
- rubocop-performance
|
|
4
|
+
- rubocop-rake
|
|
5
|
+
|
|
1
6
|
AllCops:
|
|
2
|
-
|
|
7
|
+
NewCops: enable
|
|
8
|
+
TargetRubyVersion: 2.7
|
|
9
|
+
|
|
10
|
+
Gemspec/DevelopmentDependencies:
|
|
11
|
+
EnforcedStyle: gemspec
|
|
3
12
|
|
|
4
13
|
Style/StringLiterals:
|
|
5
14
|
Enabled: true
|
|
@@ -11,5 +20,7 @@ Style/StringLiteralsInInterpolation:
|
|
|
11
20
|
|
|
12
21
|
Layout/LineLength:
|
|
13
22
|
Max: 120
|
|
23
|
+
Metrics/ClassLength:
|
|
24
|
+
Max: 120
|
|
14
25
|
Metrics/MethodLength:
|
|
15
|
-
Max:
|
|
26
|
+
Max: 16
|
data/README.md
CHANGED
|
@@ -32,7 +32,7 @@ When Jekyll builds your site, the `jekyll-kroki` plugin will encode the diagrams
|
|
|
32
32
|
|
|
33
33
|

|
|
34
34
|
|
|
35
|
-
The site remains
|
|
35
|
+
The site remains fully static as the images are directly embedded in the HTML files served by Jekyll. Jekyll only depends on the Kroki server - which can also be run locally - during the build stage, and all of the client-side processing that is normally used to render diagrams into images is eliminated.
|
|
36
36
|
|
|
37
37
|
### Advantages
|
|
38
38
|
|
|
@@ -49,15 +49,25 @@ The server-side nature of Kroki means that you don't have to deal with installin
|
|
|
49
49
|
Kroki is available either as a free service or self-hosted using Docker. Organisations that frequently build large Jekyll sites with many diagrams or want maximum control over their data have the option of running their own Kroki instance to provide consistency and use compute resources efficiently.
|
|
50
50
|
|
|
51
51
|
### Configuration
|
|
52
|
-
You can specify the
|
|
52
|
+
You can specify the following parameters in the Jekyll `_config.yml` file:
|
|
53
|
+
|
|
54
|
+
| Parameter | Default value | Description |
|
|
55
|
+
| --------- | ------------- | ----------- |
|
|
56
|
+
| `url` | `https://kroki.io` | The URL of the Kroki instance to use |
|
|
57
|
+
| `http_retries` | `3` | The number of HTTP retries |
|
|
58
|
+
| `http_timeout` | `15` | The HTTP timeout value in seconds |
|
|
59
|
+
| `max_concurrent_docs` | `8` | The maximum number of Jekyll documents to render concurrently |
|
|
60
|
+
|
|
61
|
+
For example:
|
|
53
62
|
|
|
54
63
|
```yaml
|
|
55
64
|
kroki:
|
|
56
65
|
url: "https://my-kroki.server"
|
|
66
|
+
http_retries: 3
|
|
67
|
+
http_timeout: 15
|
|
68
|
+
max_concurrent_docs: 8
|
|
57
69
|
```
|
|
58
70
|
|
|
59
|
-
This is useful if you want to run a Kroki instance locally or your organisation maintains its own private Kroki server. The public Kroki instance https://kroki.io is used by default.
|
|
60
|
-
|
|
61
71
|
### Security
|
|
62
72
|
Embedding diagrams as SVGs directly within HTML files can be dangerous. You should only use a Kroki instance that you trust (or run your own!). For additional security, you can configure a [Content Security Policy (CSP)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP) using custom Webrick headers in the Jekyll `_config.yml` file:
|
|
63
73
|
|
data/jekyll-kroki.gemspec
CHANGED
|
@@ -12,10 +12,11 @@ Gem::Specification.new do |spec|
|
|
|
12
12
|
languages into images using Kroki"
|
|
13
13
|
spec.homepage = "https://github.com/felixvanoost/jekyll-kroki"
|
|
14
14
|
spec.license = "MIT"
|
|
15
|
-
spec.required_ruby_version = ">= 2.
|
|
15
|
+
spec.required_ruby_version = ">= 2.7.0"
|
|
16
16
|
|
|
17
17
|
spec.metadata["homepage_uri"] = spec.homepage
|
|
18
18
|
spec.metadata["source_code_uri"] = spec.homepage
|
|
19
|
+
spec.metadata["rubygems_mfa_required"] = "true"
|
|
19
20
|
|
|
20
21
|
# Load the files that are versioned in Git into the RubyGem.
|
|
21
22
|
spec.files = Dir.chdir(__dir__) do
|
|
@@ -28,13 +29,17 @@ Gem::Specification.new do |spec|
|
|
|
28
29
|
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
|
29
30
|
spec.require_paths = ["lib"]
|
|
30
31
|
|
|
31
|
-
spec.
|
|
32
|
-
spec.
|
|
33
|
-
spec.
|
|
34
|
-
spec.
|
|
35
|
-
spec.
|
|
32
|
+
spec.add_dependency "async", ["~> 2.25"]
|
|
33
|
+
spec.add_dependency "faraday", ["~> 2.7"]
|
|
34
|
+
spec.add_dependency "faraday-retry", ["~> 2.2"]
|
|
35
|
+
spec.add_dependency "httpx", ["~> 1.1"]
|
|
36
|
+
spec.add_dependency "jekyll", ["~> 4"]
|
|
37
|
+
spec.add_dependency "nokogiri", ["~> 1.15"]
|
|
36
38
|
|
|
37
39
|
spec.add_development_dependency "minitest", ["~> 5.0"]
|
|
38
40
|
spec.add_development_dependency "rake", ["~> 13.0"]
|
|
39
41
|
spec.add_development_dependency "rubocop", ["~> 1.21"]
|
|
42
|
+
spec.add_development_dependency "rubocop-minitest", ["~> 0.38"]
|
|
43
|
+
spec.add_development_dependency "rubocop-performance", ["~> 1.25"]
|
|
44
|
+
spec.add_development_dependency "rubocop-rake", ["~> 0.7"]
|
|
40
45
|
end
|
data/lib/jekyll/kroki/version.rb
CHANGED
data/lib/jekyll/kroki.rb
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
require_relative "kroki/version"
|
|
4
4
|
|
|
5
|
+
require "async"
|
|
6
|
+
require "async/semaphore"
|
|
5
7
|
require "base64"
|
|
6
8
|
require "faraday"
|
|
7
9
|
require "faraday/retry"
|
|
@@ -11,32 +13,32 @@ require "nokogiri"
|
|
|
11
13
|
require "zlib"
|
|
12
14
|
|
|
13
15
|
module Jekyll
|
|
14
|
-
# Converts diagram descriptions into images using Kroki
|
|
16
|
+
# Converts diagram descriptions into images using Kroki.
|
|
15
17
|
class Kroki
|
|
16
|
-
|
|
18
|
+
DEFAULT_KROKI_URL = "https://kroki.io"
|
|
19
|
+
DEFAULT_HTTP_RETRIES = 3
|
|
20
|
+
DEFAULT_HTTP_TIMEOUT = 15
|
|
21
|
+
DEFAULT_MAX_CONCURRENT_DOCS = 8
|
|
22
|
+
EXPECTED_HTML_TAGS = %w[code div].freeze
|
|
23
|
+
HTTP_RETRY_INTERVAL_BACKOFF_FACTOR = 2
|
|
24
|
+
HTTP_RETRY_INTERVAL_RANDOMNESS = 0.5
|
|
25
|
+
HTTP_RETRY_INTERVAL = 0.1
|
|
17
26
|
SUPPORTED_LANGUAGES = %w[actdiag blockdiag bpmn bytefield c4plantuml d2 dbml diagramsnet ditaa erd excalidraw
|
|
18
27
|
graphviz mermaid nomnoml nwdiag packetdiag pikchr plantuml rackdiag seqdiag structurizr
|
|
19
28
|
svgbob symbolator tikz umlet vega vegalite wavedrom wireviz].freeze
|
|
20
|
-
EXPECTED_HTML_TAGS = %w[code div].freeze
|
|
21
|
-
HTTP_MAX_RETRIES = 3
|
|
22
29
|
|
|
23
30
|
class << self
|
|
24
|
-
# Renders and embeds all diagram descriptions in
|
|
31
|
+
# Renders and embeds all diagram descriptions in the given Jekyll site using Kroki.
|
|
25
32
|
#
|
|
26
|
-
# @param [Jekyll::Site] The Jekyll site to embed diagrams in
|
|
33
|
+
# @param [Jekyll::Site] The Jekyll site to embed diagrams in.
|
|
27
34
|
def embed_site(site)
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
rendered_diag = 0
|
|
33
|
-
(site.pages + site.documents).each do |doc|
|
|
34
|
-
next unless embeddable?(doc)
|
|
35
|
-
|
|
36
|
-
# Render all supported diagram descriptions in the document
|
|
37
|
-
rendered_diag += embed_doc(connection, doc)
|
|
38
|
-
end
|
|
35
|
+
kroki_url = get_kroki_url(site.config)
|
|
36
|
+
http_retries = get_http_retries(site.config)
|
|
37
|
+
http_timeout = get_http_timeout(site.config)
|
|
38
|
+
connection = setup_connection(kroki_url, http_retries, http_timeout)
|
|
39
39
|
|
|
40
|
+
max_concurrent_docs = get_max_concurrent_docs(site.config)
|
|
41
|
+
rendered_diag = embed_docs_in_site(site, connection, max_concurrent_docs)
|
|
40
42
|
unless rendered_diag.zero?
|
|
41
43
|
puts "[jekyll-kroki] Rendered #{rendered_diag} diagrams using Kroki instance at '#{kroki_url}'"
|
|
42
44
|
end
|
|
@@ -44,37 +46,79 @@ module Jekyll
|
|
|
44
46
|
exit(e)
|
|
45
47
|
end
|
|
46
48
|
|
|
47
|
-
# Renders
|
|
49
|
+
# Renders the diagram descriptions in all Jekyll pages and documents in the given Jekyll site. Pages / documents
|
|
50
|
+
# are rendered concurrently up to the limit defined by DEFAULT_MAX_CONCURRENT_DOCS.
|
|
51
|
+
#
|
|
52
|
+
# @param [Jekyll::Site] The Jekyll site to embed diagrams in.
|
|
53
|
+
# @param [Faraday::Connection] The Faraday connection to use.
|
|
54
|
+
# @param [Integer] The maximum number of documents to render concurrently.
|
|
55
|
+
# @return [Integer] The number of successfully rendered diagrams.
|
|
56
|
+
def embed_docs_in_site(site, connection, max_concurrent_docs)
|
|
57
|
+
rendered_diag = 0
|
|
58
|
+
semaphore = Async::Semaphore.new(max_concurrent_docs)
|
|
59
|
+
|
|
60
|
+
Async do |task|
|
|
61
|
+
tasks = (site.pages + site.documents).filter_map do |doc|
|
|
62
|
+
next unless embeddable?(doc)
|
|
63
|
+
|
|
64
|
+
async_embed_single_doc(task, semaphore, connection, doc)
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
rendered_diag = tasks.sum(&:wait)
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
rendered_diag
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
# Renders the supported diagram descriptions in a single document asynchronously, respecting the concurrency limit
|
|
74
|
+
# imposed by the provided semaphore.
|
|
75
|
+
#
|
|
76
|
+
# @param [Async::Task] The parent async task to spawn a child task from.
|
|
77
|
+
# @param [Async::Semaphore] A semaphore to limit concurrency.
|
|
78
|
+
# @param [Faraday::Connection] The Faraday connection to use.
|
|
79
|
+
# @param [Jekyll::Page, Jekyll::Document] The document to process.
|
|
80
|
+
# @return [Integer] The number of successfully rendered diagrams.
|
|
81
|
+
def async_embed_single_doc(task, semaphore, connection, doc)
|
|
82
|
+
task.async do
|
|
83
|
+
semaphore.async { embed_single_doc(connection, doc) }.wait
|
|
84
|
+
rescue StandardError => e
|
|
85
|
+
warn "[jekyll-kroki] Error rendering diagram: #{e.message}".red
|
|
86
|
+
0
|
|
87
|
+
end
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
# Renders the supported diagram descriptions in a single document and embeds them as inline SVGs in the HTML
|
|
91
|
+
# source.
|
|
48
92
|
#
|
|
49
|
-
# @param [Faraday::Connection] The Faraday connection to use
|
|
50
|
-
# @param [
|
|
51
|
-
# @
|
|
52
|
-
def
|
|
53
|
-
# Parse the HTML document
|
|
93
|
+
# @param [Faraday::Connection] The Faraday connection to use.
|
|
94
|
+
# @param [Jekyll::Page, Jekyll::Document] The document to process.
|
|
95
|
+
# @return [Integer] The number of successfully rendered diagrams.
|
|
96
|
+
def embed_single_doc(connection, doc)
|
|
97
|
+
# Parse the HTML document.
|
|
54
98
|
parsed_doc = Nokogiri::HTML(doc.output)
|
|
55
99
|
|
|
56
100
|
rendered_diag = 0
|
|
57
101
|
SUPPORTED_LANGUAGES.each do |language|
|
|
58
102
|
EXPECTED_HTML_TAGS.each do |tag|
|
|
59
103
|
parsed_doc.css("#{tag}[class~='language-#{language}']").each do |diagram_desc|
|
|
60
|
-
# Replace the diagram description with the SVG representation rendered by Kroki
|
|
104
|
+
# Replace the diagram description with the SVG representation rendered by Kroki.
|
|
61
105
|
diagram_desc.replace(render_diagram(connection, diagram_desc, language))
|
|
62
106
|
rendered_diag += 1
|
|
63
107
|
end
|
|
64
108
|
end
|
|
65
109
|
end
|
|
66
110
|
|
|
67
|
-
# Convert the document back to HTML
|
|
111
|
+
# Convert the document back to HTML.
|
|
68
112
|
doc.output = parsed_doc.to_html
|
|
69
113
|
rendered_diag
|
|
70
114
|
end
|
|
71
115
|
|
|
72
116
|
# Renders a single diagram description using Kroki.
|
|
73
117
|
#
|
|
74
|
-
# @param [Faraday::Connection] The Faraday connection to use
|
|
75
|
-
# @param [String] The diagram description
|
|
76
|
-
# @param [String] The language of the diagram description
|
|
77
|
-
# @return [String] The rendered diagram in SVG format
|
|
118
|
+
# @param [Faraday::Connection] The Faraday connection to use.
|
|
119
|
+
# @param [String] The diagram description.
|
|
120
|
+
# @param [String] The language of the diagram description.
|
|
121
|
+
# @return [String] The rendered diagram in SVG format.
|
|
78
122
|
def render_diagram(connection, diagram_desc, language)
|
|
79
123
|
begin
|
|
80
124
|
response = connection.get("#{language}/svg/#{encode_diagram(diagram_desc.text)}")
|
|
@@ -94,8 +138,8 @@ module Jekyll
|
|
|
94
138
|
# Sanitises a rendered diagram. Only <script> elements are removed, which is the most minimal / naive
|
|
95
139
|
# implementation possible.
|
|
96
140
|
#
|
|
97
|
-
# @param [String] The diagram to santise in SVG format
|
|
98
|
-
# @return [String] The sanitised diagram
|
|
141
|
+
# @param [String] The diagram to santise in SVG format.
|
|
142
|
+
# @return [String] The sanitised diagram.
|
|
99
143
|
def sanitise_diagram(diagram_svg)
|
|
100
144
|
parsed_svg = Nokogiri::XML(diagram_svg)
|
|
101
145
|
parsed_svg.xpath('//*[name()="script"]').each(&:remove)
|
|
@@ -105,21 +149,25 @@ module Jekyll
|
|
|
105
149
|
# Encodes the diagram into Kroki format using deflate + base64.
|
|
106
150
|
# See https://docs.kroki.io/kroki/setup/encode-diagram/.
|
|
107
151
|
#
|
|
108
|
-
# @param [String, #read] The diagram description to encode
|
|
109
|
-
# @return [String] The encoded diagram
|
|
152
|
+
# @param [String, #read] The diagram description to encode.
|
|
153
|
+
# @return [String] The encoded diagram.
|
|
110
154
|
def encode_diagram(diagram_desc)
|
|
111
155
|
Base64.urlsafe_encode64(Zlib.deflate(diagram_desc))
|
|
112
156
|
end
|
|
113
157
|
|
|
114
158
|
# Sets up a new Faraday connection.
|
|
115
159
|
#
|
|
116
|
-
# @param [URI::HTTP] The URL of the Kroki instance
|
|
117
|
-
# @
|
|
118
|
-
|
|
119
|
-
|
|
160
|
+
# @param [URI::HTTP] The URL of the Kroki instance.
|
|
161
|
+
# @param [Integer] The number of retries.
|
|
162
|
+
# @param [Integer] The timeout value in seconds.
|
|
163
|
+
# @return [Faraday::Connection] The Faraday connection.
|
|
164
|
+
def setup_connection(kroki_url, retries, timeout)
|
|
165
|
+
retry_options = { max: retries, interval: HTTP_RETRY_INTERVAL,
|
|
166
|
+
interval_randomness: HTTP_RETRY_INTERVAL_RANDOMNESS,
|
|
167
|
+
backoff_factor: HTTP_RETRY_INTERVAL_BACKOFF_FACTOR,
|
|
120
168
|
exceptions: [Faraday::RequestTimeoutError, Faraday::ServerError] }
|
|
121
169
|
|
|
122
|
-
Faraday.new(url: kroki_url, request: { timeout:
|
|
170
|
+
Faraday.new(url: kroki_url, request: { timeout: timeout }) do |builder|
|
|
123
171
|
builder.adapter :httpx, persistent: true
|
|
124
172
|
builder.request :retry, retry_options
|
|
125
173
|
builder.response :json, content_type: /\bjson$/
|
|
@@ -129,23 +177,43 @@ module Jekyll
|
|
|
129
177
|
|
|
130
178
|
# Gets the URL of the Kroki instance to use for rendering diagrams.
|
|
131
179
|
#
|
|
132
|
-
# @param The Jekyll site configuration
|
|
133
|
-
# @return [URI::HTTP] The URL of the Kroki instance
|
|
134
|
-
def
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
180
|
+
# @param The Jekyll site configuration.
|
|
181
|
+
# @return [URI::HTTP] The URL of the Kroki instance.
|
|
182
|
+
def get_kroki_url(config)
|
|
183
|
+
url = config.fetch("kroki", {}).fetch("url", DEFAULT_KROKI_URL)
|
|
184
|
+
raise TypeError, "'url' is not a valid HTTP URL" unless URI.parse(url).is_a?(URI::HTTP)
|
|
185
|
+
|
|
186
|
+
URI(url)
|
|
187
|
+
end
|
|
188
|
+
|
|
189
|
+
# Gets the number of HTTP retries.
|
|
190
|
+
#
|
|
191
|
+
# @param The Jekyll site configuration.
|
|
192
|
+
# @return [Integer] The number of HTTP retries.
|
|
193
|
+
def get_http_retries(config)
|
|
194
|
+
config.fetch("kroki", {}).fetch("http_retries", DEFAULT_HTTP_RETRIES)
|
|
195
|
+
end
|
|
196
|
+
|
|
197
|
+
# Gets the HTTP timeout value.
|
|
198
|
+
#
|
|
199
|
+
# @param The Jekyll site configuration.
|
|
200
|
+
# @return [Integer] The HTTP timeout value in seconds.
|
|
201
|
+
def get_http_timeout(config)
|
|
202
|
+
config.fetch("kroki", {}).fetch("http_timeout", DEFAULT_HTTP_TIMEOUT)
|
|
203
|
+
end
|
|
204
|
+
|
|
205
|
+
# Gets the maximum number of documents to render concurrently.
|
|
206
|
+
#
|
|
207
|
+
# @param The Jekyll site configuration.
|
|
208
|
+
# @return [Integer] The maximum number of documents to render concurrently.
|
|
209
|
+
def get_max_concurrent_docs(config)
|
|
210
|
+
config.fetch("kroki", {}).fetch("max_concurrent_docs", DEFAULT_MAX_CONCURRENT_DOCS)
|
|
143
211
|
end
|
|
144
212
|
|
|
145
|
-
# Determines whether a document may contain embeddable diagram descriptions
|
|
213
|
+
# Determines whether a document may contain embeddable diagram descriptions; it is in HTML format and is either
|
|
146
214
|
# a Jekyll::Page or writeable Jekyll::Document.
|
|
147
215
|
#
|
|
148
|
-
# @param [Jekyll::Page or Jekyll::Document] The document to check for
|
|
216
|
+
# @param [Jekyll::Page or Jekyll::Document] The document to check for embeddability.
|
|
149
217
|
def embeddable?(doc)
|
|
150
218
|
doc.output_ext == ".html" && (doc.is_a?(Jekyll::Page) || doc.write?)
|
|
151
219
|
end
|
|
@@ -153,7 +221,7 @@ module Jekyll
|
|
|
153
221
|
# Exits the Jekyll process without returning a stack trace. This method does not return because the process is
|
|
154
222
|
# abruptly terminated.
|
|
155
223
|
#
|
|
156
|
-
# @param [StandardError] The error to display in the termination message
|
|
224
|
+
# @param [StandardError] The error to display in the termination message.
|
|
157
225
|
# @param [int] The caller index to display in the termination message. The default index is 1, which means the
|
|
158
226
|
# calling method. To specify the calling method's caller, pass in 2.
|
|
159
227
|
#
|
|
@@ -162,7 +230,7 @@ module Jekyll
|
|
|
162
230
|
raise error
|
|
163
231
|
rescue StandardError => e
|
|
164
232
|
file, line_number, caller = e.backtrace[caller_index].split(":")
|
|
165
|
-
caller = caller.tr("
|
|
233
|
+
caller = caller.tr("", "'")
|
|
166
234
|
warn %([jekyll-kroki] "#{error.message}" #{caller} on line #{line_number} of #{file}).red
|
|
167
235
|
exec "exit 1"
|
|
168
236
|
end
|
metadata
CHANGED
|
@@ -1,15 +1,28 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: jekyll-kroki
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.5.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Felix van Oost
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: exe
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
12
|
+
- !ruby/object:Gem::Dependency
|
|
13
|
+
name: async
|
|
14
|
+
requirement: !ruby/object:Gem::Requirement
|
|
15
|
+
requirements:
|
|
16
|
+
- - "~>"
|
|
17
|
+
- !ruby/object:Gem::Version
|
|
18
|
+
version: '2.25'
|
|
19
|
+
type: :runtime
|
|
20
|
+
prerelease: false
|
|
21
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
22
|
+
requirements:
|
|
23
|
+
- - "~>"
|
|
24
|
+
- !ruby/object:Gem::Version
|
|
25
|
+
version: '2.25'
|
|
13
26
|
- !ruby/object:Gem::Dependency
|
|
14
27
|
name: faraday
|
|
15
28
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -122,10 +135,51 @@ dependencies:
|
|
|
122
135
|
- - "~>"
|
|
123
136
|
- !ruby/object:Gem::Version
|
|
124
137
|
version: '1.21'
|
|
138
|
+
- !ruby/object:Gem::Dependency
|
|
139
|
+
name: rubocop-minitest
|
|
140
|
+
requirement: !ruby/object:Gem::Requirement
|
|
141
|
+
requirements:
|
|
142
|
+
- - "~>"
|
|
143
|
+
- !ruby/object:Gem::Version
|
|
144
|
+
version: '0.38'
|
|
145
|
+
type: :development
|
|
146
|
+
prerelease: false
|
|
147
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
148
|
+
requirements:
|
|
149
|
+
- - "~>"
|
|
150
|
+
- !ruby/object:Gem::Version
|
|
151
|
+
version: '0.38'
|
|
152
|
+
- !ruby/object:Gem::Dependency
|
|
153
|
+
name: rubocop-performance
|
|
154
|
+
requirement: !ruby/object:Gem::Requirement
|
|
155
|
+
requirements:
|
|
156
|
+
- - "~>"
|
|
157
|
+
- !ruby/object:Gem::Version
|
|
158
|
+
version: '1.25'
|
|
159
|
+
type: :development
|
|
160
|
+
prerelease: false
|
|
161
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
162
|
+
requirements:
|
|
163
|
+
- - "~>"
|
|
164
|
+
- !ruby/object:Gem::Version
|
|
165
|
+
version: '1.25'
|
|
166
|
+
- !ruby/object:Gem::Dependency
|
|
167
|
+
name: rubocop-rake
|
|
168
|
+
requirement: !ruby/object:Gem::Requirement
|
|
169
|
+
requirements:
|
|
170
|
+
- - "~>"
|
|
171
|
+
- !ruby/object:Gem::Version
|
|
172
|
+
version: '0.7'
|
|
173
|
+
type: :development
|
|
174
|
+
prerelease: false
|
|
175
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
176
|
+
requirements:
|
|
177
|
+
- - "~>"
|
|
178
|
+
- !ruby/object:Gem::Version
|
|
179
|
+
version: '0.7'
|
|
125
180
|
description: |-
|
|
126
181
|
A Jekyll plugin to convert diagram descriptions written in over 25 popular diagram scripting
|
|
127
182
|
languages into images using Kroki
|
|
128
|
-
email:
|
|
129
183
|
executables: []
|
|
130
184
|
extensions: []
|
|
131
185
|
extra_rdoc_files: []
|
|
@@ -145,7 +199,7 @@ licenses:
|
|
|
145
199
|
metadata:
|
|
146
200
|
homepage_uri: https://github.com/felixvanoost/jekyll-kroki
|
|
147
201
|
source_code_uri: https://github.com/felixvanoost/jekyll-kroki
|
|
148
|
-
|
|
202
|
+
rubygems_mfa_required: 'true'
|
|
149
203
|
rdoc_options: []
|
|
150
204
|
require_paths:
|
|
151
205
|
- lib
|
|
@@ -153,15 +207,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
153
207
|
requirements:
|
|
154
208
|
- - ">="
|
|
155
209
|
- !ruby/object:Gem::Version
|
|
156
|
-
version: 2.
|
|
210
|
+
version: 2.7.0
|
|
157
211
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
158
212
|
requirements:
|
|
159
213
|
- - ">="
|
|
160
214
|
- !ruby/object:Gem::Version
|
|
161
215
|
version: '0'
|
|
162
216
|
requirements: []
|
|
163
|
-
rubygems_version: 3.
|
|
164
|
-
signing_key:
|
|
217
|
+
rubygems_version: 3.6.7
|
|
165
218
|
specification_version: 4
|
|
166
219
|
summary: A Jekyll plugin to convert diagram descriptions into images using Kroki
|
|
167
220
|
test_files: []
|