tdiary-style-org 0.0.1 → 0.0.2
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
- data/.gitignore +14 -0
- data/.travis.yml +10 -1
- data/Gemfile +1 -0
- data/LICENSE +1 -1
- data/README.org +53 -55
- data/lib/tdiary/style/org.rb +9 -8
- data/lib/tdiary/style/{html_tags.yml → org/html_tags.yml} +0 -0
- data/lib/tdiary/style/org/version.rb +1 -1
- data/tdiary-style-org.gemspec +2 -1
- data/test/tdiary/style/org-test.rb +3 -3
- metadata +19 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a961f0bd21f0ee116a4b6c99b45bac05c1c25e3e
|
4
|
+
data.tar.gz: fffb5dcef1272fe53d6d648912697a2d5671d21c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 64c0f24decf4693f0c64357e30169331287f1f2417145ab3d3db7d7feccd9414f11152b22468ebd003bcaafae737ce03dab8bf1f37cf1f0eab06025a8229051b
|
7
|
+
data.tar.gz: 754458236a5a0b47703aedf05d55442ecd2e0c1d010b7c45f1411135a8a90b9e9360c42e77e65ede34bdbad03ecea109c25cb308c08ecbddf626c928dd68e576
|
data/.gitignore
ADDED
data/.travis.yml
CHANGED
data/Gemfile
CHANGED
data/LICENSE
CHANGED
data/README.org
CHANGED
@@ -1,58 +1,56 @@
|
|
1
|
-
|
1
|
+
#+TITLE: TDiary::Style::Org
|
2
2
|
Org-mode style for tDiary format.
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
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
|
3
|
+
* Installation
|
4
|
+
Add this line to your application's Gemfile.local:
|
5
|
+
#+BEGIN_SRC ruby
|
6
|
+
gem 'tdiary-style-org'
|
7
|
+
#+END_SRC
|
8
|
+
And then execute:
|
36
9
|
#+BEGIN_EXAMPLE
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
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.
|
10
|
+
% bundle install
|
11
|
+
#+END_EXAMPLE
|
12
|
+
Or install it yourself as:
|
13
|
+
#+BEGIN_EXAMPLE
|
14
|
+
% gem install tdiary-style-org
|
58
15
|
#+END_EXAMPLE
|
16
|
+
* Usage
|
17
|
+
If you want to use this style, add @style into tdiary.conf below:
|
18
|
+
#+BEGIN_SRC ruby
|
19
|
+
@style = 'Org'
|
20
|
+
#+END_SRC
|
21
|
+
* Contributing
|
22
|
+
1. Fork it
|
23
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
24
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
25
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
26
|
+
5. Create new Pull Request
|
27
|
+
* TODO
|
28
|
+
- on going... [2/3]
|
29
|
+
- [X] can't convert TAG to CATEGORY of tDiary
|
30
|
+
- [X] How to use plugin? -> RD style like: =((%plugin, 'val'%))=
|
31
|
+
- Is this syntax best?
|
32
|
+
- [ ] can't handlinng "alt" in image link: due to org-ruby limitation.
|
33
|
+
* Copyright
|
34
|
+
#+BEGIN_EXAMPLE
|
35
|
+
Copyright (c) 2015-2016 Youhei SASAKI <uwabami@gfd-dennou.org>
|
36
|
+
|
37
|
+
MIT License
|
38
|
+
|
39
|
+
Permission is hereby granted, free of charge, to any person obtaining a
|
40
|
+
copy of this software and associated documentation files (the "Software"),
|
41
|
+
to deal in the Software without restriction, including without limitation
|
42
|
+
the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
43
|
+
and/or sell copies of the Software, and to permit persons to whom the
|
44
|
+
Software is furnished to do so, subject to the following conditions:
|
45
|
+
.
|
46
|
+
The above copyright notice and this permission notice shall be included
|
47
|
+
in all copies or substantial portions of the Software.
|
48
|
+
.
|
49
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
50
|
+
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
51
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
52
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
53
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
54
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
55
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
56
|
+
#+END_EXAMPLE
|
data/lib/tdiary/style/org.rb
CHANGED
@@ -10,7 +10,7 @@
|
|
10
10
|
# You can redistribute it and/or modify it under MIT/X11
|
11
11
|
|
12
12
|
require 'org-ruby'
|
13
|
-
require '
|
13
|
+
require 'pygments'
|
14
14
|
|
15
15
|
module TDiary
|
16
16
|
module Style
|
@@ -21,8 +21,8 @@ module TDiary
|
|
21
21
|
@body ||= ''
|
22
22
|
@categories = get_categories
|
23
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(
|
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
26
|
@body_to_html = to_html(@body)
|
27
27
|
end
|
28
28
|
|
@@ -58,18 +58,19 @@ module TDiary
|
|
58
58
|
|
59
59
|
def to_html(string)
|
60
60
|
r = string.dup
|
61
|
-
renderer = Orgmode::Parser.new(string, {markup_file: File.dirname(__FILE__) + '/html_tags.yml'} )
|
61
|
+
renderer = Orgmode::Parser.new(string, {markup_file: File.dirname(__FILE__) + '/org/html_tags.yml', skip_syntax_highlight: false } )
|
62
62
|
r = renderer.to_html
|
63
|
-
|
63
|
+
# for tDiary plugin
|
64
|
+
r = r.gsub(/\(\(%(.+?)%\)\)/m,'<%=\1%>')
|
64
65
|
r = r.gsub('‘','\'').gsub('’','\'')
|
65
66
|
r = r.gsub('“','"').gsub('”','"')
|
66
67
|
end
|
67
68
|
|
68
69
|
def get_categories
|
69
70
|
return [] unless @subtitle
|
70
|
-
org = Orgmode::Parser.new(@subtitle, {markup_file: File.dirname(__FILE__) + 'html_tags.yml'} )
|
71
|
+
org = Orgmode::Parser.new(@subtitle, {markup_file: File.dirname(__FILE__) + '/org/html_tags.yml', skip_syntax_highlight: false} )
|
71
72
|
unless org.headlines[0] == nil
|
72
|
-
cat = org.headlines[0].tags
|
73
|
+
cat = org.headlines[0].tags.flatten
|
73
74
|
else
|
74
75
|
cat = []
|
75
76
|
end
|
@@ -80,7 +81,7 @@ module TDiary
|
|
80
81
|
unless @subtitle
|
81
82
|
return nil
|
82
83
|
else
|
83
|
-
return '* ' + Orgmode::Parser.new(@subtitle, {markup_file: File.dirname(__FILE__) + 'html_tags.yml'} ).headlines[0].headline_text
|
84
|
+
return '* ' + Orgmode::Parser.new(@subtitle, {markup_file: File.dirname(__FILE__) + '/org/html_tags.yml'} ).headlines[0].headline_text
|
84
85
|
end
|
85
86
|
end
|
86
87
|
|
File without changes
|
data/tdiary-style-org.gemspec
CHANGED
@@ -13,12 +13,13 @@ Gem::Specification.new do |spec|
|
|
13
13
|
spec.homepage = 'https://github.com/uwabami/tdiary-style-org'
|
14
14
|
spec.license = 'MIT'
|
15
15
|
|
16
|
-
spec.files =
|
16
|
+
spec.files = [".gitignore",".travis.yml","Gemfile","LICENSE","README.org","Rakefile","lib/tdiary-style-org.rb","lib/tdiary/style/org.rb","lib/tdiary/style/org/html_tags.yml","lib/tdiary/style/org/version.rb","tdiary-style-org.gemspec","test/tdiary/style/org-test.rb","test/test_helper.rb"]
|
17
17
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
21
|
spec.add_dependency 'org-ruby'
|
22
|
+
spec.add_dependency 'pygments.rb'
|
22
23
|
|
23
24
|
spec.add_development_dependency "bundler", "~> 1.3"
|
24
25
|
spec.add_development_dependency "rake"
|
@@ -152,9 +152,9 @@ EOF
|
|
152
152
|
def test_plugin_syntax
|
153
153
|
@source = <<-'EOF'
|
154
154
|
* Title
|
155
|
-
|
155
|
+
((%plugin 'val'%))
|
156
156
|
|
157
|
-
|
157
|
+
((%plugin "val", 'val'%))
|
158
158
|
|
159
159
|
EOF
|
160
160
|
@diary.append(@source)
|
@@ -174,7 +174,7 @@ EOF
|
|
174
174
|
def test_plugin_syntax_with_url
|
175
175
|
@source = <<-'EOF'
|
176
176
|
* Title
|
177
|
-
|
177
|
+
((%plugin 'http://www.example.com/foo.html', "https://www.example.com/bar.html"%))
|
178
178
|
|
179
179
|
EOF
|
180
180
|
@diary.append(@source)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tdiary-style-org
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Youhei SASAKI
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-04-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: org-ruby
|
@@ -24,6 +24,20 @@ dependencies:
|
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: pygments.rb
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: bundler
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -73,14 +87,15 @@ executables: []
|
|
73
87
|
extensions: []
|
74
88
|
extra_rdoc_files: []
|
75
89
|
files:
|
90
|
+
- ".gitignore"
|
76
91
|
- ".travis.yml"
|
77
92
|
- Gemfile
|
78
93
|
- LICENSE
|
79
94
|
- README.org
|
80
95
|
- Rakefile
|
81
96
|
- lib/tdiary-style-org.rb
|
82
|
-
- lib/tdiary/style/html_tags.yml
|
83
97
|
- lib/tdiary/style/org.rb
|
98
|
+
- lib/tdiary/style/org/html_tags.yml
|
84
99
|
- lib/tdiary/style/org/version.rb
|
85
100
|
- tdiary-style-org.gemspec
|
86
101
|
- test/tdiary/style/org-test.rb
|
@@ -105,11 +120,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
105
120
|
version: '0'
|
106
121
|
requirements: []
|
107
122
|
rubyforge_project:
|
108
|
-
rubygems_version: 2.
|
123
|
+
rubygems_version: 2.5.1
|
109
124
|
signing_key:
|
110
125
|
specification_version: 4
|
111
126
|
summary: org-mode style for tDiary, using org-ruby
|
112
127
|
test_files:
|
113
128
|
- test/tdiary/style/org-test.rb
|
114
129
|
- test/test_helper.rb
|
115
|
-
has_rdoc:
|