polytexnic 1.6.4 → 1.6.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6d7799a38185640239ca691d3139570d4abbb14a35fbf9c900946bff62cc41eb
4
- data.tar.gz: 513c2c37e46535fd6abdd66448f6593daee2329be52c4768146205d74c0f17e6
3
+ metadata.gz: aa4a264539262673bc0a0436583a9ce31c3fc9ecbc2ef5cc138016873676ea58
4
+ data.tar.gz: 53fb1e2697742893dc61a1161296c26ae6f9b0bdde33b525528f3c5385e250cf
5
5
  SHA512:
6
- metadata.gz: 79102ce8772b68e4a4d25a3b7ff3db533f06fff37804ba87ec347a5be785d5a290731232aa94849b17e725080f84863b1108a218550e70fffea224b2163993e4
7
- data.tar.gz: 4f0dc0d6b4d507bdab09071011f3168043d27627fdbe030d6ad2046531d8a6b544284f7aede474d6c13dd0bd4a91b02a77bc7c4427348eebed0669e56d0f9987
6
+ metadata.gz: a90cd3b66b2ead91ced4337458ec2be79fb35d7991aa66b763f5ed5db7b49145cfe7e2ecfc28050731ebf689473264374ada7b5d7f4f99690fe73cd1782add30
7
+ data.tar.gz: b0b90e6906c207ffb355e591e07385fb57e5b5ee7d7acae42417fe331c4046e4f3f68e12a4cd793609b5677fe050980b872686dccc682283d245ce079167e961
data/Gemfile CHANGED
@@ -22,6 +22,6 @@ group :test do
22
22
  end
23
23
 
24
24
  group :development do
25
- gem 'guard-rspec'
25
+ gem 'guard-rspec', require: false
26
26
  gem 'rake'
27
27
  end
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- polytexnic (1.6.4)
4
+ polytexnic (1.6.5)
5
5
  json (~> 2.3.0)
6
6
  kramdown (>= 2.0, < 3.0)
7
7
  msgpack (~> 1.2.0)
@@ -25,16 +25,16 @@ GEM
25
25
  debugger-linecache (~> 1.2.0)
26
26
  diff-lcs (1.4.4)
27
27
  docile (1.1.5)
28
- ffi (1.15.0)
29
- formatador (0.2.5)
28
+ ffi (1.15.3)
29
+ formatador (0.3.0)
30
30
  growl (1.0.3)
31
- guard (2.16.2)
31
+ guard (2.18.0)
32
32
  formatador (>= 0.2.4)
33
33
  listen (>= 2.7, < 4.0)
34
34
  lumberjack (>= 1.0.12, < 2.0)
35
35
  nenv (~> 0.1)
36
36
  notiffany (~> 0.0)
37
- pry (>= 0.9.12)
37
+ pry (>= 0.13.0)
38
38
  shellany (~> 0.0)
39
39
  thor (>= 0.18.1)
40
40
  guard-compat (1.2.1)
@@ -45,18 +45,22 @@ GEM
45
45
  json (2.3.1)
46
46
  kramdown (2.3.1)
47
47
  rexml
48
- listen (3.5.1)
48
+ listen (3.7.0)
49
49
  rb-fsevent (~> 0.10, >= 0.10.3)
50
50
  rb-inotify (~> 0.9, >= 0.9.10)
51
51
  lumberjack (1.2.8)
52
52
  method_source (1.0.0)
53
53
  mime-types (3.3.1)
54
54
  mime-types-data (~> 3.2015)
55
- mime-types-data (3.2021.0225)
55
+ mime-types-data (3.2021.0704)
56
+ mini_portile2 (2.6.1)
56
57
  msgpack (1.2.10)
57
58
  multi_json (1.15.0)
58
59
  nenv (0.3.0)
59
- nokogiri (1.11.3-x86_64-darwin)
60
+ nokogiri (1.12.3)
61
+ mini_portile2 (~> 2.6.1)
62
+ racc (~> 1.4)
63
+ nokogiri (1.12.3-x86_64-darwin)
60
64
  racc (~> 1.4)
61
65
  notiffany (0.1.3)
62
66
  nenv (~> 0.1)
@@ -66,8 +70,8 @@ GEM
66
70
  method_source (~> 1.0)
67
71
  pygments.rb (2.2.0)
68
72
  racc (1.5.2)
69
- rake (13.0.3)
70
- rb-fsevent (0.10.4)
73
+ rake (13.0.6)
74
+ rb-fsevent (0.11.0)
71
75
  rb-inotify (0.10.1)
72
76
  ffi (~> 1.0)
73
77
  rest-client (1.6.7)
@@ -93,6 +97,7 @@ GEM
93
97
  tins (0.13.2)
94
98
 
95
99
  PLATFORMS
100
+ ruby
96
101
  x86_64-darwin-19
97
102
 
98
103
  DEPENDENCIES
