premonition 4.0.1 → 4.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/lib/premonition/hook.rb +4 -1
- data/lib/premonition/processor.rb +9 -6
- data/lib/premonition/version.rb +1 -1
- metadata +23 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c0afd588a585aa18e2b848b6db7218e7023da46485f7eb5be786c46b3829b49c
|
4
|
+
data.tar.gz: e6ef83f13bf6b05af34eb1a0eb1d06eb50441b989f39bf760fbe2fc19630741a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4640af00a49c1ebd749c7addf2687254cf49f8b18ffbf401be0816bd3cd0df280c40d110a99ada680ef77e2c162a885c3da35541fe70e9d2c3075f4548883c70
|
7
|
+
data.tar.gz: 8eae8618c054023a9573178d70adf0434d3ebe06bf66c8290b33df0ba6b85b7e338c847ce12e06f592843f77c4b7d759350800b39675d5a688affa1aeb568958
|
data/README.md
CHANGED
@@ -43,7 +43,7 @@ Add the following line to your `Gemfile` inside your Jekyll project folder:
|
|
43
43
|
|
44
44
|
```
|
45
45
|
group :jekyll_plugins do
|
46
|
-
gem "premonition", "4.0.
|
46
|
+
gem "premonition", "4.0.1"
|
47
47
|
end
|
48
48
|
```
|
49
49
|
|
@@ -138,7 +138,7 @@ Error
|
|
138
138
|
Citation (Note the use of attributes here)
|
139
139
|
|
140
140
|
```markdown
|
141
|
-
>
|
141
|
+
> citation "Mark Twain" [ cite = "mt" ]
|
142
142
|
> I will be a beautiful citation quote
|
143
143
|
```
|
144
144
|
|
data/lib/premonition/hook.rb
CHANGED
@@ -31,10 +31,13 @@ module Jekyll
|
|
31
31
|
end
|
32
32
|
end
|
33
33
|
|
34
|
+
Hooks.register [:documents], :pre_render do |doc|
|
35
|
+
doc.content = processor.adder(doc.content) if process?(resources, doc)
|
36
|
+
end
|
34
37
|
Hooks.register [:pages], :pre_render do |doc|
|
35
38
|
doc.content = processor.adder(doc.content) if process?(resources, doc)
|
36
39
|
end
|
37
|
-
|
40
|
+
end
|
38
41
|
|
39
42
|
private
|
40
43
|
|
@@ -2,6 +2,7 @@
|
|
2
2
|
|
3
3
|
module Jekyll
|
4
4
|
module Premonition
|
5
|
+
|
5
6
|
# Class that does all of the rendering magic within Premonition.
|
6
7
|
class Processor
|
7
8
|
def initialize(resources)
|
@@ -16,7 +17,7 @@ module Jekyll
|
|
16
17
|
# content - Markdown content
|
17
18
|
def adder(content)
|
18
19
|
o = []
|
19
|
-
references =
|
20
|
+
references = ["\n"]
|
20
21
|
b = nil
|
21
22
|
is_code_block = false
|
22
23
|
content.each_line do |l|
|
@@ -24,16 +25,18 @@ module Jekyll
|
|
24
25
|
if is_code_block
|
25
26
|
o << l
|
26
27
|
elsif blockquote?(l) && empty_block?(b)
|
27
|
-
|
28
|
+
|
29
|
+
if (m = l.match(/^\s*\>\s+([a-z]+)\s+\"(.*)\"\s+(\[.*\])?\s*$/i))
|
28
30
|
y, t, attrs = m.captures
|
29
31
|
b = { 'title' => t.strip, 'type' => y.strip.downcase, 'content' => [], 'attrs' => attrs }
|
30
32
|
else
|
31
33
|
o << l
|
32
34
|
end
|
33
35
|
elsif blockquote?(l) && !empty_block?(b)
|
34
|
-
b['content'] << l.
|
36
|
+
b['content'] << l.match(/^\s*\>\s?(.*)$/i).captures[0]
|
35
37
|
else
|
36
38
|
if !blockquote?(l) && !empty_block?(b)
|
39
|
+
references = load_references(content)
|
37
40
|
o << render_block(b, references)
|
38
41
|
b = nil
|
39
42
|
end
|
@@ -52,9 +55,9 @@ module Jekyll
|
|
52
55
|
def load_references(content)
|
53
56
|
refs = ["\n"]
|
54
57
|
content.each_line do |l|
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
+
# refs << l if l.strip!.match(/^\[.*\]:.*\".*\"$/i)
|
59
|
+
|
60
|
+
refs << l if l.strip.length.positive? && l.strip.match(/^\[.*\]:.*\".*\"$/i)
|
58
61
|
end
|
59
62
|
refs
|
60
63
|
end
|
data/lib/premonition/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: premonition
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.0.
|
4
|
+
version: 4.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jakob Vad Nielsen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-03-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|
@@ -34,16 +34,22 @@ dependencies:
|
|
34
34
|
name: bundler
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
36
36
|
requirements:
|
37
|
-
- - "
|
37
|
+
- - ">"
|
38
38
|
- !ruby/object:Gem::Version
|
39
39
|
version: 2.1.4
|
40
|
+
- - "<="
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: 2.3.8
|
40
43
|
type: :development
|
41
44
|
prerelease: false
|
42
45
|
version_requirements: !ruby/object:Gem::Requirement
|
43
46
|
requirements:
|
44
|
-
- - "
|
47
|
+
- - ">"
|
45
48
|
- !ruby/object:Gem::Version
|
46
49
|
version: 2.1.4
|
50
|
+
- - "<="
|
51
|
+
- !ruby/object:Gem::Version
|
52
|
+
version: 2.3.8
|
47
53
|
- !ruby/object:Gem::Dependency
|
48
54
|
name: mocha
|
49
55
|
requirement: !ruby/object:Gem::Requirement
|
@@ -79,9 +85,9 @@ dependencies:
|
|
79
85
|
- - ">="
|
80
86
|
- !ruby/object:Gem::Version
|
81
87
|
version: 0.68.0
|
82
|
-
- - "
|
88
|
+
- - "<="
|
83
89
|
- !ruby/object:Gem::Version
|
84
|
-
version:
|
90
|
+
version: 1.25.1
|
85
91
|
type: :development
|
86
92
|
prerelease: false
|
87
93
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -89,51 +95,51 @@ dependencies:
|
|
89
95
|
- - ">="
|
90
96
|
- !ruby/object:Gem::Version
|
91
97
|
version: 0.68.0
|
92
|
-
- - "
|
98
|
+
- - "<="
|
93
99
|
- !ruby/object:Gem::Version
|
94
|
-
version:
|
100
|
+
version: 1.25.1
|
95
101
|
- !ruby/object:Gem::Dependency
|
96
102
|
name: rubocop-jekyll
|
97
103
|
requirement: !ruby/object:Gem::Requirement
|
98
104
|
requirements:
|
99
105
|
- - "~>"
|
100
106
|
- !ruby/object:Gem::Version
|
101
|
-
version: 0.
|
107
|
+
version: 0.12.0
|
102
108
|
type: :development
|
103
109
|
prerelease: false
|
104
110
|
version_requirements: !ruby/object:Gem::Requirement
|
105
111
|
requirements:
|
106
112
|
- - "~>"
|
107
113
|
- !ruby/object:Gem::Version
|
108
|
-
version: 0.
|
114
|
+
version: 0.12.0
|
109
115
|
- !ruby/object:Gem::Dependency
|
110
|
-
name:
|
116
|
+
name: rubocop-rails
|
111
117
|
requirement: !ruby/object:Gem::Requirement
|
112
118
|
requirements:
|
113
119
|
- - "~>"
|
114
120
|
- !ruby/object:Gem::Version
|
115
|
-
version:
|
121
|
+
version: 2.13.2
|
116
122
|
type: :development
|
117
123
|
prerelease: false
|
118
124
|
version_requirements: !ruby/object:Gem::Requirement
|
119
125
|
requirements:
|
120
126
|
- - "~>"
|
121
127
|
- !ruby/object:Gem::Version
|
122
|
-
version:
|
128
|
+
version: 2.13.2
|
123
129
|
- !ruby/object:Gem::Dependency
|
124
|
-
name:
|
130
|
+
name: test-unit
|
125
131
|
requirement: !ruby/object:Gem::Requirement
|
126
132
|
requirements:
|
127
133
|
- - "~>"
|
128
134
|
- !ruby/object:Gem::Version
|
129
|
-
version:
|
135
|
+
version: 3.3.5
|
130
136
|
type: :development
|
131
137
|
prerelease: false
|
132
138
|
version_requirements: !ruby/object:Gem::Requirement
|
133
139
|
requirements:
|
134
140
|
- - "~>"
|
135
141
|
- !ruby/object:Gem::Version
|
136
|
-
version:
|
142
|
+
version: 3.3.5
|
137
143
|
description:
|
138
144
|
email:
|
139
145
|
- jakobvadnielsen@gmail.com
|
@@ -173,7 +179,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
173
179
|
- !ruby/object:Gem::Version
|
174
180
|
version: '0'
|
175
181
|
requirements: []
|
176
|
-
rubygems_version: 3.
|
182
|
+
rubygems_version: 3.3.7
|
177
183
|
signing_key:
|
178
184
|
specification_version: 4
|
179
185
|
summary: Jekyll generator that will convert special block quotes into message boxes.
|