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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f0e23a1be73cee0d1562d4476190c696b0b5c0f1
|
4
|
+
data.tar.gz: 27e570b110bd0de3cc5e765900994b154b53afb0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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}
|
data/lib/polytexnic/version.rb
CHANGED
@@ -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="
|
200
|
-
<h2><a href="#
|
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.
|
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:
|
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:
|
291
|
+
version: '0'
|
292
292
|
requirements: []
|
293
293
|
rubyforge_project:
|
294
|
-
rubygems_version: 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
|