liveblog 0.2.0 → 0.3.1
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/liveblog.rb +23 -4
- data/lib/liveblog.xsl +23 -0
- metadata +6 -5
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0d74a7db4baa06c88624936dc0378ef25b7e886e
|
4
|
+
data.tar.gz: 23bf500a909e1cab502c8323d71e31c94972c522
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 54c3706263e5ba672de086a9c66d9a4e208063cb54376cb2d90411825053dbc8591c517ad2461a608142b02e13ea15adb739b4e19f16bf0220d6d91a2279751b
|
7
|
+
data.tar.gz: 8a83bcb6e74282653bcae1719b52878e7d9177601d1502935d20aa4727ba96f83d6dc08efc522581a75272951467043397cfaf1e5c132bc893ae6c2fb7295874
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/liveblog.rb
CHANGED
@@ -90,14 +90,33 @@ EOF
|
|
90
90
|
doc = Rexle.new File.read(newfilepath)
|
91
91
|
|
92
92
|
doc.root.xpath('records/section/x') do |x|
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
93
|
+
|
94
|
+
s = "=%s\n%s\n=" % [x.text.lines.first[/#\w+$/], x.text]
|
95
|
+
html = Martile.new(s).to_html
|
96
|
+
|
97
|
+
e = x.parent
|
98
|
+
x.delete
|
99
|
+
doc2 = Rexle.new(html)
|
100
|
+
|
101
|
+
h1 = doc2.root.element('h1')
|
102
|
+
details = Rexle::Element.new('details')
|
103
|
+
summary = Rexle::Element.new('summary')
|
104
|
+
summary.add h1
|
105
|
+
|
106
|
+
details.add summary
|
107
|
+
doc2.root.xpath('.').each {|x| details.add x }
|
108
|
+
doc2.root.add details
|
109
|
+
e.add doc2.root
|
97
110
|
end
|
98
111
|
|
99
112
|
File.write newfilepath, doc.xml(pretty: true)
|
100
113
|
|
114
|
+
lib = File.dirname(__FILE__)
|
115
|
+
xslt_buffer = File.read File.join(lib,'liveblog.xsl')
|
116
|
+
xslt = Nokogiri::XSLT(xslt_buffer)
|
117
|
+
out = xslt.transform(Nokogiri::XML(doc.xml))
|
118
|
+
File.write File.join(path(), 'index.html'), out
|
119
|
+
|
101
120
|
end
|
102
121
|
|
103
122
|
def ordinalize(n)
|
data/lib/liveblog.xsl
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
2
|
+
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
3
|
+
<xsl:output method="html" encoding="utf-8" indent="yes" />
|
4
|
+
|
5
|
+
<xsl:template match="*">
|
6
|
+
<xsl:text disable-output-escaping='yes'><!DOCTYPE html></xsl:text>
|
7
|
+
<html>
|
8
|
+
<head>
|
9
|
+
<title><xsl:value-of select='summary/title'/></title>
|
10
|
+
</head>
|
11
|
+
<body>
|
12
|
+
<xsl:for-each select="records/section">
|
13
|
+
<xsl:text>
|
14
|
+
</xsl:text>
|
15
|
+
<xsl:copy-of select='section'/>
|
16
|
+
|
17
|
+
<xsl:text>
|
18
|
+
</xsl:text>
|
19
|
+
</xsl:for-each>
|
20
|
+
</body>
|
21
|
+
</html>
|
22
|
+
</xsl:template>
|
23
|
+
</xsl:stylesheet>
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: liveblog
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -42,7 +42,7 @@ dependencies:
|
|
42
42
|
version: '1.5'
|
43
43
|
- - ">="
|
44
44
|
- !ruby/object:Gem::Version
|
45
|
-
version: 1.5.
|
45
|
+
version: 1.5.5
|
46
46
|
type: :runtime
|
47
47
|
prerelease: false
|
48
48
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -52,7 +52,7 @@ dependencies:
|
|
52
52
|
version: '1.5'
|
53
53
|
- - ">="
|
54
54
|
- !ruby/object:Gem::Version
|
55
|
-
version: 1.5.
|
55
|
+
version: 1.5.5
|
56
56
|
- !ruby/object:Gem::Dependency
|
57
57
|
name: martile
|
58
58
|
requirement: !ruby/object:Gem::Requirement
|
@@ -62,7 +62,7 @@ dependencies:
|
|
62
62
|
version: '0.5'
|
63
63
|
- - ">="
|
64
64
|
- !ruby/object:Gem::Version
|
65
|
-
version: 0.5.
|
65
|
+
version: 0.5.2
|
66
66
|
type: :runtime
|
67
67
|
prerelease: false
|
68
68
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -72,7 +72,7 @@ dependencies:
|
|
72
72
|
version: '0.5'
|
73
73
|
- - ">="
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: 0.5.
|
75
|
+
version: 0.5.2
|
76
76
|
description:
|
77
77
|
email: james@r0bertson.co.uk
|
78
78
|
executables: []
|
@@ -80,6 +80,7 @@ extensions: []
|
|
80
80
|
extra_rdoc_files: []
|
81
81
|
files:
|
82
82
|
- lib/liveblog.rb
|
83
|
+
- lib/liveblog.xsl
|
83
84
|
homepage: https://github.com/jrobertson/liveblog
|
84
85
|
licenses:
|
85
86
|
- MIT
|
metadata.gz.sig
CHANGED
Binary file
|