tdiary-style-org 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 712002e7d2b01589e3316a3b18430056a45e16fd
4
- data.tar.gz: 73c33b65eadbd31184d0f75aa1448b0951f8f712
3
+ metadata.gz: a961f0bd21f0ee116a4b6c99b45bac05c1c25e3e
4
+ data.tar.gz: fffb5dcef1272fe53d6d648912697a2d5671d21c
5
5
  SHA512:
6
- metadata.gz: 17dc82f980faec9afd5871597787631499aee31b1787af46bd1b59026080a1e8725dc570229441e9f0c291faf7f2beb9231e99e31ea455e471e8c0d545a8c56a
7
- data.tar.gz: 193e68fcd1fe778e03e519b692ca9bb89d6b7193947a68f45be07a9a7278f68a6482416a6296f4a61e57df0c83f6bc54a2d275d763b3ef4d8a21cf9451b12477
6
+ metadata.gz: 64c0f24decf4693f0c64357e30169331287f1f2417145ab3d3db7d7feccd9414f11152b22468ebd003bcaafae737ce03dab8bf1f37cf1f0eab06025a8229051b
7
+ data.tar.gz: 754458236a5a0b47703aedf05d55442ecd2e0c1d010b7c45f1411135a8a90b9e9360c42e77e65ede34bdbad03ecea109c25cb308c08ecbddf626c928dd68e576
data/.gitignore ADDED
@@ -0,0 +1,14 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ test/tmp
data/.travis.yml CHANGED
@@ -1,6 +1,15 @@
1
1
  language: ruby
2
+ sudo: false
3
+ cache:
4
+ bundler: true
2
5
  rvm:
3
6
  - 2.1
4
7
  - 2.2
5
- - 2.3
8
+ - 2.3.0
9
+ - ruby-head
10
+ matrix:
11
+ allow_failures:
12
+ - rvm: ruby-head
13
+ before_install:
14
+ - gem update bundler
6
15
  script: bundle exec rake test
data/Gemfile CHANGED
@@ -2,3 +2,4 @@ source 'https://rubygems.org'
2
2
  gemspec
3
3
 
4
4
  gem 'tdiary', github: 'tdiary/tdiary-core'
5
+ gem 'emot'
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2015 Youhei SASAKI <uwabami@gfd-dennou.org>
1
+ Copyright (c) 2015-2016 Youhei SASAKI <uwabami@gfd-dennou.org>
2
2
 
3
3
  MIT License
4
4
 
data/README.org CHANGED
@@ -1,58 +1,56 @@
1
- * TDiary::Style::Org
1
+ #+TITLE: TDiary::Style::Org
2
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
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
- 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.
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
@@ -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 'pp'
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('* ' + @stripped_subtitle).strip.gsub(/\A<h\d>|<\/h\d>\z/io, '') : nil
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
- r = r.gsub(/{{(.+?)}}/m,'<%=\1%>')
63
+ # for tDiary plugin
64
+ r = r.gsub(/\(\(%(.+?)%\)\)/m,'<%=\1%>')
64
65
  r = r.gsub('&#8216;','\'').gsub('&#8217;','\'')
65
66
  r = r.gsub('&#8220;','"').gsub('&#8221;','"')
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
 
@@ -1,7 +1,7 @@
1
1
  module TDiary
2
2
  module Style
3
3
  module Org
4
- VERSION = '0.0.1'
4
+ VERSION = '0.0.2'
5
5
  end
6
6
  end
7
7
  end
@@ -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 = `git ls-files`.split($/)
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
- {{plugin 'val'}}
155
+ ((%plugin 'val'%))
156
156
 
157
- {{plugin "val", 'val'}}
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
- {{plugin 'http://www.example.com/foo.html', "https://www.example.com/bar.html"}}
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.1
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-01-03 00:00:00.000000000 Z
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.4.5.1
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: