jekyll-antex 0.6.0 → 0.6.1

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
  SHA256:
3
- metadata.gz: 0b87279a7608dbb4ca9eed439311e206cdb9fb66c978d6a0418275be1cf470fb
4
- data.tar.gz: ab8381af64763d4b9cb0eec82cc5ba46ce4a619a77a6fedbf07665b404eb3f6d
3
+ metadata.gz: 7d7e55a185748b2e917234281bb7f2242ddc40a4d36a81da3c82c63e394fa1f5
4
+ data.tar.gz: e5f4058b0c13c5a0397fb181a9c1fc6c266b9ea1957d3265a35dbbdb6592cee5
5
5
  SHA512:
6
- metadata.gz: 29151511d7b8c79afaa5b23f16e666c30912f000d6d2608f4fb6461e99913ed818165f1b53140edccf85e48bf7fd48243768104ade14d9b152714330880c5fab
7
- data.tar.gz: 3a6cf462426c1cca9171b87b288fce058ba7d27d26316398a255e251e6dab4d176e3161866424e7dc17194fec85b46865a632c943af310d3c913647787b96ad6
6
+ metadata.gz: f7d87025ca79d0f2bd6aa8e2f0f66d8c7fb1f2d5683bc24f01c5fbace55b6bc069b07e15f93cb78fdd41b9abc8f4809f7b48d4f96f9f404c8eb23d7aa99882ee
7
+ data.tar.gz: babab2523a37de3b562008177980c36f37e7c8588c2de46888d9b428683e3c608e8fe012cefc3aba0891b9fc411dc79bac2f6dec4e50fdd9ae4b2de6e0888ad6
data/README.md CHANGED
@@ -1,10 +1,18 @@
1
1
  # jekyll-antex
2
2
 
