liveblog 1.1.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +2 -4
- data.tar.gz.sig +0 -0
- data/lib/liveblog.css +13 -0
- data/lib/liveblog.rb +16 -11
- data/lib/liveblog.xsl +1 -0
- data/lib/today.xsl +97 -0
- metadata +4 -3
- 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: d574eca2cd80707277fb9f226580027004d61060
|
4
|
+
data.tar.gz: 8689a3244cd648c04a4a803dfc0dd356f1ba9b77
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c7f87bcf5b845e0a0a43c87ac70c92f42184436e7788f3c208c708b6481d1ea1c2325be511a5ff867fb4957be659fdf0aea5abf67a4f85c22ba2b86b52260335
|
7
|
+
data.tar.gz: 42baed27cfab64c6be46b1364c5ea02d062683295bd94e562749950aef5ca4c0721d952f5df18c32e8140c7e6d3f96484e2d322001ff0dc55b4b8f296df72956
|
checksums.yaml.gz.sig
CHANGED
@@ -1,4 +1,2 @@
|
|
1
|
-
�
|
2
|
-
|
3
|
-
�qG7�]��A�3K�ts����M;��C�������q+ً�T㮝+��ո�pNb{���A����%�Q��1���6�mi���������o3e�J|�\c��|�O��J��?[Bf��{g�!֞����x���4�Z��0?%OYw��Do�,��C(��(�cr��M^���#�ڞR����� @L,���4c1��Ѝ�)����M�q"v
|
4
|
-
*�mߵ�+�
|
1
|
+
8mwf�kBo�֣��\�qȻ���T��ۅ��*|�$0��覀��q�:Cܘ��D����������ɛ��)s�w?��e"h���On�d��ҥO�������e.���2ޠ��3n�,���41NX������
|
2
|
+
����\0%��Xw����c��/�}���a7ݢ
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/liveblog.css
CHANGED
@@ -82,6 +82,19 @@ body {
|
|
82
82
|
color: #C332AF;
|
83
83
|
}
|
84
84
|
|
85
|
+
#gotoday {
|
86
|
+
color: #431;
|
87
|
+
font-size: 1.5em;
|
88
|
+
position: absolute;
|
89
|
+
right: 20px;
|
90
|
+
top: 137px;
|
91
|
+
text-decoration: none;
|
92
|
+
}
|
93
|
+
|
94
|
+
#gotoday:hover {
|
95
|
+
color: #ee3;
|
96
|
+
}
|
97
|
+
|
85
98
|
.arrow, .deadarrow {
|
86
99
|
background-color: #444;
|
87
100
|
background-color: transparent;
|
data/lib/liveblog.rb
CHANGED
@@ -30,10 +30,12 @@ class LiveBlog
|
|
30
30
|
|
31
31
|
h = SimpleConfig.new(config).to_h
|
32
32
|
|
33
|
-
@dir, @urlbase, @edit_url, @css_url, @xsl_path, \
|
34
|
-
@xsl_url, @bannertext, @title, @rss_title, @rss_lang,
|
35
|
-
|
36
|
-
|
33
|
+
@dir, @urlbase, @edit_url, @css_url, @xsl_path, @xsl_today_path, \
|
34
|
+
@xsl_url, @bannertext, @title, @rss_title, @rss_lang, \
|
35
|
+
@hyperlink_today, plugins = \
|
36
|
+
(%i(dir urlbase edit_url css_url xsl_path xsl_today_path xsl_url) \
|
37
|
+
+ %i( bannertext title rss_title rss_lang hyperlink_today ) \
|
38
|
+
+ %i(plugins)).map{|x| h[x]}
|
37
39
|
|
38
40
|
@title ||= 'LiveBlog'
|
39
41
|
@rss_lang ||= 'en-gb'
|
@@ -290,7 +292,9 @@ EOF
|
|
290
292
|
edit_url: 'http://www.yourwebsitehere.org/do/liveblog/edit',
|
291
293
|
css_url: '/liveblog/liveblog.css',
|
292
294
|
xsl_path: File.join(dir, 'liveblog.xsl'),
|
295
|
+
xsl_today_path: File.join(dir, 'liveblog_today.xsl'),
|
293
296
|
xsl_url: '/liveblog/liveblog.xsl',
|
297
|
+
hyperlink_today: 'http://yourwebsite.org/go_to_today',
|
294
298
|
bannertext: '',
|
295
299
|
title: "John Smith's LiveBlog",
|
296
300
|
rss_title: "John Smith's LiveBlog",
|
@@ -337,6 +341,7 @@ EOF
|
|
337
341
|
add summary, 'next_day', @d == Date.today ? '' : static_urlpath(@d+1)
|
338
342
|
add summary, 'bannertext', @bannertext
|
339
343
|
add summary, 'link', static_urlpath(@d)
|
344
|
+
add summary, 'hyperlink_today', @hyperlink_today
|
340
345
|
|
341
346
|
tags = Rexle::Element.new('tags')
|
342
347
|
|
@@ -422,8 +427,8 @@ EOF
|
|
422
427
|
end
|
423
428
|
|
424
429
|
@plugins.each {|x| x.on_doc_update(doc) if x.respond_to? :on_doc_update }
|
425
|
-
|
426
|
-
render_html doc
|
430
|
+
|
431
|
+
render_html doc, xsl: @xsl_today_path
|
427
432
|
File.write formatted_filepath, doc.xml(pretty: true)
|
428
433
|
|
429
434
|
end
|
@@ -436,11 +441,11 @@ EOF
|
|
436
441
|
def add(summary, name, s)
|
437
442
|
summary.add Rexle::Element.new(name).add_text s
|
438
443
|
end
|
444
|
+
|
445
|
+
def render_html(doc, d=@d, xsl: @xsl_path)
|
439
446
|
|
440
|
-
|
441
|
-
|
442
|
-
xslt_buffer = if @xsl_path then
|
443
|
-
buffer, _ = RXFHelper.read @xsl_path
|
447
|
+
xslt_buffer = if xsl then
|
448
|
+
buffer, _ = RXFHelper.read xsl
|
444
449
|
buffer
|
445
450
|
else
|
446
451
|
lib = File.exists?('liveblog.xsl') ? '.' : File.dirname(__FILE__)
|
@@ -545,4 +550,4 @@ EOF
|
|
545
550
|
nil
|
546
551
|
end
|
547
552
|
end
|
548
|
-
end
|
553
|
+
end
|
data/lib/liveblog.xsl
CHANGED
data/lib/today.xsl
ADDED
@@ -0,0 +1,97 @@
|
|
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
|
+
<link rel='stylesheet' type='text/css' href='{summary/css_url}' media='screen, projection, tv, print'/>
|
11
|
+
</head>
|
12
|
+
<body>
|
13
|
+
<div id="wrap">
|
14
|
+
<header>
|
15
|
+
<nav>
|
16
|
+
<ul>
|
17
|
+
<li>
|
18
|
+
<a href="/">home</a>
|
19
|
+
</li>
|
20
|
+
<li>
|
21
|
+
<a href="/liveblog">liveblog</a>
|
22
|
+
</li>
|
23
|
+
</ul>
|
24
|
+
</nav>
|
25
|
+
</header>
|
26
|
+
|
27
|
+
<xsl:if test='summary/bannertext'>
|
28
|
+
<p><xsl:value-of select='summary/bannertext'/></p>
|
29
|
+
</xsl:if>
|
30
|
+
|
31
|
+
<div id='summary'>
|
32
|
+
<ul>
|
33
|
+
<xsl:for-each select="records/section">
|
34
|
+
<!--<xsl:sort select='../@id' order='descending'/>-->
|
35
|
+
<li><a href='#{@id}'><xsl:value-of select='details/summary/h1'/></a></li>
|
36
|
+
</xsl:for-each>
|
37
|
+
</ul>
|
38
|
+
</div>
|
39
|
+
<aside>
|
40
|
+
<ul>
|
41
|
+
<li>
|
42
|
+
<xsl:value-of select='summary/date'/>
|
43
|
+
</li>
|
44
|
+
<li>
|
45
|
+
<xsl:value-of select='summary/day'/>
|
46
|
+
</li>
|
47
|
+
<li>
|
48
|
+
<a href='{summary/prev_day}' class='arrow'>←</a>
|
49
|
+
<xsl:element name="a">
|
50
|
+
<xsl:choose>
|
51
|
+
<xsl:when test="summary/next_day != ''">
|
52
|
+
<xsl:attribute name="class">arrow</xsl:attribute>
|
53
|
+
</xsl:when>
|
54
|
+
<xsl:otherwise>
|
55
|
+
<xsl:attribute name="class">deadarrow</xsl:attribute>
|
56
|
+
</xsl:otherwise>
|
57
|
+
</xsl:choose>
|
58
|
+
<xsl:attribute name="href"><xsl:value-of select="summary/next_day"/></xsl:attribute>
|
59
|
+
→
|
60
|
+
</xsl:element>
|
61
|
+
</li>
|
62
|
+
<li>
|
63
|
+
<a href="{summary/edit_url}" rel="nofollow">edit</a>
|
64
|
+
</li>
|
65
|
+
</ul>
|
66
|
+
</aside>
|
67
|
+
<article>
|
68
|
+
<div style='clear:both'/>
|
69
|
+
<xsl:for-each select="records/section">
|
70
|
+
<!--<xsl:sort select='@id' order='descending'/>-->
|
71
|
+
<xsl:copy-of select='.'/>
|
72
|
+
|
73
|
+
</xsl:for-each>
|
74
|
+
|
75
|
+
<footer>
|
76
|
+
<dl id="info">
|
77
|
+
<dt>Tags:</dt>
|
78
|
+
<dd>
|
79
|
+
<ul>
|
80
|
+
<xsl:for-each select="summary/tags/*">
|
81
|
+
<li><xsl:value-of select="."/></li>
|
82
|
+
</xsl:for-each>
|
83
|
+
</ul>
|
84
|
+
</dd>
|
85
|
+
<dt>Source:</dt>
|
86
|
+
<dd><a href="index.txt">index.txt</a></dd>
|
87
|
+
<dt>XML:</dt>
|
88
|
+
<dd><a href="formatted.xml">formatted.xml</a></dd>
|
89
|
+
<dt>Published:</dt><dd><xsl:value-of select="summary/published"/></dd>
|
90
|
+
</dl>
|
91
|
+
</footer>
|
92
|
+
</article>
|
93
|
+
</div>
|
94
|
+
</body>
|
95
|
+
</html>
|
96
|
+
</xsl:template>
|
97
|
+
</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: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -31,7 +31,7 @@ cert_chain:
|
|
31
31
|
5s8qc8N6iJi3jGcarS1hVkhlWGshAZx1T0n/Q27m1S0GoVUebJYFJxqaZqL5FO/v
|
32
32
|
NonZ4ByUi+SaTg==
|
33
33
|
-----END CERTIFICATE-----
|
34
|
-
date: 2016-
|
34
|
+
date: 2016-06-10 00:00:00.000000000 Z
|
35
35
|
dependencies:
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: dxsectionx
|
@@ -122,6 +122,7 @@ files:
|
|
122
122
|
- lib/liveblog.css
|
123
123
|
- lib/liveblog.rb
|
124
124
|
- lib/liveblog.xsl
|
125
|
+
- lib/today.xsl
|
125
126
|
homepage: https://github.com/jrobertson/liveblog
|
126
127
|
licenses:
|
127
128
|
- MIT
|
@@ -142,7 +143,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
142
143
|
version: '0'
|
143
144
|
requirements: []
|
144
145
|
rubyforge_project:
|
145
|
-
rubygems_version: 2.
|
146
|
+
rubygems_version: 2.5.1
|
146
147
|
signing_key:
|
147
148
|
specification_version: 4
|
148
149
|
summary: Uses the Dynarex gem to create a daily live blog. Convenient for grouping
|
metadata.gz.sig
CHANGED
Binary file
|