haml-hikidoc-filter 1.0.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.
- data/.document +5 -0
- data/.gitignore +21 -0
- data/LICENSE +20 -0
- data/README.rdoc +18 -0
- data/Rakefile +47 -0
- data/VERSION +1 -0
- data/lib/haml-hikidoc-filter.rb +13 -0
- data/spec/haml-hikidoc-filter_spec.rb +66 -0
- data/spec/spec.opts +1 -0
- data/spec/spec_helper.rb +9 -0
- metadata +95 -0
data/.document
ADDED
data/.gitignore
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2009 Keita Urashima
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.rdoc
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
= haml-hikidoc-filter
|
2
|
+
|
3
|
+
Haml filter that converts the HikiDoc syntax.
|
4
|
+
|
5
|
+
== Note on Patches/Pull Requests
|
6
|
+
|
7
|
+
* Fork the project.
|
8
|
+
* Make your feature addition or bug fix.
|
9
|
+
* Add tests for it. This is important so I don't break it in a
|
10
|
+
future version unintentionally.
|
11
|
+
* Commit, do not mess with rakefile, version, or history.
|
12
|
+
(if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
|
13
|
+
* Send me a pull request. Bonus points for topic branches.
|
14
|
+
|
15
|
+
== Copyright
|
16
|
+
|
17
|
+
Copyright (c) 2010 Keita Urashima. See LICENSE for details.
|
18
|
+
haml-hikidoc-filter's development has been supported by Eiwa System Management, Inc.
|
data/Rakefile
ADDED
@@ -0,0 +1,47 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'rake'
|
3
|
+
|
4
|
+
begin
|
5
|
+
require 'jeweler'
|
6
|
+
Jeweler::Tasks.new do |gem|
|
7
|
+
gem.name = "haml-hikidoc-filter"
|
8
|
+
gem.summary = %Q{Haml filter that converts the HikiDoc syntax.}
|
9
|
+
gem.description = %Q{Haml filter that converts the HikiDoc syntax.}
|
10
|
+
gem.email = "ursm@ursm.jp"
|
11
|
+
gem.homepage = "http://github.com/esminc/haml-hikidoc-filter"
|
12
|
+
gem.authors = ["Keita Urashima"]
|
13
|
+
gem.add_development_dependency "rspec", ">= 1.2.9"
|
14
|
+
gem.add_dependency "haml"
|
15
|
+
gem.add_dependency "hikidoc"
|
16
|
+
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
|
17
|
+
end
|
18
|
+
Jeweler::GemcutterTasks.new
|
19
|
+
rescue LoadError
|
20
|
+
puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
|
21
|
+
end
|
22
|
+
|
23
|
+
require 'spec/rake/spectask'
|
24
|
+
Spec::Rake::SpecTask.new(:spec) do |spec|
|
25
|
+
spec.libs << 'lib' << 'spec'
|
26
|
+
spec.spec_files = FileList['spec/**/*_spec.rb']
|
27
|
+
end
|
28
|
+
|
29
|
+
Spec::Rake::SpecTask.new(:rcov) do |spec|
|
30
|
+
spec.libs << 'lib' << 'spec'
|
31
|
+
spec.pattern = 'spec/**/*_spec.rb'
|
32
|
+
spec.rcov = true
|
33
|
+
end
|
34
|
+
|
35
|
+
task :spec => :check_dependencies
|
36
|
+
|
37
|
+
task :default => :spec
|
38
|
+
|
39
|
+
require 'rake/rdoctask'
|
40
|
+
Rake::RDocTask.new do |rdoc|
|
41
|
+
version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
42
|
+
|
43
|
+
rdoc.rdoc_dir = 'rdoc'
|
44
|
+
rdoc.title = "haml-hikidoc-filter #{version}"
|
45
|
+
rdoc.rdoc_files.include('README*')
|
46
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
47
|
+
end
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
1.0.0
|
@@ -0,0 +1,13 @@
|
|
1
|
+
require 'haml'
|
2
|
+
|
3
|
+
module Haml::Filters
|
4
|
+
module HikiDoc
|
5
|
+
include Base
|
6
|
+
lazy_require 'hikidoc'
|
7
|
+
|
8
|
+
def render_with_options(text, options)
|
9
|
+
method = [:html4, :html5].include?(options[:format]) ? :to_html : :to_xhtml
|
10
|
+
::HikiDoc.send(method, text, options[:hikidoc] || {})
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,66 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
|
2
|
+
|
3
|
+
describe Haml::Filters::HikiDoc do
|
4
|
+
def haml(src, options = {})
|
5
|
+
Haml::Engine.new(src, options).render
|
6
|
+
end
|
7
|
+
|
8
|
+
describe 'paragraph' do
|
9
|
+
subject do
|
10
|
+
haml <<-HAML
|
11
|
+
:hikidoc
|
12
|
+
例えば、
|
13
|
+
こういう風に記述すると、これらの行は
|
14
|
+
一つのパラグラフとして整形されます。
|
15
|
+
HAML
|
16
|
+
end
|
17
|
+
|
18
|
+
it { should == "<p>例えば、\nこういう風に記述すると、これらの行は\n一つのパラグラフとして整形されます。</p>\n" }
|
19
|
+
end
|
20
|
+
|
21
|
+
describe 'pre' do
|
22
|
+
subject do
|
23
|
+
haml <<-HAML
|
24
|
+
:hikidoc
|
25
|
+
foo
|
26
|
+
bar
|
27
|
+
HAML
|
28
|
+
end
|
29
|
+
|
30
|
+
it { should == "<p>foo</p>\n<pre>bar</pre>\n" }
|
31
|
+
end
|
32
|
+
|
33
|
+
describe 'link to image' do
|
34
|
+
before do
|
35
|
+
@src = <<-HAML
|
36
|
+
:hikidoc
|
37
|
+
http://example.com/image.png
|
38
|
+
HAML
|
39
|
+
end
|
40
|
+
|
41
|
+
subject { haml @src }
|
42
|
+
it { should == %(<p><img src="http://example.com/image.png" alt="image.png" /></p>\n) }
|
43
|
+
|
44
|
+
context 'HTML' do
|
45
|
+
subject { haml @src, :format => :html5 }
|
46
|
+
it { should == %(<p><img src="http://example.com/image.png" alt="image.png"></p>\n) }
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
describe 'WikiName' do
|
51
|
+
before do
|
52
|
+
@src = <<-HAML
|
53
|
+
:hikidoc
|
54
|
+
WikiName
|
55
|
+
HAML
|
56
|
+
end
|
57
|
+
|
58
|
+
subject { haml @src }
|
59
|
+
it { should == %(<p><a href="WikiName">WikiName</a></p>\n) }
|
60
|
+
|
61
|
+
context 'disabled by option' do
|
62
|
+
subject { haml @src, :hikidoc => {:use_wiki_name => false} }
|
63
|
+
it { should == %(<p>WikiName</p>\n) }
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
data/spec/spec.opts
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--color
|
data/spec/spec_helper.rb
ADDED
metadata
ADDED
@@ -0,0 +1,95 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: haml-hikidoc-filter
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Keita Urashima
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
|
12
|
+
date: 2010-01-27 00:00:00 +09:00
|
13
|
+
default_executable:
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: rspec
|
17
|
+
type: :development
|
18
|
+
version_requirement:
|
19
|
+
version_requirements: !ruby/object:Gem::Requirement
|
20
|
+
requirements:
|
21
|
+
- - ">="
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: 1.2.9
|
24
|
+
version:
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: haml
|
27
|
+
type: :runtime
|
28
|
+
version_requirement:
|
29
|
+
version_requirements: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: "0"
|
34
|
+
version:
|
35
|
+
- !ruby/object:Gem::Dependency
|
36
|
+
name: hikidoc
|
37
|
+
type: :runtime
|
38
|
+
version_requirement:
|
39
|
+
version_requirements: !ruby/object:Gem::Requirement
|
40
|
+
requirements:
|
41
|
+
- - ">="
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: "0"
|
44
|
+
version:
|
45
|
+
description: Haml filter that converts the HikiDoc syntax.
|
46
|
+
email: ursm@ursm.jp
|
47
|
+
executables: []
|
48
|
+
|
49
|
+
extensions: []
|
50
|
+
|
51
|
+
extra_rdoc_files:
|
52
|
+
- LICENSE
|
53
|
+
- README.rdoc
|
54
|
+
files:
|
55
|
+
- .document
|
56
|
+
- .gitignore
|
57
|
+
- LICENSE
|
58
|
+
- README.rdoc
|
59
|
+
- Rakefile
|
60
|
+
- VERSION
|
61
|
+
- lib/haml-hikidoc-filter.rb
|
62
|
+
- spec/haml-hikidoc-filter_spec.rb
|
63
|
+
- spec/spec.opts
|
64
|
+
- spec/spec_helper.rb
|
65
|
+
has_rdoc: true
|
66
|
+
homepage: http://github.com/esminc/haml-hikidoc-filter
|
67
|
+
licenses: []
|
68
|
+
|
69
|
+
post_install_message:
|
70
|
+
rdoc_options:
|
71
|
+
- --charset=UTF-8
|
72
|
+
require_paths:
|
73
|
+
- lib
|
74
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
75
|
+
requirements:
|
76
|
+
- - ">="
|
77
|
+
- !ruby/object:Gem::Version
|
78
|
+
version: "0"
|
79
|
+
version:
|
80
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
81
|
+
requirements:
|
82
|
+
- - ">="
|
83
|
+
- !ruby/object:Gem::Version
|
84
|
+
version: "0"
|
85
|
+
version:
|
86
|
+
requirements: []
|
87
|
+
|
88
|
+
rubyforge_project:
|
89
|
+
rubygems_version: 1.3.5
|
90
|
+
signing_key:
|
91
|
+
specification_version: 3
|
92
|
+
summary: Haml filter that converts the HikiDoc syntax.
|
93
|
+
test_files:
|
94
|
+
- spec/spec_helper.rb
|
95
|
+
- spec/haml-hikidoc-filter_spec.rb
|