liveblog 0.4.3 → 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 +2 -1
- data.tar.gz.sig +1 -2
- data/lib/liveblog.css +117 -0
- data/lib/liveblog.rb +37 -23
- metadata +2 -1
- metadata.gz.sig +2 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 07c2d324bf12fdf6e1e724c5d0995cda117eda39
|
|
4
|
+
data.tar.gz: ac47bcb00f5c5bcd912b4866f5528297bc644929
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 0dfd3e16ea4465f56ab7cfba777bdc9fa2807bf08131573dd53c6bb645d60983dd23f123723dfba6a868b3ea14219e0c0673e2f209a184f19a2a23f9c2e191fc
|
|
7
|
+
data.tar.gz: 748e5a9ea4e3a3e9684cedf963094836e0a8bb70aa508e149bfa2b145b60f5a09afe9309710254b0bbd8f80f510698f6acdbf31b3b3d1f0f8c42e2d9afb3ff68
|
checksums.yaml.gz.sig
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
�+��S�Ag�u����bT��IIe�)��ׯ�9��G������e��l���p+�@MC�Ʒ�~i-'�PoY۔�v�lΞu{l����!��c~���5����gJ�j����3�Y�/ċ4��BjdR!��|�8�~��.��W�����#+�z��P��2�� q�S��dd�RPKO^u���<��r�a�B7�q�.qެ,>��J�� �gu4`x�K y�ð�m9�a��
|
|
2
|
+
��ħr��`����
|
data.tar.gz.sig
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
<A��)����fqH�{�50�H���[�Lgp��qx�.;I��a3�}��nM�t�$�C��<Cw��5K!�Rk�������Q�I,`�b��Y�,u�F�Oԇ�ʴk5c�=E�L�⺏���#�t�"_�u�#8�:��
|
|
1
|
+
�6�4EtF�]Xް�eF4DHx�'��]�aG|G�k� F�B�4H�~Hm�a���6���d+t{����>�6�����K����o�� �T4�~�5k8���9��yJ/~(J4]�0=�Ú�D�q�o�mB;F����8εʢ�[}�.�]�9}:mS���E�O�=TR(�5��5��{5��sa������'�ј.��S��vDž�Z�J��N*]-3�(�@Zf�F&�E�3�7�ǓW�/'��8&$���:�-K
|
data/lib/liveblog.css
ADDED
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
body { background-color: #c48f33;}
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
header{
|
|
5
|
+
background-color: rgba(200,200,200,0.1);
|
|
6
|
+
border-top: 1px solid rgba(100,150,100,0.4);
|
|
7
|
+
border-bottom: 1px solid rgba(100,150,100,0.4);
|
|
8
|
+
overflow: hidden
|
|
9
|
+
margin: 0.3em; padding: 0.3em 0.1em;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
header>nav:first-child>ul{
|
|
13
|
+
background-color: transparent;
|
|
14
|
+
list-style-type: none;
|
|
15
|
+
margin: 0.2em; padding: 0.3em;
|
|
16
|
+
}
|
|
17
|
+
header>nav:first-child>ul>li {
|
|
18
|
+
background-color: transparent;
|
|
19
|
+
color: #392;
|
|
20
|
+
display: inline;
|
|
21
|
+
font-family: Verdana, Arial;
|
|
22
|
+
font-size: 1em;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
header>nav:first-child>ul>li~li:before {
|
|
26
|
+
background-color: transparent; color: rgba(100,150,100,0.6);
|
|
27
|
+
content: "> ";
|
|
28
|
+
}
|
|
29
|
+
header>nav>ul>li>a {background-color: tansparent; color: #494;}
|
|
30
|
+
header>nav>ul>li>a:hover {background-color: transparent; color: #272;}
|
|
31
|
+
header>nav>ul>li>a:focus {background-color: #161; color: #fff;}
|
|
32
|
+
header>nav>ul>li>a:active {background-color: rgba(200,200,200,0.4); color: #5a5;}
|
|
33
|
+
article {
|
|
34
|
+
background-color: #AFC332;
|
|
35
|
+
|
|
36
|
+
overflow: hidden;
|
|
37
|
+
}
|
|
38
|
+
section {
|
|
39
|
+
background-color: #E2C38D;
|
|
40
|
+
color: #4532C3;
|
|
41
|
+
float: left;
|
|
42
|
+
font-size: 1.2em;
|
|
43
|
+
margin: 1.7em 0.7em 1.7em 1.7em; padding: 2.0em 4.6em;
|
|
44
|
+
max-width: 500px
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
section h1 {
|
|
48
|
+
background-color: #D5A95D;
|
|
49
|
+
/*color: #C34532;*/
|
|
50
|
+
margin: 0.4em 0em 1.2em 0em;
|
|
51
|
+
padding: 1em 1.5em;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
section p {
|
|
55
|
+
|
|
56
|
+
background-color: #ee3;
|
|
57
|
+
background-color: transparent;
|
|
58
|
+
margin: 0.4em 0.4em; padding: 0.6em 1.5em;
|
|
59
|
+
}
|
|
60
|
+
section a {
|
|
61
|
+
background-color: transparent;
|
|
62
|
+
color: #8E32C3;
|
|
63
|
+
text-decoration: none;
|
|
64
|
+
}
|
|
65
|
+
section a:link {
|
|
66
|
+
background-color: transparent;
|
|
67
|
+
color: #911;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
section a:hover {
|
|
71
|
+
background-color: transparent;
|
|
72
|
+
color: #C33267;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
section a:active {
|
|
76
|
+
background-color: #ddd;
|
|
77
|
+
color: #C33267;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
article aside {
|
|
83
|
+
background-color: transparent;
|
|
84
|
+
color: #c48f33;
|
|
85
|
+
float: right;
|
|
86
|
+
margin-right: 1em;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
aside ul {
|
|
90
|
+
background-color: transparent;
|
|
91
|
+
list-style-type: none;
|
|
92
|
+
margin: 0.4em 0.7em;
|
|
93
|
+
padding: 0.6em 0.9em;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
aside ul li {
|
|
97
|
+
background-color: #e33;
|
|
98
|
+
background-color: transparent;
|
|
99
|
+
font-family: helvetica, arial;
|
|
100
|
+
font-size: 2.6em;
|
|
101
|
+
font-weight: 900;
|
|
102
|
+
|
|
103
|
+
margin: 0.4em;
|
|
104
|
+
padding: 0.9em;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
aside ul li a{
|
|
108
|
+
background-color: transparent;
|
|
109
|
+
color: #eee;
|
|
110
|
+
text-decoration: none;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
aside ul li a:hover {
|
|
114
|
+
background-color: rgba(100, 100, 100, 0.5);
|
|
115
|
+
color: #eee;
|
|
116
|
+
text-decoration: none;
|
|
117
|
+
}
|
data/lib/liveblog.rb
CHANGED
|
@@ -9,11 +9,12 @@ require 'martile'
|
|
|
9
9
|
|
|
10
10
|
class LiveBlog
|
|
11
11
|
|
|
12
|
-
def initialize(liveblogfilepath='.', urlbase: '/liveblog', edit_url: '/'
|
|
12
|
+
def initialize(liveblogfilepath='.', urlbase: '/liveblog', edit_url: '/', \
|
|
13
|
+
css_url: '/liveblog/liveblog.css')
|
|
13
14
|
|
|
14
15
|
Dir.chdir liveblogfilepath
|
|
15
16
|
|
|
16
|
-
@urlbase, @edit_url = urlbase, edit_url
|
|
17
|
+
@urlbase, @edit_url, @css_url = urlbase, edit_url, css_url
|
|
17
18
|
@t = Time.now
|
|
18
19
|
dxfile = File.join(path(), 'index.xml')
|
|
19
20
|
|
|
@@ -41,6 +42,29 @@ class LiveBlog
|
|
|
41
42
|
[true, "%s %s/%s/%s" % [entry, @urlbase, path(), hashtag]]
|
|
42
43
|
end
|
|
43
44
|
|
|
45
|
+
def new_file(s=nil)
|
|
46
|
+
|
|
47
|
+
s ||= <<EOF
|
|
48
|
+
<?dynarex schema="sections[title, edit_url, date, css_url]/section(x)"?>
|
|
49
|
+
title: LiveBlog #{ordinalize(@t.day) + @t.strftime(" %B %Y")}
|
|
50
|
+
edit_url: #{@edit_url}
|
|
51
|
+
date: #{Date.today}
|
|
52
|
+
css_url: #{@css_url}
|
|
53
|
+
--#
|
|
54
|
+
|
|
55
|
+
EOF
|
|
56
|
+
|
|
57
|
+
FileUtils.mkdir_p path()
|
|
58
|
+
|
|
59
|
+
@dx = Dynarex.new
|
|
60
|
+
@dx.import s
|
|
61
|
+
@dx.default_key = 'uid'
|
|
62
|
+
|
|
63
|
+
save()
|
|
64
|
+
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
alias import new_file
|
|
44
68
|
|
|
45
69
|
private
|
|
46
70
|
|
|
@@ -60,28 +84,7 @@ class LiveBlog
|
|
|
60
84
|
@dx.create({x: raw_entry})
|
|
61
85
|
[true, 'section added']
|
|
62
86
|
end
|
|
63
|
-
|
|
64
|
-
def new_file
|
|
65
|
-
|
|
66
|
-
s =<<EOF
|
|
67
|
-
<?dynarex schema="sections[title, edit_url, date]/section(x)"?>
|
|
68
|
-
title: LiveBlog #{ordinalize(@t.day) + @t.strftime(" %B %Y")}
|
|
69
|
-
edit_url: #{@edit_url}
|
|
70
|
-
date: #{Date.today}
|
|
71
|
-
--#
|
|
72
|
-
|
|
73
|
-
EOF
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
FileUtils.mkdir_p path()
|
|
77
|
-
|
|
78
|
-
@dx = Dynarex.new
|
|
79
|
-
@dx.import s
|
|
80
|
-
@dx.default_key = 'uid'
|
|
81
|
-
|
|
82
|
-
save()
|
|
83
87
|
|
|
84
|
-
end
|
|
85
88
|
|
|
86
89
|
def path
|
|
87
90
|
|
|
@@ -103,6 +106,11 @@ EOF
|
|
|
103
106
|
|
|
104
107
|
doc = Rexle.new File.read(newfilepath)
|
|
105
108
|
|
|
109
|
+
summary = doc.root.element('summary')
|
|
110
|
+
summary.element('edit_url').text += "%s/%s/index.txt" % [@url_edit, path()]
|
|
111
|
+
date = summary.element('date')
|
|
112
|
+
date.text = Date.parse(date.text).strftime("%d-%b-%Y").upcase
|
|
113
|
+
|
|
106
114
|
doc.root.xpath('records/section/x') do |x|
|
|
107
115
|
|
|
108
116
|
s = "=%s\n%s\n=" % [x.text.lines.first[/#\w+$/], x.text]
|
|
@@ -133,6 +141,12 @@ EOF
|
|
|
133
141
|
out = xslt.transform(Nokogiri::XML(doc.xml))
|
|
134
142
|
File.write File.join(path(), 'index.html'), out
|
|
135
143
|
|
|
144
|
+
# save the related CSS file locally if the file doesn't already exist
|
|
145
|
+
if not File.exists? 'liveblog.css' then
|
|
146
|
+
FileUtils.cp File.join(File.dirname(__FILE__), 'liveblog.css'),\
|
|
147
|
+
'liveblog.css' if not File.exists? 'liveblog.css'
|
|
148
|
+
end
|
|
149
|
+
|
|
136
150
|
end
|
|
137
151
|
|
|
138
152
|
def ordinalize(n)
|
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.5.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- James Robertson
|
|
@@ -79,6 +79,7 @@ executables: []
|
|
|
79
79
|
extensions: []
|
|
80
80
|
extra_rdoc_files: []
|
|
81
81
|
files:
|
|
82
|
+
- lib/liveblog.css
|
|
82
83
|
- lib/liveblog.rb
|
|
83
84
|
- lib/liveblog.xsl
|
|
84
85
|
homepage: https://github.com/jrobertson/liveblog
|
metadata.gz.sig
CHANGED
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
���X�O,��KUFa9�V�tXsW�-w��[��Tìn9K�x�S�+�9��o�>��������|�bg�<N|��)��xIw�t`��:�F���~l���0X�_|�MH����A��x�����>G�,�a��gn�<a�6<cwA��x�`�z�y���&晅8�w(Pn�����J �
|
|
1
|
+
g#G�a��~˛�����wf�70�>�K9����z!�JX�+�昍����NX�y�_1�
|
|
2
|
+
m����F��6_���iW–
|