polytexnic 1.0.beta8 → 1.0.0

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
  SHA1:
3
- metadata.gz: 7c99c9d688840ccd3add5e41a73a4e424e5eeea9
4
- data.tar.gz: b9f675cd796b25b35f90f50031508b07807c433e
3
+ metadata.gz: f0e23a1be73cee0d1562d4476190c696b0b5c0f1
4
+ data.tar.gz: 27e570b110bd0de3cc5e765900994b154b53afb0
5
5
  SHA512:
6
- metadata.gz: da4fe8193a39805b0114fe33a63e80916560c18e89eb8e9b963b78da4cdd14c2fce3135ee464a0fd8d98343017932d7b9a8ecaccd28cb9c6e29c502bebf3fb50
7
- data.tar.gz: 97a80e005643620f5a937402d481ed8be79e3987f06d0dd4b42eb6c82d196f15bba05013265041d51af21ef2beb003dcf51eb557616e478d3496c825cdd4e74d
6
+ metadata.gz: 33c038d2630d43f9782eacba7de0d4529fa6c576d43f4ea0cffbdd87cdd0f8b50f5c296331212812d2d490b5bce4ac89ebc3b42ffd68477e125ea5018b174d88
7
+ data.tar.gz: 680712597510385ea1054ee53d4d9005dd7cc1749fd7f950198bb3cc16a6cecec0a30b49f46145aeaed7552c1e1bfd964d2f26407b9e997fdbb9f2778b2fd0ce
@@ -9,6 +9,7 @@ module Polytexnic
9
9
  emphasis(doc)
10
10
  boldface(doc)
11
11
  small_caps(doc)
12
+ small(doc)
12
13
  typewriter(doc)
13
14
  skips(doc)
14
15
  verbatim(doc)
@@ -80,6 +81,14 @@ module Polytexnic
80
81
  end
81
82
  end
82
83
 
84
+ # Handles \small.
85
+ def small(doc)
86
+ doc.xpath('//hi[@rend="small"]').each do |node|
87
+ node.name = 'small'
88
+ node.remove_attribute('rend')
89
+ end
90
+ end
91
+
83
92
  # Handles \bigskip, etc.
84
93
  def skips(doc)
85
94
  doc.xpath('//p[@spacebefore]').each do |node|
@@ -553,7 +562,7 @@ module Polytexnic
553
562
  if node['rend'] == 'nonumber'
554
563
  # Add an id for linking based on the text of the section.
555
564
  text = node.children.first.text
556
- node['id'] = text.downcase.gsub(' ', '_')
565
+ node['id'] = text.downcase.gsub(' ', '_').gsub(/[^\w]/, '')
557
566
  node['class'] += '-star'
558
567
  end
559
568
  clean_node node, %w{type rend}
@@ -1,3 +1,3 @@
1
1
  module Polytexnic
2
- VERSION = "1.0.beta8"
2
+ VERSION = "1.0.0"
3
3
  end
@@ -186,7 +186,7 @@ describe 'Polytexnic::Pipeline#to_html' do
186
186
 
187
187
  describe '\section*, etc.' do
188
188
  let(:polytex) do <<-'EOS'
189
- \section*{Foo}
189
+ \section*{Foo: baz}
190
190
 
191
191
  \subsection*{Bar}
192
192
 
@@ -196,8 +196,8 @@ describe 'Polytexnic::Pipeline#to_html' do
196
196
  EOS
197
197
  end
198
198
  let(:output) do <<-'EOS'
199
- <div class="section-star" id="foo">
200
- <h2><a href="#foo" class="heading">Foo</a></h2>
199
+ <div class="section-star" id="foo_baz">
200
+ <h2><a href="#foo_baz" class="heading">Foo: baz</a></h2>
201
201
  <div class="subsection-star">
202
202
  <h3><a class="heading">Bar</a></h3>
203
203
  <p>Lorem ipsum</p>
@@ -32,6 +32,11 @@ describe 'Polytexnic::Pipeline#to_html' do
32
32
  it { should resemble '<span class="sc">small caps</span>' }
33
33
  end
34
34
 
35
+ describe "small text" do
36
+ let(:polytex) { '{\small small text}' }
37
+ it { should resemble '<small>small text</small>' }
38
+ end
39
+
35
40
  describe "typewriter text" do
36
41
  let(:polytex) { '\texttt{typewriter text}' }
37
42
  it { should resemble '<span class="tt">typewriter text</span>' }
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.0.beta8
4
+ version: 1.0.0
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: 2014-10-19 00:00:00.000000000 Z
12
+ date: 2015-02-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: nokogiri
@@ -286,12 +286,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
286
286
  version: '0'
287
287
  required_rubygems_version: !ruby/object:Gem::Requirement
288
288
  requirements:
289
- - - ">"
289
+ - - ">="
290
290
  - !ruby/object:Gem::Version
291
- version: 1.3.1
291
+ version: '0'
292
292
  requirements: []
293
293
  rubyforge_project:
294
- rubygems_version: 2.2.2
294
+ rubygems_version: 2.4.4
295
295
  signing_key:
296
296
  specification_version: 4
297
297
  summary: Convert from PolyTeX & Markdown to HTML & LaTeX