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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d40834bb8a0205105739c3c347480faf14ddb63f64afeab9197e165d8b92bf5d
4
- data.tar.gz: c8571137c2be72affefe7ff6f4b40770e1e4fc52a4c67b6b7e1ea1e0cddf45a5
3
+ metadata.gz: 6ae9208f70f3f0a06275683bf047bc73870168cb5501b2726dbbadd8b9c55ceb
4
+ data.tar.gz: c712dda3116e33168f71e70fcc19411b66f8c07ce9ae5bbd026dfd1b5b26a8e3
5
5
  SHA512:
6
- metadata.gz: 8d2d76d36ba1dcbb41f5db7bde576cccc23c8db83886ce9146885a0abee32be8827e172fe3f5670d160d2ca29d2e0d39ecca22464cb49c7c05ad666dd72f50e9
7
- data.tar.gz: 28688818b0a7ba361ad24c6e6cd7b807671e294cc0e8253e15b75c75bde1bfcf08e7401c258a3e1f80ccfbacf0e0dd7f338b17520bbe1f75bd00e8ee7c764379
6
+ metadata.gz: bdad58dffb6636ae21dc2a929a456ed005de8000d08f74b69c12bc5b269805b1c7f20ec026507bc70ed8b5a1ade086db559c42c67a8077c0fd50b770b329d8b0
7
+ data.tar.gz: 9f900c12dc794ffa606f9beb8802102369c76f4a8ef1ba82d2902f03f0ed624d2b3ac4d3bb836aae2a5ca0f2223a77a543cd5efe93e57137d8385c3ffb59117c
data/Gemfile CHANGED
@@ -16,7 +16,6 @@ Encoding.default_internal = Encoding::UTF_8
16
16
  gemspec
17
17
 
18
18
  group :test do
19
- gem 'debugger2' unless RUBY_VERSION < "2.0"
20
19
  gem 'coveralls', require: false
21
20
  gem 'growl'
22
21
  end
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- polytexnic (1.7.0)
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.1)
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.2-x86_64-darwin)
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-20
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.2.17
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)\S*?$)/m) do
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\}(\{.*?\})/m) do
285
+ output.gsub!(/\\begin\{longtable\}(\{.*?\})/) do
286
286
  "\\begin{table}\n\\begin{tabular}#{$1}"
287
287
  end
288
- output.gsub!(/((?:\\caption|\\label)\S*?$)\n\s*\\end\{longtable\}/) do
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.
@@ -1,3 +1,3 @@
1
1
  module Polytexnic
2
- VERSION = "1.7.0"
2
+ VERSION = "1.7.3"
3
3
  end
@@ -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
@@ -178,12 +178,14 @@ describe 'Polytexnic::Pipeline#to_html' do
178
178
 
179
179
  describe "table environments" do
180
180
 
181
- context "longtable" do
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
- <div id="table-longtable" data-tralics-id="uid1" data-number="1" class="table">
199
- <table class="tabular"><tr><td class="align_center">HTTP request</td>
200
- <td class="align_center">URL</td>
201
- </tr><tr><td class="align_center">GET</td>
202
- <td class="align_center">/users</td>
203
- </tr><tr><td class="align_center">GET</td>
204
- <td class="align_center">/users/1</td>
205
- </tr></table>
206
- <div class="caption">
207
- <span class="header">Table 1</span>
208
- </div>
209
- </div>
210
- <p><a href="#table-longtable" class="hyperref">Table <span class="ref">1</span></a></p>
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.0
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-02-22 00:00:00.000000000 Z
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.1.6
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: