myoutline 0.4.5 → 0.5.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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/lib/myoutline.rb +9 -80
- metadata +4 -4
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 24d6fa7d167581e1e30ee892e60a3801f7386d59e40d32101ee15bcf3943c9e3
|
|
4
|
+
data.tar.gz: e1861d417ceb0e21b92b3fe0393bae2857dd1a859790582a28b6031df0215068
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d7ed8d838eaaf1d5c2b5033a5dd51cc63ab66c2e0d3797d7b2472104fd00160555d131d4adb8a6e1f3d42ee27fa781ab99bd19d9cbb6c44e65aa9f3e7380c3c8
|
|
7
|
+
data.tar.gz: ff51e98d9bc6292e74f88e62b985e20d304430e04fba31b3f4b8a446aa38df0b4d5ce36d6eacb04a24ad43de7153bc25c7176fded43f8ee64f454a70a480e484
|
checksums.yaml.gz.sig
CHANGED
|
Binary file
|
data.tar.gz.sig
CHANGED
|
Binary file
|
data/lib/myoutline.rb
CHANGED
|
@@ -38,6 +38,10 @@ class MyOutline
|
|
|
38
38
|
end
|
|
39
39
|
|
|
40
40
|
end
|
|
41
|
+
|
|
42
|
+
def build_html(&blk)
|
|
43
|
+
@pxi.build_html(&blk)
|
|
44
|
+
end
|
|
41
45
|
|
|
42
46
|
def locate(s)
|
|
43
47
|
@links.locate s
|
|
@@ -183,41 +187,14 @@ class MyOutline
|
|
|
183
187
|
end
|
|
184
188
|
|
|
185
189
|
def to_html()
|
|
186
|
-
|
|
187
|
-
px = self.outline.to_px
|
|
188
190
|
|
|
189
|
-
|
|
191
|
+
@outline.build_html do |e|
|
|
190
192
|
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
s = x.title.gsub(/ +/,'-')
|
|
195
|
-
x.attributes[:trail] = trail.nil? ? s : trail + '/' + s
|
|
196
|
-
|
|
197
|
-
end
|
|
193
|
+
e.attributes[:href] = @topic_url.sub(/\$topic/, e.text)\
|
|
194
|
+
.sub(/\$id/, e.attributes[:id]).sub(/\$trail/, e.attributes[:trail])\
|
|
195
|
+
.to_s.gsub(/ +/,'-')
|
|
198
196
|
|
|
199
|
-
end
|
|
200
|
-
|
|
201
|
-
doc = Nokogiri::XML(px.to_xml)
|
|
202
|
-
xsl = Nokogiri::XSLT(xslt())
|
|
203
|
-
|
|
204
|
-
html_doc = Rexle.new(xsl.transform(doc).to_s)
|
|
205
|
-
|
|
206
|
-
html_doc.root.css('.atopic').each do |e|
|
|
207
|
-
|
|
208
|
-
puts 'e: ' + e.parent.parent.xml.inspect if @debug
|
|
209
|
-
|
|
210
|
-
href = e.attributes[:href]
|
|
211
|
-
if href.empty? or href[0] == '!' then
|
|
212
|
-
|
|
213
|
-
e.attributes[:href] = @topic_url.sub(/\$topic/, e.text)\
|
|
214
|
-
.sub(/\$id/, e.attributes[:id]).sub(/\$trail/, e.attributes[:trail])\
|
|
215
|
-
.to_s.gsub(/ +/,'-')
|
|
216
|
-
|
|
217
|
-
end
|
|
218
|
-
end
|
|
219
|
-
|
|
220
|
-
html_doc.xml(pretty: true, declaration: false)
|
|
197
|
+
end
|
|
221
198
|
|
|
222
199
|
end
|
|
223
200
|
|
|
@@ -242,54 +219,6 @@ class MyOutline
|
|
|
242
219
|
end
|
|
243
220
|
|
|
244
221
|
end
|
|
245
|
-
|
|
246
|
-
def xslt()
|
|
247
|
-
<<EOF
|
|
248
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
249
|
-
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
|
|
250
|
-
<xsl:output method="xml" indent="yes" />
|
|
251
|
-
|
|
252
|
-
<xsl:template match='entries'>
|
|
253
|
-
<ul>
|
|
254
|
-
<xsl:apply-templates select='summary'/>
|
|
255
|
-
<xsl:apply-templates select='records'/>
|
|
256
|
-
</ul>
|
|
257
|
-
</xsl:template>
|
|
258
|
-
|
|
259
|
-
<xsl:template match='entries/summary'>
|
|
260
|
-
</xsl:template>
|
|
261
|
-
|
|
262
|
-
<xsl:template match='records/section'>
|
|
263
|
-
<li><h1><xsl:value-of select="summary/heading"/></h1><xsl:text>
|
|
264
|
-
</xsl:text>
|
|
265
|
-
|
|
266
|
-
<xsl:apply-templates select='records'/>
|
|
267
|
-
|
|
268
|
-
<xsl:text>
|
|
269
|
-
</xsl:text>
|
|
270
|
-
</li>
|
|
271
|
-
</xsl:template>
|
|
272
222
|
|
|
273
223
|
|
|
274
|
-
<xsl:template match='records/entry'>
|
|
275
|
-
<ul id="{summary/title}">
|
|
276
|
-
<li><xsl:text>
|
|
277
|
-
</xsl:text>
|
|
278
|
-
<a href="{summary/url}" class='atopic' id='{@id}' trail='{@trail}'>
|
|
279
|
-
<xsl:value-of select="summary/title"/></a><xsl:text>
|
|
280
|
-
</xsl:text>
|
|
281
|
-
|
|
282
|
-
<xsl:apply-templates select='records'/>
|
|
283
|
-
|
|
284
|
-
<xsl:text>
|
|
285
|
-
</xsl:text>
|
|
286
|
-
</li>
|
|
287
|
-
</ul>
|
|
288
|
-
</xsl:template>
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
</xsl:stylesheet>
|
|
292
|
-
EOF
|
|
293
|
-
end
|
|
294
|
-
|
|
295
224
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: myoutline
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.5.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- James Robertson
|
|
@@ -30,7 +30,7 @@ cert_chain:
|
|
|
30
30
|
DFhc5TDtqEkJYiaiznQFl34HUKeCAdeAHkmD8jP3fUC8O7zcLXq69EAXGMXw4efB
|
|
31
31
|
3Co=
|
|
32
32
|
-----END CERTIFICATE-----
|
|
33
|
-
date: 2019-01-
|
|
33
|
+
date: 2019-01-16 00:00:00.000000000 Z
|
|
34
34
|
dependencies:
|
|
35
35
|
- !ruby/object:Gem::Dependency
|
|
36
36
|
name: pxindex
|
|
@@ -41,7 +41,7 @@ dependencies:
|
|
|
41
41
|
version: '0.2'
|
|
42
42
|
- - ">="
|
|
43
43
|
- !ruby/object:Gem::Version
|
|
44
|
-
version: 0.2.
|
|
44
|
+
version: 0.2.1
|
|
45
45
|
type: :runtime
|
|
46
46
|
prerelease: false
|
|
47
47
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -51,7 +51,7 @@ dependencies:
|
|
|
51
51
|
version: '0.2'
|
|
52
52
|
- - ">="
|
|
53
53
|
- !ruby/object:Gem::Version
|
|
54
|
-
version: 0.2.
|
|
54
|
+
version: 0.2.1
|
|
55
55
|
- !ruby/object:Gem::Dependency
|
|
56
56
|
name: nokogiri
|
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
metadata.gz.sig
CHANGED
|
Binary file
|