jekyll-antex 0.6.1 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/jekyll/antex/version.rb +1 -1
- data/lib/jekyll/antex.rb +15 -6
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 898feb47d4ab647c0cbf5263bf5ca7122c86235e3f5c9006f6cf2067699e52f9
|
4
|
+
data.tar.gz: b421d69f63ec5012b4ef84f5f568d6399135ffbab507375d2220cfc295992e3d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c9a64cb0a982138da460170ee206898f1bba7ae37679ca258c26190c11f75a9514ed5e6612a01e123daf3b4cc28540bd21d1ea48629d912126e1c1b19796e6a9
|
7
|
+
data.tar.gz: d97e5b98db6dde250125e0a6f8b646eda517921b45743f3a1e5fe0ec3360593d7e76ae02d2cf79414ee58c4e91f79a8f393319f63b7cad900555e96ced05ac87
|
data/lib/jekyll/antex/version.rb
CHANGED
data/lib/jekyll/antex.rb
CHANGED
@@ -8,6 +8,17 @@ require 'jekyll/antex/block'
|
|
8
8
|
|
9
9
|
module Jekyll
|
10
10
|
module Antex
|
11
|
+
def self.gather_resources(site)
|
12
|
+
pages = site.pages
|
13
|
+
documents = site.collections.values.flat_map(&:docs)
|
14
|
+
[*pages, *documents].filter(&method(:allowed_resource?))
|
15
|
+
end
|
16
|
+
|
17
|
+
def self.allowed_resource?(resource)
|
18
|
+
# TODO: perhaps this should be configurable
|
19
|
+
File.fnmatch('*.{html,md}', resource.relative_path, File::FNM_EXTGLOB)
|
20
|
+
end
|
21
|
+
|
11
22
|
def self.run_jobs
|
12
23
|
jekyll_antex_jobs = Jekyll::Antex.jobs
|
13
24
|
jobs_count = jekyll_antex_jobs.count
|
@@ -38,20 +49,18 @@ end
|
|
38
49
|
# NOTE: I'm conflicted, but regexp flags in yaml must be easy to use.
|
39
50
|
SafeYAML::OPTIONS[:whitelisted_tags].push('!ruby/regexp')
|
40
51
|
|
41
|
-
Jekyll::Hooks.register :site, :pre_render do
|
52
|
+
Jekyll::Hooks.register :site, :pre_render do |site|
|
42
53
|
Jekyll::Antex.jobs = {}
|
43
|
-
|
44
|
-
|
45
|
-
# NOTE: we're not registering :posts since they are included in :documents.
|
46
|
-
Jekyll::Hooks.register [:documents, :pages], :pre_render do |resource|
|
54
|
+
Jekyll::Antex.gather_resources(site).each do |resource|
|
47
55
|
resource.content = Jekyll::Antex::Dealiaser.run(resource)
|
56
|
+
end
|
48
57
|
end
|
49
58
|
|
50
59
|
Liquid::Template.register_tag('antex', Jekyll::Antex::Block)
|
51
60
|
|
52
61
|
Jekyll::Hooks.register :site, :post_render do |site|
|
53
62
|
Jekyll::Antex.run_jobs
|
54
|
-
|
63
|
+
Jekyll::Antex.gather_resources(site).each do |resource|
|
55
64
|
# NOTE: skip unrendered resources e.g. when using --incremental
|
56
65
|
next if resource.output.nil?
|
57
66
|
resource.output = Jekyll::Antex.inject_style_attributes(resource.output)
|
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.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Paolo Brasolin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-01-
|
11
|
+
date: 2022-01-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: antex
|
@@ -207,7 +207,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
207
207
|
- !ruby/object:Gem::Version
|
208
208
|
version: '0'
|
209
209
|
requirements: []
|
210
|
-
rubygems_version: 3.1.
|
210
|
+
rubygems_version: 3.1.6
|
211
211
|
signing_key:
|
212
212
|
specification_version: 4
|
213
213
|
summary: Universal TeX integration for Jekyll
|