polytexnic 1.7.0 → 1.7.3
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/Gemfile +0 -1
- data/Gemfile.lock +5 -11
- data/lib/polytexnic/postprocessors/html.rb +1 -1
- data/lib/polytexnic/preprocessors/html.rb +3 -5
- data/lib/polytexnic/version.rb +1 -1
- data/spec/to_html/graphics_and_figures_spec.rb +2 -2
- data/spec/to_html/table_spec.rb +64 -15
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6ae9208f70f3f0a06275683bf047bc73870168cb5501b2726dbbadd8b9c55ceb
|
4
|
+
data.tar.gz: c712dda3116e33168f71e70fcc19411b66f8c07ce9ae5bbd026dfd1b5b26a8e3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bdad58dffb6636ae21dc2a929a456ed005de8000d08f74b69c12bc5b269805b1c7f20ec026507bc70ed8b5a1ade086db559c42c67a8077c0fd50b770b329d8b0
|
7
|
+
data.tar.gz: 9f900c12dc794ffa606f9beb8802102369c76f4a8ef1ba82d2902f03f0ed624d2b3ac4d3bb836aae2a5ca0f2223a77a543cd5efe93e57137d8385c3ffb59117c
|
data/Gemfile
CHANGED
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.3)
|
5
5
|
json (~> 2.3.0)
|
6
6
|
kramdown (>= 2.0, < 3.0)
|
7
7
|
msgpack (~> 1.2.0)
|
@@ -12,17 +12,12 @@ GEM
|
|
12
12
|
remote: https://rubygems.org/
|
13
13
|
specs:
|
14
14
|
coderay (1.1.3)
|
15
|
-
columnize (0.9.0)
|
16
15
|
coveralls (0.7.2)
|
17
16
|
multi_json (~> 1.3)
|
18
17
|
rest-client (= 1.6.7)
|
19
18
|
simplecov (>= 0.7)
|
20
19
|
term-ansicolor (= 1.2.2)
|
21
20
|
thor (= 0.18.1)
|
22
|
-
debugger-linecache (1.2.0)
|
23
|
-
debugger2 (1.0.0.beta2)
|
24
|
-
columnize (>= 0.3.1)
|
25
|
-
debugger-linecache (~> 1.2.0)
|
26
21
|
diff-lcs (1.5.0)
|
27
22
|
docile (1.1.5)
|
28
23
|
ffi (1.15.5)
|
@@ -43,7 +38,7 @@ GEM
|
|
43
38
|
guard-compat (~> 1.1)
|
44
39
|
rspec (>= 2.99.0, < 4.0)
|
45
40
|
json (2.3.1)
|
46
|
-
kramdown (2.3.
|
41
|
+
kramdown (2.3.2)
|
47
42
|
rexml
|
48
43
|
listen (3.7.1)
|
49
44
|
rb-fsevent (~> 0.10, >= 0.10.3)
|
@@ -56,7 +51,7 @@ GEM
|
|
56
51
|
msgpack (1.2.10)
|
57
52
|
multi_json (1.15.0)
|
58
53
|
nenv (0.3.0)
|
59
|
-
nokogiri (1.13.
|
54
|
+
nokogiri (1.13.6-x86_64-darwin)
|
60
55
|
racc (~> 1.4)
|
61
56
|
notiffany (0.1.3)
|
62
57
|
nenv (~> 0.1)
|
@@ -94,11 +89,10 @@ GEM
|
|
94
89
|
|
95
90
|
PLATFORMS
|
96
91
|
x86_64-darwin-19
|
97
|
-
x86_64-darwin-
|
92
|
+
x86_64-darwin-21
|
98
93
|
|
99
94
|
DEPENDENCIES
|
100
95
|
coveralls
|
101
|
-
debugger2
|
102
96
|
growl
|
103
97
|
guard-rspec
|
104
98
|
polytexnic!
|
@@ -107,4 +101,4 @@ DEPENDENCIES
|
|
107
101
|
simplecov (~> 0.15.1)
|
108
102
|
|
109
103
|
BUNDLED WITH
|
110
|
-
2.
|
104
|
+
2.3.10
|
@@ -585,7 +585,7 @@ module Polytexnic
|
|
585
585
|
node['id'] = pipeline_label(label)
|
586
586
|
label.remove
|
587
587
|
end
|
588
|
-
clean_node node, %w{data-label place width}
|
588
|
+
clean_node node, %w{data-label place width height}
|
589
589
|
end
|
590
590
|
doc.xpath('//table').each do |node|
|
591
591
|
if unexpected = node.at_css('unexpected')
|
@@ -279,13 +279,13 @@ module Polytexnic
|
|
279
279
|
# input documents. The latest update includes support for the tabularx
|
280
280
|
# environment
|
281
281
|
def convert_longtable(output)
|
282
|
-
output.gsub!(/\\begin\{longtable\}(\{.*?\})\n((?:\\caption|\\label)
|
282
|
+
output.gsub!(/\\begin\{longtable\}(\{.*?\})\n\s*((?:\\caption|\\label).*?)\\\\$/) do
|
283
283
|
"\\begin{table}\n#{$2}\n\\begin{tabular}#{$1}"
|
284
284
|
end
|
285
|
-
output.gsub!(/\\begin\{longtable\}(\{.*?\})/
|
285
|
+
output.gsub!(/\\begin\{longtable\}(\{.*?\})/) do
|
286
286
|
"\\begin{table}\n\\begin{tabular}#{$1}"
|
287
287
|
end
|
288
|
-
output.gsub!(/((?:\\caption|\\label)
|
288
|
+
output.gsub!(/((?:\\caption|\\label).*?$)\n\s*\\end\{longtable\}/) do
|
289
289
|
"\\end{tabular}#{$1}\n\\end{table}"
|
290
290
|
end
|
291
291
|
output.gsub!('\end{longtable}', "\\end{tabular}\n\\end{table}")
|
@@ -294,8 +294,6 @@ module Polytexnic
|
|
294
294
|
"\\begin{tabular}{#{alignment}}"
|
295
295
|
end
|
296
296
|
output.gsub!('\end{tabularx}', '\end{tabular}')
|
297
|
-
# puts output
|
298
|
-
# puts '+' * 50
|
299
297
|
end
|
300
298
|
|
301
299
|
# Marks environments with their types.
|
data/lib/polytexnic/version.rb
CHANGED
@@ -141,12 +141,12 @@ describe 'Polytexnic::Pipeline#to_html' do
|
|
141
141
|
\chapter{The chapter}
|
142
142
|
|
143
143
|
\begin{figure}
|
144
|
-
\includegraphics{foo.png}
|
144
|
+
\includegraphics[height="5in"]{foo.png}
|
145
145
|
\caption{This is a \emph{caption} with $x$.}
|
146
146
|
\end{figure}
|
147
147
|
|
148
148
|
\begin{figure}
|
149
|
-
\includegraphics{bar.png}
|
149
|
+
\includegraphics[width="4in"]{bar.png}
|
150
150
|
\caption{This is another caption.}
|
151
151
|
\end{figure}
|
152
152
|
EOS
|
data/spec/to_html/table_spec.rb
CHANGED
@@ -178,12 +178,14 @@ describe 'Polytexnic::Pipeline#to_html' do
|
|
178
178
|
|
179
179
|
describe "table environments" do
|
180
180
|
|
181
|
-
|
181
|
+
context "longtable" do
|
182
|
+
|
183
|
+
context "with caption on top" do
|
182
184
|
|
183
185
|
let(:polytex) do <<-'EOS'
|
184
186
|
|
185
187
|
\begin{longtable}{cc}
|
186
|
-
\label{table:longtable}
|
188
|
+
\caption{Test caption.\label{table:longtable}}\\
|
187
189
|
HTTP request & URL \\
|
188
190
|
GET & /users \\
|
189
191
|
GET & /users/1
|
@@ -195,24 +197,71 @@ describe 'Polytexnic::Pipeline#to_html' do
|
|
195
197
|
end
|
196
198
|
|
197
199
|
let(:output) do <<-'EOS'
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
200
|
+
<div id="table-longtable" data-tralics-id="uid1" data-number="1" class="table">
|
201
|
+
<table class="tabular">
|
202
|
+
<tr><td class="align_center">HTTP request</td>
|
203
|
+
<td class="align_center">URL</td>
|
204
|
+
</tr><tr><td class="align_center">GET</td>
|
205
|
+
<td class="align_center">/users</td>
|
206
|
+
</tr><tr><td class="align_center">GET</td>
|
207
|
+
<td class="align_center">/users/1</td>
|
208
|
+
</tr></table>
|
209
|
+
<div class="caption">
|
210
|
+
<span class="header">Table 1: </span>
|
211
|
+
<span class="description">Test caption.
|
212
|
+
</span>
|
213
|
+
</div>
|
214
|
+
</div>
|
215
|
+
<p>
|
216
|
+
<a href="#table-longtable" class="hyperref">Table <span class="ref">1</span></a>
|
217
|
+
</p>
|
218
|
+
EOS
|
219
|
+
end
|
220
|
+
|
221
|
+
it { should resemble output }
|
222
|
+
end
|
223
|
+
|
224
|
+
context "with caption on bottom" do
|
225
|
+
|
226
|
+
let(:polytex) do <<-'EOS'
|
227
|
+
|
228
|
+
\begin{longtable}{cc}
|
229
|
+
HTTP request & URL \\
|
230
|
+
GET & /users \\
|
231
|
+
GET & /users/1
|
232
|
+
\caption{Test caption.\label{table:longtable}}
|
233
|
+
\end{longtable}
|
234
|
+
|
235
|
+
Table~\ref{table:longtable}
|
236
|
+
|
237
|
+
EOS
|
238
|
+
end
|
239
|
+
|
240
|
+
let(:output) do <<-'EOS'
|
241
|
+
<div id="table-longtable" data-tralics-id="uid1" data-number="1" class="table">
|
242
|
+
<table class="tabular">
|
243
|
+
<tr><td class="align_center">HTTP request</td>
|
244
|
+
<td class="align_center">URL</td>
|
245
|
+
</tr><tr><td class="align_center">GET</td>
|
246
|
+
<td class="align_center">/users</td>
|
247
|
+
</tr><tr><td class="align_center">GET</td>
|
248
|
+
<td class="align_center">/users/1</td>
|
249
|
+
</tr></table>
|
250
|
+
<div class="caption">
|
251
|
+
<span class="header">Table 1: </span>
|
252
|
+
<span class="description">Test caption.
|
253
|
+
</span>
|
254
|
+
</div>
|
255
|
+
</div>
|
256
|
+
<p>
|
257
|
+
<a href="#table-longtable" class="hyperref">Table <span class="ref">1</span></a>
|
258
|
+
</p>
|
211
259
|
EOS
|
212
260
|
end
|
213
261
|
|
214
262
|
it { should resemble output }
|
215
263
|
end
|
264
|
+
end
|
216
265
|
|
217
266
|
context "with a label and a cross-reference" do
|
218
267
|
let(:polytex) do <<-'EOS'
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
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.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Hartl
|
8
8
|
- Nick Merwin
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2022-
|
12
|
+
date: 2022-05-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: nokogiri
|
@@ -293,7 +293,7 @@ homepage: https://github.com/softcover/polytexnic
|
|
293
293
|
licenses:
|
294
294
|
- MIT
|
295
295
|
metadata: {}
|
296
|
-
post_install_message:
|
296
|
+
post_install_message:
|
297
297
|
rdoc_options: []
|
298
298
|
require_paths:
|
299
299
|
- lib
|
@@ -308,8 +308,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
308
308
|
- !ruby/object:Gem::Version
|
309
309
|
version: '0'
|
310
310
|
requirements: []
|
311
|
-
rubygems_version: 3.
|
312
|
-
signing_key:
|
311
|
+
rubygems_version: 3.3.7
|
312
|
+
signing_key:
|
313
313
|
specification_version: 4
|
314
314
|
summary: Convert from PolyTeX & Markdown to HTML & LaTeX
|
315
315
|
test_files:
|