data/Guardfile CHANGED
@@ -1,15 +1,10 @@
1
- # A sample Guardfile
2
- # More info at https://github.com/guard/guard#readme
1
+ guard :rspec, cmd: "bundle exec rspec" do
2
+ require "guard/rspec/dsl"
3
+ dsl = Guard::RSpec::Dsl.new(self)
4
+
5
+ # Feel free to open issues for suggestions and improvements
3
6
 
4
- guard :rspec do
5
7
  watch(%r{^spec/.+_spec\.rb$})
6
8
  watch(%r{^lib/(.+)\.rb$}) { "spec" }
7
- ## Uncomment & edit below (and comment out above) to watch particular specs.
8
- # watch(%r{^lib/(.+)\.rb$}) do
9
- # [
10
- # "spec/to_html/asides_spec.rb",
11
- # "spec/to_html/codelistings_spec.rb"
12
- # ]
13
- # end
14
9
  watch('spec/spec_helper.rb') { "spec" }
15
10
  end
@@ -209,6 +209,7 @@ module Polytexnic
209
209
  # For completeness, we handle the case where the author neglects to
210
210
  # use the nonbreak space ~.
211
211
  def hyperrefs(string)
212
+ part = language_labels["part"]
212
213
  chapter = language_labels["chapter"]["word"]
213
214
  section = language_labels["section"]
214
215
  table = language_labels["table"]
@@ -218,7 +219,7 @@ module Polytexnic
218
219
  listing = language_labels["listing"]
219
220
  equation = language_labels["equation"]
220
221
  eq = language_labels["eq"]
221
- linked_item = "(#{chapter}|#{section}|#{table}|#{box}|#{figure}" +
222
+ linked_item = "(#{part}|#{chapter}|#{section}|#{table}|#{box}|#{figure}" +
222
223
  "|#{fig}\.|#{listing}|#{equation}|#{eq}\.)"
223
224
  ref = /(?:#{linked_item}(~| ))*(\\(?:eq)*ref){(.*?)}/i
224
225
  string.gsub!(ref) do
@@ -1,3 +1,3 @@
1
1
  module Polytexnic
2
- VERSION = "1.6.4"
2
+ VERSION = "1.6.5"
3
3
  end
data/lib/polytexnic.rb CHANGED
@@ -54,7 +54,7 @@ module Polytexnic
54
54
  else
55
55
  default_language_labels.merge(labels)
56
56
  end
57
- tempdir = 'tmp'
57
+ tempdir = 'tmp'
58
58
  FileUtils.mkdir(tempdir) unless File.directory?(tempdir)
59
59
  @highlight_cache_filename = File.join(tempdir, '.highlight_cache')
60
60
  if File.exist?(@highlight_cache_filename)
@@ -109,7 +109,7 @@ module Polytexnic
109
109
 
110
110
  # Returns the default labels for 'Chapter', 'Figure', etc.
111
111
  def default_language_labels
112
- {"chapter"=>{"word"=>"Chapter", "order"=>"standard"},
112
+ {"part"=>"Part","chapter"=>{"word"=>"Chapter", "order"=>"standard"},
113
113
  "section"=>"Section", "table"=>"Table", "figure"=>"Figure",
114
114
  "fig"=>"Fig", "aside"=>"Box", "listing"=>"Listing",
115
115
  "equation"=>"Equation", "eq"=>"Eq", "frontmatter"=>"Frontmatter",
@@ -149,11 +149,17 @@ end
149
149
 
150
150
  describe "hyperref links" do
151
151
  let(:polytex) do <<-'EOS'
152
- Chapter~\ref{cha:foo}
152
+ Part~\ref{prt:foo}
153
+ Chapter~\ref{cha:bar}
154
+ Section~\ref{sec:baz}
153
155
  EOS
154
156
  end
155
- let(:output) { '\hyperref[cha:foo]{Chapter~\ref{cha:foo}' }
156
- it { should resemble output }
157
+ let(:part_ref) { '\hyperref[prt:foo]{Part~\ref{prt:foo}' }
158
+ let(:chapter_ref) { '\hyperref[cha:bar]{Chapter~\ref{cha:bar}' }
159
+ let(:section_ref) { '\hyperref[sec:baz]{Section~\ref{sec:baz}' }
160
+ it { should resemble part_ref }
161
+ it { should resemble chapter_ref }
162
+ it { should resemble section_ref }
157
163
  end
158
164
 
159
165
  describe "asides" do
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.6.4
4
+ version: 1.6.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: 2021-05-01 00:00:00.000000000 Z
12
+ date: 2021-08-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: nokogiri
@@ -308,7 +308,7 @@ 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.2
311
+ rubygems_version: 3.1.6
312
312
  signing_key:
313
313
  specification_version: 4
314
314
  summary: Convert from PolyTeX & Markdown to HTML & LaTeX