tdiary-style-org 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.travis.yml +6 -0
- data/Gemfile +4 -0
- data/LICENSE +21 -0
- data/README.org +58 -0
- data/Rakefile +7 -0
- data/lib/tdiary/style/html_tags.yml +8 -0
- data/lib/tdiary/style/org/version.rb +7 -0
- data/lib/tdiary/style/org.rb +142 -0
- data/lib/tdiary-style-org.rb +1 -0
- data/tdiary-style-org.gemspec +26 -0
- data/test/tdiary/style/org-test.rb +225 -0
- data/test/test_helper.rb +11 -0
- metadata +115 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 712002e7d2b01589e3316a3b18430056a45e16fd
|
4
|
+
data.tar.gz: 73c33b65eadbd31184d0f75aa1448b0951f8f712
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 17dc82f980faec9afd5871597787631499aee31b1787af46bd1b59026080a1e8725dc570229441e9f0c291faf7f2beb9231e99e31ea455e471e8c0d545a8c56a
|
7
|
+
data.tar.gz: 193e68fcd1fe778e03e519b692ca9bb89d6b7193947a68f45be07a9a7278f68a6482416a6296f4a61e57df0c83f6bc54a2d275d763b3ef4d8a21cf9451b12477
|
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
Copyright (c) 2015 Youhei SASAKI <uwabami@gfd-dennou.org>
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a
|
6
|
+
copy of this software and associated documentation files (the "Software"),
|
7
|
+
to deal in the Software without restriction, including without limitation
|
8
|
+
the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
9
|
+
and/or sell copies of the Software, and to permit persons to whom the
|
10
|
+
Software is furnished to do so, subject to the following conditions:
|
11
|
+
.
|
12
|
+
The above copyright notice and this permission notice shall be included
|
13
|
+
in all copies or substantial portions of the Software.
|
14
|
+
.
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
16
|
+
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
17
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
18
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
19
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
20
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
21
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.org
ADDED
@@ -0,0 +1,58 @@
|
|
1
|
+
* TDiary::Style::Org
|
2
|
+
Org-mode style for tDiary format.
|
3
|
+
|
4
|
+
** Installation
|
5
|
+
Add this line to your application's Gemfile:
|
6
|
+
#+BEGIN_SRC ruby
|
7
|
+
gem 'tdiary-style-org'
|
8
|
+
#+END_SRC
|
9
|
+
|
10
|
+
And then execute:
|
11
|
+
#+BEGIN_EXAMPLE
|
12
|
+
% bundle
|
13
|
+
#+END_EXAMPLE
|
14
|
+
Or install it yourself as:
|
15
|
+
#+BEGIN_EXAMPLE
|
16
|
+
% gem install tdiary-style-org
|
17
|
+
#+END_EXAMPLE
|
18
|
+
|
19
|
+
** Usage
|
20
|
+
If you want to use this style, add @style into tdiary.conf below:
|
21
|
+
#+BEGIN_SRC ruby
|
22
|
+
@style = 'Org'
|
23
|
+
#+END_SRC
|
24
|
+
|
25
|
+
** Contributing
|
26
|
+
1. Fork it
|
27
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
28
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
29
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
30
|
+
5. Create new Pull Request
|
31
|
+
|
32
|
+
** TODO ToDo [/]
|
33
|
+
- [ ] can't handlinng "alt" in image link: due to org-ruby limitation.
|
34
|
+
|
35
|
+
** Copyright
|
36
|
+
#+BEGIN_EXAMPLE
|
37
|
+
Copyright (c) 2015 Youhei SASAKI <uwabami@gfd-dennou.org>
|
38
|
+
|
39
|
+
MIT License
|
40
|
+
|
41
|
+
Permission is hereby granted, free of charge, to any person obtaining a
|
42
|
+
copy of this software and associated documentation files (the "Software"),
|
43
|
+
to deal in the Software without restriction, including without limitation
|
44
|
+
the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
45
|
+
and/or sell copies of the Software, and to permit persons to whom the
|
46
|
+
Software is furnished to do so, subject to the following conditions:
|
47
|
+
.
|
48
|
+
The above copyright notice and this permission notice shall be included
|
49
|
+
in all copies or substantial portions of the Software.
|
50
|
+
.
|
51
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
52
|
+
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
53
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
54
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
55
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
56
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
57
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
58
|
+
#+END_EXAMPLE
|
data/Rakefile
ADDED
@@ -0,0 +1,142 @@
|
|
1
|
+
# -*- coding: utf-8; -*-
|
2
|
+
#
|
3
|
+
# org.rb: Org style class
|
4
|
+
#
|
5
|
+
# if you want to use this style, add @style into tdiary.conf below:
|
6
|
+
#
|
7
|
+
# @style = 'Org'
|
8
|
+
#
|
9
|
+
# Copyright (C) 2015 Youhei SASAKI <uwabami@gfd-dennou.org>
|
10
|
+
# You can redistribute it and/or modify it under MIT/X11
|
11
|
+
|
12
|
+
require 'org-ruby'
|
13
|
+
require 'pp'
|
14
|
+
|
15
|
+
module TDiary
|
16
|
+
module Style
|
17
|
+
class OrgSection
|
18
|
+
def initialize(fragment, author = nil)
|
19
|
+
@author = author
|
20
|
+
@subtitle, @body = fragment.split(/\n/, 2)
|
21
|
+
@body ||= ''
|
22
|
+
@categories = get_categories
|
23
|
+
@stripped_subtitle = strip_subtitle
|
24
|
+
@subtitle_to_html = @subtitle ? to_html(@subtitle).strip.gsub(/\A<h\d>|<\/h\d>\z/io, '') : nil
|
25
|
+
@stripped_subtitle_to_html = @stripped_subtitle ? to_html('* ' + @stripped_subtitle).strip.gsub(/\A<h\d>|<\/h\d>\z/io, '') : nil
|
26
|
+
@body_to_html = to_html(@body)
|
27
|
+
end
|
28
|
+
|
29
|
+
def subtitle=(subtitle)
|
30
|
+
@subtitle = (subtitle || '').sub(/^# /,"\##{categories_to_string} ")
|
31
|
+
@strip_subtitle = strip_subtitle
|
32
|
+
end
|
33
|
+
|
34
|
+
def categories=(categories)
|
35
|
+
@subtitle = "#{categories_to_string} " + (strip_subtitle || '')
|
36
|
+
@strip_subtitle = strip_subtitle
|
37
|
+
end
|
38
|
+
|
39
|
+
def to_src
|
40
|
+
r = ''
|
41
|
+
r << "#{@subtitle}\n" if @subtitle
|
42
|
+
r << @body.gsub(/\n\n\z/io,"\n")
|
43
|
+
end
|
44
|
+
|
45
|
+
def do_html4(date, idx, opt)
|
46
|
+
subtitle = to_html(@subtitle)
|
47
|
+
subtitle.sub!( %r!<h3>(.+?)</h3>!m ) do
|
48
|
+
"<h3><%= subtitle_proc( Time.at( #{date.to_i} ), #{$1.dump.gsub( /%/, '\\\\045' )} ) %></h3>"
|
49
|
+
end
|
50
|
+
if opt['multi_user'] and @author then
|
51
|
+
subtitle.sub!(/<\/h3>/,%Q|[#{@author}]</h3>|)
|
52
|
+
end
|
53
|
+
r = subtitle
|
54
|
+
r << @body_to_html
|
55
|
+
end
|
56
|
+
|
57
|
+
private
|
58
|
+
|
59
|
+
def to_html(string)
|
60
|
+
r = string.dup
|
61
|
+
renderer = Orgmode::Parser.new(string, {markup_file: File.dirname(__FILE__) + '/html_tags.yml'} )
|
62
|
+
r = renderer.to_html
|
63
|
+
r = r.gsub(/{{(.+?)}}/m,'<%=\1%>')
|
64
|
+
r = r.gsub('‘','\'').gsub('’','\'')
|
65
|
+
r = r.gsub('“','"').gsub('”','"')
|
66
|
+
end
|
67
|
+
|
68
|
+
def get_categories
|
69
|
+
return [] unless @subtitle
|
70
|
+
org = Orgmode::Parser.new(@subtitle, {markup_file: File.dirname(__FILE__) + 'html_tags.yml'} )
|
71
|
+
unless org.headlines[0] == nil
|
72
|
+
cat = org.headlines[0].tags
|
73
|
+
else
|
74
|
+
cat = []
|
75
|
+
end
|
76
|
+
return cat
|
77
|
+
end
|
78
|
+
|
79
|
+
def strip_subtitle
|
80
|
+
unless @subtitle
|
81
|
+
return nil
|
82
|
+
else
|
83
|
+
return '* ' + Orgmode::Parser.new(@subtitle, {markup_file: File.dirname(__FILE__) + 'html_tags.yml'} ).headlines[0].headline_text
|
84
|
+
end
|
85
|
+
end
|
86
|
+
|
87
|
+
end
|
88
|
+
|
89
|
+
class OrgDiary
|
90
|
+
def initialize(date, title, body, modified = Time.now)
|
91
|
+
init_diary
|
92
|
+
replace( date, title, body )
|
93
|
+
@last_modified = modified
|
94
|
+
end
|
95
|
+
|
96
|
+
def style
|
97
|
+
'Org'
|
98
|
+
end
|
99
|
+
|
100
|
+
def append(body, author = nil)
|
101
|
+
in_code_block = false
|
102
|
+
section = nil
|
103
|
+
body.each_line do |l|
|
104
|
+
case l
|
105
|
+
when /^\#[^\#]/
|
106
|
+
if in_code_block
|
107
|
+
section << l
|
108
|
+
else
|
109
|
+
@sections << OrgSection.new(section, author) if section
|
110
|
+
section = l
|
111
|
+
end
|
112
|
+
when /^```/
|
113
|
+
in_code_block = !in_code_block
|
114
|
+
section << l
|
115
|
+
else
|
116
|
+
section = '' unless section
|
117
|
+
section << l
|
118
|
+
end
|
119
|
+
end
|
120
|
+
if section
|
121
|
+
section << "\n" unless section =~ /\n\n\z/
|
122
|
+
@sections << OrgSection.new(section, author)
|
123
|
+
end
|
124
|
+
@last_modified = Time.now
|
125
|
+
self
|
126
|
+
end
|
127
|
+
|
128
|
+
def add_section(subtitle, body)
|
129
|
+
@sections = OrgSection.new("* #{subtitle}\n\n#{body}")
|
130
|
+
@sections.size
|
131
|
+
end
|
132
|
+
end
|
133
|
+
|
134
|
+
end
|
135
|
+
end
|
136
|
+
|
137
|
+
# Local Variables:
|
138
|
+
# mode: ruby
|
139
|
+
# indent-tabs-mode: t
|
140
|
+
# tab-width: 3
|
141
|
+
# ruby-indent-level: 3
|
142
|
+
# End:
|
@@ -0,0 +1 @@
|
|
1
|
+
require 'tdiary/style/org'
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'tdiary/style/org/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = 'tdiary-style-org'
|
8
|
+
spec.version = TDiary::Style::Org::VERSION
|
9
|
+
spec.authors = ['Youhei SASAKI']
|
10
|
+
spec.email = ['uwabami@gfd-dennou.org']
|
11
|
+
spec.description = %q{org-mode style for tDiary, using org-ruby}
|
12
|
+
spec.summary = %q{org-mode style for tDiary, using org-ruby}
|
13
|
+
spec.homepage = 'https://github.com/uwabami/tdiary-style-org'
|
14
|
+
spec.license = 'MIT'
|
15
|
+
|
16
|
+
spec.files = `git ls-files`.split($/)
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = ["lib"]
|
20
|
+
|
21
|
+
spec.add_dependency 'org-ruby'
|
22
|
+
|
23
|
+
spec.add_development_dependency "bundler", "~> 1.3"
|
24
|
+
spec.add_development_dependency "rake"
|
25
|
+
spec.add_development_dependency "test-unit"
|
26
|
+
end
|
@@ -0,0 +1,225 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
require 'test_helper'
|
3
|
+
|
4
|
+
class TestOrgDiary < Test::Unit::TestCase
|
5
|
+
def setup
|
6
|
+
@diary = TDiary::Style::OrgDiary.new(Time.at( 1041346800 ), "TITLE", "")
|
7
|
+
end
|
8
|
+
|
9
|
+
class Append < self
|
10
|
+
def setup
|
11
|
+
super
|
12
|
+
@source = <<-'EOF'
|
13
|
+
* Title :DEBIAN:COMP:
|
14
|
+
honbun
|
15
|
+
- list1
|
16
|
+
- nest list
|
17
|
+
- list2
|
18
|
+
|
19
|
+
1. enumlist1
|
20
|
+
2. enumlist2
|
21
|
+
- nest list1
|
22
|
+
- nest nest list
|
23
|
+
- nest list2
|
24
|
+
3. enumlist3
|
25
|
+
|
26
|
+
** subTitle
|
27
|
+
honbun
|
28
|
+
EOF
|
29
|
+
@diary.append(@source)
|
30
|
+
end
|
31
|
+
|
32
|
+
def test_html
|
33
|
+
@html = <<-'EOF'
|
34
|
+
<div class="section">
|
35
|
+
<%=section_enter_proc( Time.at( 1041346800 ) )%>
|
36
|
+
<h3><%= subtitle_proc( Time.at( 1041346800 ), "Title" ) %></h3>
|
37
|
+
<p>honbun</p>
|
38
|
+
<ul>
|
39
|
+
<li>list1
|
40
|
+
<ul>
|
41
|
+
<li>nest list</li>
|
42
|
+
</ul>
|
43
|
+
</li>
|
44
|
+
<li>list2</li>
|
45
|
+
</ul>
|
46
|
+
<ol>
|
47
|
+
<li>enumlist1</li>
|
48
|
+
<li>enumlist2
|
49
|
+
<ul>
|
50
|
+
<li>nest list1
|
51
|
+
<ul>
|
52
|
+
<li>nest nest list</li>
|
53
|
+
</ul>
|
54
|
+
</li>
|
55
|
+
<li>nest list2</li>
|
56
|
+
</ul>
|
57
|
+
</li>
|
58
|
+
<li>enumlist3</li>
|
59
|
+
</ol>
|
60
|
+
<h4>subTitle</h4>
|
61
|
+
<p>honbun</p>
|
62
|
+
<%=section_leave_proc( Time.at( 1041346800 ) )%>
|
63
|
+
</div>
|
64
|
+
EOF
|
65
|
+
assert_equal(@html, @diary.to_html)
|
66
|
+
end
|
67
|
+
|
68
|
+
def test_source
|
69
|
+
assert_equal(@source, @diary.to_src)
|
70
|
+
end
|
71
|
+
|
72
|
+
end # Append
|
73
|
+
|
74
|
+
class Replace < self
|
75
|
+
def setup
|
76
|
+
super
|
77
|
+
@source = <<-'EOF'
|
78
|
+
* Title :DEBIAN:COMP:
|
79
|
+
honbun
|
80
|
+
|
81
|
+
** subTitle
|
82
|
+
honbun
|
83
|
+
EOF
|
84
|
+
@diary.append(@source)
|
85
|
+
|
86
|
+
@replaced = <<-'EOF'
|
87
|
+
* replaceTitle :DEBIAN:COMP:
|
88
|
+
replace
|
89
|
+
|
90
|
+
** replacesubTitle
|
91
|
+
replacehonbun
|
92
|
+
EOF
|
93
|
+
end
|
94
|
+
|
95
|
+
def test_replace
|
96
|
+
@diary.replace(Time.at( 1041346800 ), "TITLE", @replaced)
|
97
|
+
@html = <<-'EOF'
|
98
|
+
<div class="section">
|
99
|
+
<%=section_enter_proc( Time.at( 1041346800 ) )%>
|
100
|
+
<h3><%= subtitle_proc( Time.at( 1041346800 ), "replaceTitle" ) %></h3>
|
101
|
+
<p>replace</p>
|
102
|
+
<h4>replacesubTitle</h4>
|
103
|
+
<p>replacehonbun</p>
|
104
|
+
<%=section_leave_proc( Time.at( 1041346800 ) )%>
|
105
|
+
</div>
|
106
|
+
EOF
|
107
|
+
assert_equal(@html, @diary.to_html)
|
108
|
+
end
|
109
|
+
|
110
|
+
end # Replace
|
111
|
+
|
112
|
+
def test_link
|
113
|
+
@source = <<-'EOF'
|
114
|
+
* subTitle
|
115
|
+
|
116
|
+
- [[https://www.google.com][google]]
|
117
|
+
EOF
|
118
|
+
@diary.append(@source)
|
119
|
+
@html = <<-EOF
|
120
|
+
<div class="section">
|
121
|
+
<%=section_enter_proc( Time.at( 1041346800 ) )%>
|
122
|
+
<h3><%= subtitle_proc( Time.at( 1041346800 ), "subTitle" ) %></h3>
|
123
|
+
<ul>
|
124
|
+
<li><a href="https://www.google.com">google</a></li>
|
125
|
+
</ul>
|
126
|
+
<%=section_leave_proc( Time.at( 1041346800 ) )%>
|
127
|
+
</div>
|
128
|
+
EOF
|
129
|
+
assert_equal(@html, @diary.to_html)
|
130
|
+
end # link
|
131
|
+
|
132
|
+
def test_image_link
|
133
|
+
@source = <<-EOF
|
134
|
+
* Title
|
135
|
+
|
136
|
+
- [[http://www.google.com/logo.jpg]]
|
137
|
+
EOF
|
138
|
+
@diary.append(@source)
|
139
|
+
@html = <<-EOF
|
140
|
+
<div class="section">
|
141
|
+
<%=section_enter_proc( Time.at( 1041346800 ) )%>
|
142
|
+
<h3><%= subtitle_proc( Time.at( 1041346800 ), "Title" ) %></h3>
|
143
|
+
<ul>
|
144
|
+
<li><img src="http://www.google.com/logo.jpg" alt="http://www.google.com/logo.jpg" /></li>
|
145
|
+
</ul>
|
146
|
+
<%=section_leave_proc( Time.at( 1041346800 ) )%>
|
147
|
+
</div>
|
148
|
+
EOF
|
149
|
+
assert_equal(@html, @diary.to_html)
|
150
|
+
end # image link
|
151
|
+
|
152
|
+
def test_plugin_syntax
|
153
|
+
@source = <<-'EOF'
|
154
|
+
* Title
|
155
|
+
{{plugin 'val'}}
|
156
|
+
|
157
|
+
{{plugin "val", 'val'}}
|
158
|
+
|
159
|
+
EOF
|
160
|
+
@diary.append(@source)
|
161
|
+
|
162
|
+
@html = <<-'EOF'
|
163
|
+
<div class="section">
|
164
|
+
<%=section_enter_proc( Time.at( 1041346800 ) )%>
|
165
|
+
<h3><%= subtitle_proc( Time.at( 1041346800 ), "Title" ) %></h3>
|
166
|
+
<p><%=plugin 'val'%></p>
|
167
|
+
<p><%=plugin "val", 'val'%></p>
|
168
|
+
<%=section_leave_proc( Time.at( 1041346800 ) )%>
|
169
|
+
</div>
|
170
|
+
EOF
|
171
|
+
assert_equal(@html, @diary.to_html)
|
172
|
+
end
|
173
|
+
|
174
|
+
def test_plugin_syntax_with_url
|
175
|
+
@source = <<-'EOF'
|
176
|
+
* Title
|
177
|
+
{{plugin 'http://www.example.com/foo.html', "https://www.example.com/bar.html"}}
|
178
|
+
|
179
|
+
EOF
|
180
|
+
@diary.append(@source)
|
181
|
+
|
182
|
+
@html = <<-'EOF'
|
183
|
+
<div class="section">
|
184
|
+
<%=section_enter_proc( Time.at( 1041346800 ) )%>
|
185
|
+
<h3><%= subtitle_proc( Time.at( 1041346800 ), "Title" ) %></h3>
|
186
|
+
<p><%=plugin 'http://www.example.com/foo.html', "https://www.example.com/bar.html"%></p>
|
187
|
+
<%=section_leave_proc( Time.at( 1041346800 ) )%>
|
188
|
+
</div>
|
189
|
+
EOF
|
190
|
+
assert_equal(@html, @diary.to_html)
|
191
|
+
end
|
192
|
+
|
193
|
+
def test_code_syntax_highlighting
|
194
|
+
@source = <<-'EOF'
|
195
|
+
* Title
|
196
|
+
#+BEGIN_SRC emacs-lisp
|
197
|
+
(require 'nil)
|
198
|
+
#+END_SRC
|
199
|
+
** SubTitle
|
200
|
+
#+BEGIN_SRC ruby
|
201
|
+
def test
|
202
|
+
return nil
|
203
|
+
end
|
204
|
+
#+END_SRC
|
205
|
+
EOF
|
206
|
+
@diary.append(@source)
|
207
|
+
|
208
|
+
@html = <<-'EOF'
|
209
|
+
<div class="section">
|
210
|
+
<%=section_enter_proc( Time.at( 1041346800 ) )%>
|
211
|
+
<h3><%= subtitle_proc( Time.at( 1041346800 ), "Title" ) %></h3>
|
212
|
+
<div class="highlight"><pre><span class="p">(</span><span class="nf">require</span> <span class="ss">'nil</span><span class="p">)</span>
|
213
|
+
</pre></div>
|
214
|
+
<h4>SubTitle</h4>
|
215
|
+
<div class="highlight"><pre><span class="k">def</span> <span class="nf">test</span>
|
216
|
+
<span class="k">return</span> <span class="kp">nil</span>
|
217
|
+
<span class="k">end</span>
|
218
|
+
</pre></div>
|
219
|
+
<%=section_leave_proc( Time.at( 1041346800 ) )%>
|
220
|
+
</div>
|
221
|
+
EOF
|
222
|
+
assert_equal(@html, @diary.to_html)
|
223
|
+
end
|
224
|
+
|
225
|
+
end
|
data/test/test_helper.rb
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
|
2
|
+
require 'test-unit'
|
3
|
+
require 'tdiary/core_ext'
|
4
|
+
require 'tdiary/comment_manager'
|
5
|
+
require 'tdiary/referer_manager'
|
6
|
+
require 'tdiary/style'
|
7
|
+
require 'tdiary/style/org'
|
8
|
+
|
9
|
+
TDiary::Style::OrgDiary.send(:include, TDiary::Style::BaseDiary)
|
10
|
+
TDiary::Style::OrgDiary.send(:include, TDiary::Style::CategorizableDiary)
|
11
|
+
TDiary::Style::OrgSection.send(:include, TDiary::Style::BaseSection)
|
metadata
ADDED
@@ -0,0 +1,115 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: tdiary-style-org
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Youhei SASAKI
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-01-03 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: org-ruby
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: bundler
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.3'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.3'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rake
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: test-unit
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
description: org-mode style for tDiary, using org-ruby
|
70
|
+
email:
|
71
|
+
- uwabami@gfd-dennou.org
|
72
|
+
executables: []
|
73
|
+
extensions: []
|
74
|
+
extra_rdoc_files: []
|
75
|
+
files:
|
76
|
+
- ".travis.yml"
|
77
|
+
- Gemfile
|
78
|
+
- LICENSE
|
79
|
+
- README.org
|
80
|
+
- Rakefile
|
81
|
+
- lib/tdiary-style-org.rb
|
82
|
+
- lib/tdiary/style/html_tags.yml
|
83
|
+
- lib/tdiary/style/org.rb
|
84
|
+
- lib/tdiary/style/org/version.rb
|
85
|
+
- tdiary-style-org.gemspec
|
86
|
+
- test/tdiary/style/org-test.rb
|
87
|
+
- test/test_helper.rb
|
88
|
+
homepage: https://github.com/uwabami/tdiary-style-org
|
89
|
+
licenses:
|
90
|
+
- MIT
|
91
|
+
metadata: {}
|
92
|
+
post_install_message:
|
93
|
+
rdoc_options: []
|
94
|
+
require_paths:
|
95
|
+
- lib
|
96
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
97
|
+
requirements:
|
98
|
+
- - ">="
|
99
|
+
- !ruby/object:Gem::Version
|
100
|
+
version: '0'
|
101
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
102
|
+
requirements:
|
103
|
+
- - ">="
|
104
|
+
- !ruby/object:Gem::Version
|
105
|
+
version: '0'
|
106
|
+
requirements: []
|
107
|
+
rubyforge_project:
|
108
|
+
rubygems_version: 2.4.5.1
|
109
|
+
signing_key:
|
110
|
+
specification_version: 4
|
111
|
+
summary: org-mode style for tDiary, using org-ruby
|
112
|
+
test_files:
|
113
|
+
- test/tdiary/style/org-test.rb
|
114
|
+
- test/test_helper.rb
|
115
|
+
has_rdoc:
|