jekyll-antex 0.2.1 → 0.2.2
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/lib/jekyll/antex/alias.rb +13 -3
- data/lib/jekyll/antex/defaults.yml +24 -9
- data/lib/jekyll/antex/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a1cc97e98e01d13964af2cbe1a631ea2be276310
|
4
|
+
data.tar.gz: 5e35ad685f11471225ec8d312c35ee5b90a511d7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 78342e277b2b021777af53d0ed3ed6cf82f4ab3ec3ba956a7693d8a69f1b5f51a5640e1563812ec8ceb2a75a6f51e5a53c6b89014d6074c835ce904d0bda6732
|
7
|
+
data.tar.gz: 763468d9eb428a6294a0fef1a73b43eb1ae913604e7215cfc51283e1f6052d5b94559bd20b95a13c572957799affffe1412fbf4c4a78f2602cc59935df27503c
|
data/lib/jekyll/antex/alias.rb
CHANGED
@@ -7,17 +7,27 @@ module Jekyll
|
|
7
7
|
class Alias
|
8
8
|
class InvalidRegexp < Error; end
|
9
9
|
|
10
|
-
attr_reader :priority, :regexp, :options
|
10
|
+
attr_reader :priority, :regexp, :multiline, :options
|
11
11
|
|
12
|
-
def initialize(priority:,
|
12
|
+
def initialize(priority:, options: {},
|
13
|
+
regexp:, multiline: false, extended: true)
|
13
14
|
@priority = priority.to_i
|
14
|
-
@regexp =
|
15
|
+
@regexp = build_regexp source: regexp,
|
16
|
+
extended: extended,
|
17
|
+
multiline: multiline
|
15
18
|
validate_regexp!
|
16
19
|
@options = options.to_h
|
17
20
|
end
|
18
21
|
|
19
22
|
private
|
20
23
|
|
24
|
+
def build_regexp(source:, extended:, multiline:)
|
25
|
+
options = 0
|
26
|
+
options |= Regexp::EXTENDED if extended
|
27
|
+
options |= Regexp::MULTILINE if multiline
|
28
|
+
Regexp.new source, options
|
29
|
+
end
|
30
|
+
|
21
31
|
def validate_regexp!
|
22
32
|
return if @regexp.names.include? 'code'
|
23
33
|
raise InvalidRegexp, <<~MESSAGE
|
@@ -78,19 +78,28 @@ aliases:
|
|
78
78
|
# it is the liquid tag all other aliases are rendered to.
|
79
79
|
internal:
|
80
80
|
priority: 1000
|
81
|
-
|
82
|
-
|
81
|
+
multiline: true
|
82
|
+
regexp: >
|
83
|
+
{%\s*antex\s*(?<markup>.*?)%}
|
84
|
+
(?<code>.*?)
|
85
|
+
{%\s*endantex\s*%}
|
83
86
|
# 'default' is the standard generic purpose alias.
|
84
87
|
# Since it can contain tikz pictures,
|
85
88
|
# it must have higher priority than 'tikzpicture' alias.
|
86
89
|
default:
|
87
90
|
priority: 100
|
88
|
-
|
89
|
-
|
91
|
+
multiline: true
|
92
|
+
regexp: >
|
93
|
+
{%\s*tex\s*(?<markup>.*?)%}
|
94
|
+
(?<code>.*?)
|
95
|
+
{%\s*endtex\s*%}
|
90
96
|
tikzpicture:
|
91
97
|
priority: 90
|
92
|
-
|
93
|
-
|
98
|
+
multiline: true
|
99
|
+
regexp: >
|
100
|
+
{%\s*tikz\s*(?<markup>.*?)%}
|
101
|
+
(?<code>.*?)
|
102
|
+
{%\s*endtikz\s*%}
|
94
103
|
options:
|
95
104
|
prepend: '\\begin{tikzpicture}'
|
96
105
|
append: '\\end{tikzpicture}'
|
@@ -99,14 +108,19 @@ aliases:
|
|
99
108
|
# since the respective deliniters are double and single dollars.
|
100
109
|
display_math:
|
101
110
|
priority: 20
|
102
|
-
|
111
|
+
multiline: true
|
112
|
+
regexp: >
|
113
|
+
\$\$
|
114
|
+
(?<code>.*?)
|
115
|
+
\$\$
|
103
116
|
options:
|
104
117
|
prepend: '$\\displaystyle'
|
105
118
|
append: $
|
106
119
|
classes: [antex, display]
|
107
120
|
inline_math:
|
108
121
|
priority: 10
|
109
|
-
regexp:
|
122
|
+
regexp: >
|
123
|
+
\$(?<code>.*?)\$
|
110
124
|
options:
|
111
125
|
prepend: $
|
112
126
|
append: $
|
@@ -115,6 +129,7 @@ aliases:
|
|
115
129
|
# to avoid interference with others aliases.
|
116
130
|
inline_macro:
|
117
131
|
priority: 0
|
118
|
-
regexp:
|
132
|
+
regexp: >
|
133
|
+
(?<code>\\[A-z]+)
|
119
134
|
options:
|
120
135
|
classes: [antex, inline]
|
data/lib/jekyll/antex/version.rb
CHANGED
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.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Paolo Brasolin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-10-
|
11
|
+
date: 2017-10-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|