3
- [![Build Status](https://travis-ci.org/paolobrasolin/jekyll-antex.svg?branch=master)](https://travis-ci.org/paolobrasolin/jekyll-antex)
4
- [![Gem Version](https://badge.fury.io/rb/jekyll-antex.svg)](https://badge.fury.io/rb/jekyll-antex)
5
- [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
3
+ [![CI tests status badge][build-shield]][build-url]
4
+ [![Latest release badge][rubygems-shield]][rubygems-url]
5
+ [![License badge][license-shield]][license-url]
6
+ [![Maintainability badge][cc-maintainability-shield]][cc-maintainability-url]
7
+ [![Test coverage badge][cc-coverage-shield]][cc-coverage-url]
6
8
 
7
- [![Code Climate](https://codeclimate.com/github/paolobrasolin/jekyll-antex/badges/gpa.svg)](https://codeclimate.com/github/paolobrasolin/jekyll-antex)
8
- [![Test Coverage](https://codeclimate.com/github/paolobrasolin/jekyll-antex/badges/coverage.svg)](https://codeclimate.com/github/paolobrasolin/jekyll-antex/coverage)
9
- [![Inline docs](http://inch-ci.org/github/paolobrasolin/jekyll-antex.svg?branch=master)](http://inch-ci.org/github/paolobrasolin/jekyll-antex)
10
- [![Issue Count](https://codeclimate.com/github/paolobrasolin/jekyll-antex/badges/issue_count.svg)](https://codeclimate.com/github/paolobrasolin/jekyll-antex)
9
+ [build-shield]: https://img.shields.io/github/workflow/status/paolobrasolin/jekyll-antex/CI/main?label=tests&logo=github
10
+ [build-url]: https://github.com/paolobrasolin/jekyll-antex/actions/workflows/main.yml "CI tests status"
11
+ [rubygems-shield]: https://img.shields.io/gem/v/jekyll-antex?logo=ruby
12
+ [rubygems-url]: https://rubygems.org/gems/jekyll-antex "Latest release"
13
+ [license-shield]: https://img.shields.io/github/license/paolobrasolin/jekyll-antex
14
+ [license-url]: https://github.com/paolobrasolin/jekyll-antex/blob/main/LICENSE "License"
15
+ [cc-maintainability-shield]: https://img.shields.io/codeclimate/maintainability/paolobrasolin/jekyll-antex?logo=codeclimate
16
+ [cc-maintainability-url]: https://codeclimate.com/github/paolobrasolin/jekyll-antex "Maintainability"
17
+ [cc-coverage-shield]: https://img.shields.io/codeclimate/coverage/paolobrasolin/jekyll-antex?logo=codeclimate&label=test%20coverage
18
+ [cc-coverage-url]: https://codeclimate.com/github/paolobrasolin/jekyll-antex/coverage "Test coverage"
@@ -16,6 +16,7 @@ module Jekyll
16
16
 
17
17
  def validate_regexp!
18
18
  return if regexp.names.include? 'code'
19
+
19
20
  raise InvalidRegexp, <<~MESSAGE
20
21
  The regexp #{regexp.inspect} is missing the required named matching group "code".
21
22
  MESSAGE
@@ -27,8 +27,6 @@ module Jekyll
27
27
  self.class.render_html(job)
28
28
  end
29
29
 
30
- private
31
-
32
30
  def self.render_html(job)
33
31
  img_tag = render_img_tag job
34
32
  classes = job.options['classes'].join(' ')
@@ -50,12 +48,6 @@ module Jekyll
50
48
  IMG_TAG
51
49
  end
52
50
 
53
- def add_static_file(site, job)
54
- site.static_files << Jekyll::StaticFile.new(
55
- site, *self.class.static_file_paths(job)
56
- )
57
- end
58
-
59
51
  def self.img_url(job)
60
52
  _, dest_dir, filename = static_file_paths job
61
53
  url_path_prefix = job.options['url_path_prefix'] || '/'
@@ -63,15 +55,23 @@ module Jekyll
63
55
  end
64
56
 
65
57
  def self.static_file_paths(job)
66
- work_dir_prefix = %r{^#{Regexp.escape job.dirs['work']}(?=\/|$)}
58
+ work_dir_prefix = %r{^#{Regexp.escape job.dirs['work']}(?=/|$)}
67
59
  # base, dir, name
68
60
  [
69
61
  job.dirs['work'],
70
- job.dirs['dest'].sub(work_dir_prefix, '').sub(%r{^\/}, ''),
62
+ job.dirs['dest'].sub(work_dir_prefix, '').sub(%r{^/}, ''),
71
63
  File.basename(job.files['svg'])
72
64
  ]
73
65
  end
74
66
 
67
+ private
68
+
69
+ def add_static_file(site, job)
70
+ site.static_files << Jekyll::StaticFile.new(
71
+ site, *self.class.static_file_paths(job)
72
+ )
73
+ end
74
+
75
75
  def build_options(registers:, markup:)
76
76
  Jekyll::Antex::Options.build Jekyll::Antex::Options::DEFAULTS,
77
77
  registers[:site].config['antex'] || {},
@@ -27,13 +27,13 @@ module Jekyll
27
27
 
28
28
  def self.build_guarder(options)
29
29
  Jekyll::Antex::Stasher.new(
30
- options['guards'].values.reject { |value| false == value }.map(&Guard.method(:new))
30
+ options['guards'].values.reject { |value| value == false }.map(&Guard.method(:new))
31
31
  )
32
32
  end
33
33
 
34
34
  def self.build_aliaser(options)
35
35
  Jekyll::Antex::Stasher.new(
36
- options['aliases'].values.reject { |value| false == value }.map(&Alias.method(:new))
36
+ options['aliases'].values.reject { |value| value == false }.map(&Alias.method(:new))
37
37
  )
38
38
  end
39
39
 
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'yaml'
4
- require 'jekyll/utils'
4
+ require 'jekyll'
5
5
 
6
6
  module Jekyll
7
7
  module Antex
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Jekyll
4
4
  module Antex
5
- VERSION = '0.6.0'
5
+ VERSION = '0.6.1'
6
6
  end
7
7
  end
data/lib/jekyll/antex.rb CHANGED
@@ -9,15 +9,21 @@ require 'jekyll/antex/block'
9
9
  module Jekyll
10
10
  module Antex
11
11
  def self.run_jobs
12
- jobs_count = Jekyll::Antex.jobs.count
13
- Jekyll.logger.writer << "Compiling TeX: ".rjust(20)
14
- Jekyll::Antex.jobs.values.each_with_index do |job, i|
15
- progress = "job " + i.next.to_s.rjust(jobs_count.to_s.length) + " of #{jobs_count} "
16
- Jekyll.logger.writer << progress
17
- job.run!
18
- Jekyll.logger.writer << "\b" * progress.length
12
+ jekyll_antex_jobs = Jekyll::Antex.jobs
13
+ jobs_count = jekyll_antex_jobs.count
14
+ jekyll_logger_writer = Jekyll.logger.writer
15
+ jekyll_logger_writer << 'Compiling TeX: '.rjust(20)
16
+ jekyll_antex_jobs.values.each_with_index do |job, index|
17
+ run_job(job, index, jobs_count, jekyll_logger_writer)
19
18
  end
20
- Jekyll.logger.writer << "#{jobs_count} jobs completed.\n"
19
+ jekyll_logger_writer << "#{jobs_count} jobs completed.\n"
20
+ end
21
+
22
+ def self.run_job(job, index, jobs_count, jekyll_logger_writer)
23
+ progress = "job #{index.next.to_s.rjust(jobs_count.to_s.length)} of #{jobs_count} "
24
+ jekyll_logger_writer << progress
25
+ job.run!
26
+ jekyll_logger_writer << ("\b" * progress.length)
21
27
  end
22
28
 
23
29
  def self.inject_style_attributes(output)
@@ -46,6 +52,8 @@ Liquid::Template.register_tag('antex', Jekyll::Antex::Block)
46
52
  Jekyll::Hooks.register :site, :post_render do |site|
47
53
  Jekyll::Antex.run_jobs
48
54
  [*site.pages, *site.documents].each do |resource|
55
+ # NOTE: skip unrendered resources e.g. when using --incremental
56
+ next if resource.output.nil?
49
57
  resource.output = Jekyll::Antex.inject_style_attributes(resource.output)
50
58
  end
51
59
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-antex
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paolo Brasolin
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-12-11 00:00:00.000000000 Z
11
+ date: 2022-01-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: antex
@@ -16,140 +16,160 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0.1'
19
+ version: 0.1.3
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: '0.1'
26
+ version: 0.1.3
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: jekyll
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '3'
34
+ - - "<"
35
+ - !ruby/object:Gem::Version
36
+ version: '5'
37
+ type: :runtime
38
+ prerelease: false
39
+ version_requirements: !ruby/object:Gem::Requirement
40
+ requirements:
41
+ - - ">="
42
+ - !ruby/object:Gem::Version
43
+ version: '3'
44
+ - - "<"
45
+ - !ruby/object:Gem::Version
46
+ version: '5'
47
+ - !ruby/object:Gem::Dependency
48
+ name: kramdown-parser-gfm
29
49
  requirement: !ruby/object:Gem::Requirement
30
50
  requirements:
31
51
  - - "~>"
32
52
  - !ruby/object:Gem::Version
33
- version: '3.8'
53
+ version: 1.1.0
34
54
  type: :runtime
35
55
  prerelease: false
36
56
  version_requirements: !ruby/object:Gem::Requirement
37
57
  requirements:
38
58
  - - "~>"
39
59
  - !ruby/object:Gem::Version
40
- version: '3.8'
60
+ version: 1.1.0
41
61
  - !ruby/object:Gem::Dependency
42
62
  name: byebug
43
63
  requirement: !ruby/object:Gem::Requirement
44
64
  requirements:
45
65
  - - "~>"
46
66
  - !ruby/object:Gem::Version
47
- version: '10'
67
+ version: 11.1.3
48
68
  type: :development
49
69
  prerelease: false
50
70
  version_requirements: !ruby/object:Gem::Requirement
51
71
  requirements:
52
72
  - - "~>"
53
73
  - !ruby/object:Gem::Version
54
- version: '10'
74
+ version: 11.1.3
55
75
  - !ruby/object:Gem::Dependency
56
76
  name: guard
57
77
  requirement: !ruby/object:Gem::Requirement
58
78
  requirements:
59
79
  - - "~>"
60
80
  - !ruby/object:Gem::Version
61
- version: '2'
81
+ version: 2.18.0
62
82
  type: :development
63
83
  prerelease: false
64
84
  version_requirements: !ruby/object:Gem::Requirement
65
85
  requirements:
66
86
  - - "~>"
67
87
  - !ruby/object:Gem::Version
68
- version: '2'
88
+ version: 2.18.0
69
89
  - !ruby/object:Gem::Dependency
70
90
  name: guard-rspec
71
91
  requirement: !ruby/object:Gem::Requirement
72
92
  requirements:
73
93
  - - "~>"
74
94
  - !ruby/object:Gem::Version
75
- version: '4'
95
+ version: 4.7.3
76
96
  type: :development
77
97
  prerelease: false
78
98
  version_requirements: !ruby/object:Gem::Requirement
79
99
  requirements:
80
100
  - - "~>"
81
101
  - !ruby/object:Gem::Version
82
- version: '4'
102
+ version: 4.7.3
83
103
  - !ruby/object:Gem::Dependency
84
104
  name: reek
85
105
  requirement: !ruby/object:Gem::Requirement
86
106
  requirements:
87
107
  - - "~>"
88
108
  - !ruby/object:Gem::Version
89
- version: '4'
109
+ version: 6.0.6
90
110
  type: :development
91
111
  prerelease: false
92
112
  version_requirements: !ruby/object:Gem::Requirement
93
113
  requirements:
94
114
  - - "~>"
95
115
  - !ruby/object:Gem::Version
96
- version: '4'
116
+ version: 6.0.6
97
117
  - !ruby/object:Gem::Dependency
98
118
  name: rspec
99
119
  requirement: !ruby/object:Gem::Requirement
100
120
  requirements:
101
121
  - - "~>"
102
122
  - !ruby/object:Gem::Version
103
- version: '3'
123
+ version: 3.10.0
104
124
  type: :development
105
125
  prerelease: false
106
126
  version_requirements: !ruby/object:Gem::Requirement
107
127
  requirements:
108
128
  - - "~>"
109
129
  - !ruby/object:Gem::Version
110
- version: '3'
130
+ version: 3.10.0
111
131
  - !ruby/object:Gem::Dependency
112
132
  name: rubocop
113
133
  requirement: !ruby/object:Gem::Requirement
114
134
  requirements:
115
135
  - - "~>"
116
136
  - !ruby/object:Gem::Version
117
- version: '0.52'
137
+ version: 1.22.3
118
138
  type: :development
119
139
  prerelease: false
120
140
  version_requirements: !ruby/object:Gem::Requirement
121
141
  requirements:
122
142
  - - "~>"
123
143
  - !ruby/object:Gem::Version
124
- version: '0.52'
144
+ version: 1.22.3
125
145
  - !ruby/object:Gem::Dependency
126
146
  name: simplecov
127
147
  requirement: !ruby/object:Gem::Requirement
128
148
  requirements:
129
149
  - - "~>"
130
150
  - !ruby/object:Gem::Version
131
- version: '0.16'
151
+ version: 0.21.2
132
152
  type: :development
133
153
  prerelease: false
134
154
  version_requirements: !ruby/object:Gem::Requirement
135
155
  requirements:
136
156
  - - "~>"
137
157
  - !ruby/object:Gem::Version
138
- version: '0.16'
158
+ version: 0.21.2
139
159
  - !ruby/object:Gem::Dependency
140
160
  name: yard
141
161
  requirement: !ruby/object:Gem::Requirement
142
162
  requirements:
143
163
  - - "~>"
144
164
  - !ruby/object:Gem::Version
145
- version: '0.9'
165
+ version: 0.9.26
146
166
  type: :development
147
167
  prerelease: false
148
168
  version_requirements: !ruby/object:Gem::Requirement
149
169
  requirements:
150
170
  - - "~>"
151
171
  - !ruby/object:Gem::Version
152
- version: '0.9'
172
+ version: 0.9.26
153
173
  description: 'Jekyll-anTeX implements universal TeX support in Jekyll to embed and
154
174
  render arbitrary code using any engine and dialect. '
155
175
  email: paolo.brasolin@gmail.com
@@ -157,7 +177,6 @@ executables: []
157
177
  extensions: []
158
178
  extra_rdoc_files: []
159
179
  files:
160
- - LICENSE.txt
161
180
  - README.md
162
181
  - lib/jekyll/antex.rb
163
182
  - lib/jekyll/antex/alias.rb
@@ -173,7 +192,7 @@ homepage: https://github.com/paolobrasolin/antex
173
192
  licenses:
174
193
  - MIT
175
194
  metadata: {}
176
- post_install_message:
195
+ post_install_message:
177
196
  rdoc_options: []
178
197
  require_paths:
179
198
  - lib
@@ -181,16 +200,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
181
200
  requirements:
182
201
  - - ">="
183
202
  - !ruby/object:Gem::Version
184
- version: '2.5'
203
+ version: '2.6'
185
204
  required_rubygems_version: !ruby/object:Gem::Requirement
186
205
  requirements:
187
206
  - - ">="
188
207
  - !ruby/object:Gem::Version
189
208
  version: '0'
190
209
  requirements: []
191
- rubyforge_project:
192
- rubygems_version: 2.7.6
193
- signing_key:
210
+ rubygems_version: 3.1.4
211
+ signing_key:
194
212
  specification_version: 4
195
213
  summary: Universal TeX integration for Jekyll
196
214
  test_files: []
data/LICENSE.txt DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2017 Paolo Brasolin
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.