polytexnic 1.7.4 → 1.7.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +6 -10
- data/lib/polytexnic/utils.rb +4 -0
- data/lib/polytexnic/version.rb +1 -1
- data/spec/to_latex_spec.rb +5 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bf582b21d2b0ca0b0a5d2fa2da4c5633f0cf1f53b240b9dd591f97b02ac4fc32
|
4
|
+
data.tar.gz: 1e04b862d24f44942d23bdd7ca0d68158a1067bed3966f80125eabe72a1045d0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a0e19cfd1a8e44c4a9b2e59e8c15499d25a6137a49eb542acee566928052ec80b445a9f295d44f7c95a8a7d8a5975570c969e12139de5c35b52fed3c517fdfb0
|
7
|
+
data.tar.gz: 68a9ff47f302a1dee06aa08bcc911b9cd69b578a3be043e7542104bb392f989195d9a7d48f79198020d15b067f15f46c6c4686e7328dfa908814c5c7bf2c37b6
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
polytexnic (1.7.
|
4
|
+
polytexnic (1.7.5)
|
5
5
|
json (~> 2.3.0)
|
6
6
|
kramdown (>= 2.0, < 3.0)
|
7
7
|
msgpack (~> 1.2.0)
|
@@ -51,9 +51,7 @@ GEM
|
|
51
51
|
msgpack (1.2.10)
|
52
52
|
multi_json (1.15.0)
|
53
53
|
nenv (0.3.0)
|
54
|
-
nokogiri (1.13.
|
55
|
-
racc (~> 1.4)
|
56
|
-
nokogiri (1.13.8-x86_64-darwin)
|
54
|
+
nokogiri (1.13.10-arm64-darwin)
|
57
55
|
racc (~> 1.4)
|
58
56
|
notiffany (0.1.3)
|
59
57
|
nenv (~> 0.1)
|
@@ -61,10 +59,10 @@ GEM
|
|
61
59
|
pry (0.14.1)
|
62
60
|
coderay (~> 1.1)
|
63
61
|
method_source (~> 1.0)
|
64
|
-
pygments.rb (2.3.
|
65
|
-
racc (1.6.
|
62
|
+
pygments.rb (2.3.1)
|
63
|
+
racc (1.6.1)
|
66
64
|
rake (13.0.6)
|
67
|
-
rb-fsevent (0.11.
|
65
|
+
rb-fsevent (0.11.2)
|
68
66
|
rb-inotify (0.10.1)
|
69
67
|
ffi (~> 1.0)
|
70
68
|
rest-client (1.6.7)
|
@@ -91,8 +89,6 @@ GEM
|
|
91
89
|
|
92
90
|
PLATFORMS
|
93
91
|
arm64-darwin-21
|
94
|
-
x86_64-darwin-19
|
95
|
-
x86_64-darwin-21
|
96
92
|
|
97
93
|
DEPENDENCIES
|
98
94
|
coveralls
|
@@ -104,4 +100,4 @@ DEPENDENCIES
|
|
104
100
|
simplecov (~> 0.15.1)
|
105
101
|
|
106
102
|
BUNDLED WITH
|
107
|
-
2.3.
|
103
|
+
2.3.14
|
data/lib/polytexnic/utils.rb
CHANGED
@@ -35,7 +35,10 @@ module Polytexnic
|
|
35
35
|
|
36
36
|
|
37
37
|
# Expands '\input' command by processing & inserting the target source.
|
38
|
+
# We skip tikzstyles since those don't get inserted into the text.
|
38
39
|
def expand_input!(text, code_function, ext = 'md')
|
40
|
+
uuid = "52576c7eb84a49b5afc0d9913891f346"
|
41
|
+
text.gsub!(/\\input\{(.*\.tikzstyles)\}/) { "#{uuid}-#{$1}-#{uuid}" }
|
39
42
|
text.gsub!(/^[ \t]*\\input\{(.*?)\}[ \t]*$/) do
|
40
43
|
# Prepend a newline for safety.
|
41
44
|
included_text = "\n" + File.read("#{$1}.#{ext}")
|
@@ -44,6 +47,7 @@ module Polytexnic
|
|
44
47
|
expand_input!(clean_text, code_function, ext)
|
45
48
|
end
|
46
49
|
end
|
50
|
+
text.gsub!(/#{uuid}-(.*)-#{uuid}/) { "\\input{#{$1}}" }
|
47
51
|
end
|
48
52
|
|
49
53
|
# Returns true for Apple Silicon.
|
data/lib/polytexnic/version.rb
CHANGED
data/spec/to_latex_spec.rb
CHANGED
@@ -230,6 +230,7 @@ end
|
|
230
230
|
describe '\input command' do
|
231
231
|
let(:external_file) { 'foo.tex' }
|
232
232
|
let(:nested_external_file) { 'bar.tex' }
|
233
|
+
let(:tikzstyles_file) { 'test.tikzstyles' }
|
233
234
|
let(:input) do <<-'EOS'
|
234
235
|
Lorem ipsum
|
235
236
|
%= lang:ruby
|
@@ -252,13 +253,15 @@ end
|
|
252
253
|
before do
|
253
254
|
File.write(external_file, input)
|
254
255
|
File.write(nested_external_file, nested_input)
|
256
|
+
File.write(tikzstyles_file, "lorem ipsum")
|
255
257
|
end
|
256
258
|
after do
|
257
259
|
File.unlink(external_file)
|
258
260
|
File.unlink(nested_external_file)
|
261
|
+
File.unlink(tikzstyles_file)
|
259
262
|
end
|
260
263
|
|
261
|
-
let(:polytex) { "\\chapter{Foo}\n\n \\input{foo} " }
|
264
|
+
let(:polytex) { "\\chapter{Foo}\n\n \\input{foo}\n\n \\input{test.tikzstyles}" }
|
262
265
|
let(:foo_latex) do
|
263
266
|
'\PY{k}{def} \PY{n+nf}{foo}\PY{p}{;}'
|
264
267
|
end
|
@@ -268,6 +271,7 @@ end
|
|
268
271
|
|
269
272
|
it { should include foo_latex }
|
270
273
|
it { should include bar_latex }
|
274
|
+
it { should include '\input{test.tikzstyles}' }
|
271
275
|
it { should_not include 'xmlelement' }
|
272
276
|
end
|
273
277
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: polytexnic
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.7.
|
4
|
+
version: 1.7.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Hartl
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2022-
|
12
|
+
date: 2022-12-16 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: nokogiri
|