markdownizer 0.3.6 → 0.3.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +1 -0
- data/Gemfile +1 -0
- data/Gemfile.lock +39 -37
- data/LICENSE +9 -0
- data/Rakefile +1 -55
- data/Readme.md +1 -1
- data/lib/generators/markdownizer/install_generator.rb +1 -1
- data/lib/markdownizer.rb +6 -6
- data/lib/markdownizer/version.rb +1 -1
- data/markdownizer.gemspec +1 -3
- data/spec/markdownizer_spec.rb +0 -9
- metadata +81 -123
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 023252ad00135fbc38a9c3bf95dab129987c17db
|
4
|
+
data.tar.gz: 568346d6531bb9d33101d85ad081d29d38a5766b
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 376f88436432f426e2f3255af085ec699eda5abc0f134de726458af3e338bb87c42e453abf66b6c2e5ad5787cef840f6c669554af97086465a897a182a519a8b
|
7
|
+
data.tar.gz: 5e972128ce8c28a923241d2d4c336455890d80f023ca9daedfa8e4c98d80d1914154df34776f09aaa5e541fde64e89a03d530c06c11df7cdf3fb57423a2c7199
|
data/.gitignore
CHANGED
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
markdownizer (0.3.
|
4
|
+
markdownizer (0.3.7)
|
5
5
|
activerecord (>= 3.0.3)
|
6
6
|
coderay
|
7
7
|
rdiscount
|
@@ -9,47 +9,49 @@ PATH
|
|
9
9
|
GEM
|
10
10
|
remote: http://rubygems.org/
|
11
11
|
specs:
|
12
|
-
activemodel (
|
13
|
-
activesupport (=
|
14
|
-
builder (~>
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
activesupport (=
|
19
|
-
arel (~>
|
20
|
-
|
21
|
-
activesupport (
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
12
|
+
activemodel (4.0.0)
|
13
|
+
activesupport (= 4.0.0)
|
14
|
+
builder (~> 3.1.0)
|
15
|
+
activerecord (4.0.0)
|
16
|
+
activemodel (= 4.0.0)
|
17
|
+
activerecord-deprecated_finders (~> 1.0.2)
|
18
|
+
activesupport (= 4.0.0)
|
19
|
+
arel (~> 4.0.0)
|
20
|
+
activerecord-deprecated_finders (1.0.3)
|
21
|
+
activesupport (4.0.0)
|
22
|
+
i18n (~> 0.6, >= 0.6.4)
|
23
|
+
minitest (~> 4.2)
|
24
|
+
multi_json (~> 1.3)
|
25
|
+
thread_safe (~> 0.1)
|
26
|
+
tzinfo (~> 0.3.37)
|
27
|
+
arel (4.0.0)
|
28
|
+
atomic (1.1.14)
|
29
|
+
builder (3.1.4)
|
30
|
+
coderay (1.1.0)
|
31
|
+
diff-lcs (1.2.4)
|
26
32
|
git (1.2.5)
|
27
|
-
i18n (0.5
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
rspec-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
rspec-
|
40
|
-
|
41
|
-
|
42
|
-
tzinfo (0.3.
|
33
|
+
i18n (0.6.5)
|
34
|
+
minitest (4.7.5)
|
35
|
+
multi_json (1.8.0)
|
36
|
+
rake (10.1.0)
|
37
|
+
rdiscount (2.0.7.1)
|
38
|
+
rspec (2.14.1)
|
39
|
+
rspec-core (~> 2.14.0)
|
40
|
+
rspec-expectations (~> 2.14.0)
|
41
|
+
rspec-mocks (~> 2.14.0)
|
42
|
+
rspec-core (2.14.5)
|
43
|
+
rspec-expectations (2.14.2)
|
44
|
+
diff-lcs (>= 1.1.3, < 2.0)
|
45
|
+
rspec-mocks (2.14.3)
|
46
|
+
thread_safe (0.1.3)
|
47
|
+
atomic
|
48
|
+
tzinfo (0.3.37)
|
43
49
|
|
44
50
|
PLATFORMS
|
45
51
|
ruby
|
46
52
|
|
47
53
|
DEPENDENCIES
|
48
|
-
activerecord (>= 3.0.3)
|
49
|
-
coderay
|
50
54
|
git
|
51
55
|
markdownizer!
|
52
|
-
|
53
|
-
|
54
|
-
rocco
|
55
|
-
rspec (~> 2.5.0)
|
56
|
+
rake
|
57
|
+
rspec (~> 2.0)
|
data/LICENSE
ADDED
@@ -0,0 +1,9 @@
|
|
1
|
+
Copyright (C) <2011-2013> <Codegram Technologies>
|
2
|
+
|
3
|
+
MIT License (Expat)
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
6
|
+
|
7
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
8
|
+
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/Rakefile
CHANGED
@@ -1,60 +1,6 @@
|
|
1
1
|
require 'bundler'
|
2
2
|
Bundler::GemHelper.install_tasks
|
3
3
|
|
4
|
-
# Bring in Rocco tasks
|
5
|
-
require 'rocco/tasks'
|
6
|
-
require 'rake/clean'
|
7
|
-
Rocco::make 'docs/', 'lib/markdownizer.rb'
|
8
|
-
|
9
|
-
desc 'Build markdownizer docs'
|
10
|
-
task :docs => :rocco
|
11
|
-
directory 'docs/'
|
12
|
-
|
13
|
-
desc 'Build docs and open in browser for the reading'
|
14
|
-
task :read => :docs do
|
15
|
-
sh 'open docs/lib/rocco.html'
|
16
|
-
end
|
17
|
-
|
18
|
-
# Make index.html a copy of markdownizer.html
|
19
|
-
file 'docs/index.html' => 'docs/lib/markdownizer.html' do |f|
|
20
|
-
cp 'docs/lib/markdownizer.html', 'docs/index.html', :preserve => true
|
21
|
-
end
|
22
|
-
task :docs => 'docs/index.html'
|
23
|
-
CLEAN.include 'docs/index.html'
|
24
|
-
|
25
|
-
# Alias for docs task
|
26
|
-
task :doc => :docs
|
27
|
-
|
28
|
-
# GITHUB PAGES ===============================================================
|
29
|
-
|
30
|
-
site = 'docs'
|
31
|
-
source_branch = 'master'
|
32
|
-
deploy_branch = 'gh-pages'
|
33
|
-
|
34
|
-
desc "generate and deploy website to github user pages"
|
35
|
-
multitask :pages do
|
36
|
-
puts ">>> Deploying #{deploy_branch} branch to Github Pages <<<"
|
37
|
-
require 'git'
|
38
|
-
repo = Git.open('.')
|
39
|
-
puts "\n>>> Checking out #{deploy_branch} branch <<<\n"
|
40
|
-
repo.branch("#{deploy_branch}").checkout
|
41
|
-
(Dir["*"] - [site]).each { |f| rm_rf(f) }
|
42
|
-
Dir["#{site}/*"].each {|f| mv(f, "index.html")}
|
43
|
-
rm_rf(site)
|
44
|
-
puts "\n>>> Moving generated site files <<<\n"
|
45
|
-
Dir["**/*"].each {|f| repo.add(f) }
|
46
|
-
repo.status.deleted.each {|f, s| repo.remove(f)}
|
47
|
-
puts "\n>>> Commiting: Site updated at #{Time.now.utc} <<<\n"
|
48
|
-
message = ENV["MESSAGE"] || "Site updated at #{Time.now.utc}"
|
49
|
-
repo.commit(message)
|
50
|
-
puts "\n>>> Pushing generated site to #{deploy_branch} branch <<<\n"
|
51
|
-
repo.push
|
52
|
-
puts "\n>>> Github Pages deploy complete <<<\n"
|
53
|
-
repo.branch("#{source_branch}").checkout
|
54
|
-
end
|
55
|
-
|
56
|
-
# TESTS =====================================================================
|
57
|
-
|
58
4
|
require 'rspec/core'
|
59
5
|
require 'rspec/core/rake_task'
|
60
6
|
RSpec::Core::RakeTask.new(:spec) do |spec|
|
@@ -62,4 +8,4 @@ RSpec::Core::RakeTask.new(:spec) do |spec|
|
|
62
8
|
end
|
63
9
|
|
64
10
|
task :default => :spec
|
65
|
-
task :test =>
|
11
|
+
task :test => :spec
|
data/Readme.md
CHANGED
@@ -8,7 +8,7 @@ module Markdownizer
|
|
8
8
|
source_root File.expand_path(File.join(File.dirname(__FILE__), 'templates'))
|
9
9
|
|
10
10
|
def copy_stylesheet_file
|
11
|
-
copy_file 'coderay.css', '
|
11
|
+
copy_file 'coderay.css', 'app/assets/stylesheets/markdownizer.css'
|
12
12
|
end
|
13
13
|
end
|
14
14
|
end
|
data/lib/markdownizer.rb
CHANGED
@@ -117,11 +117,6 @@ module Markdownizer
|
|
117
117
|
|
118
118
|
code, language = $2.strip, $1.strip
|
119
119
|
|
120
|
-
# Mark comments to avoid conflicts with Header parsing
|
121
|
-
code.gsub!(/(#+)/) do
|
122
|
-
'\\' + $1
|
123
|
-
end
|
124
|
-
|
125
120
|
code, options, caption = extract_caption_from(code, options)
|
126
121
|
code, options = extract_highlights_from(code, options)
|
127
122
|
|
@@ -196,7 +191,12 @@ module Markdownizer
|
|
196
191
|
# Define the converter method, which will assign the rendered html to the
|
197
192
|
# `:rendered_attribute` field.
|
198
193
|
define_method :"render_#{attribute}" do
|
199
|
-
|
194
|
+
value = self.send(attribute)
|
195
|
+
unless value.nil?
|
196
|
+
self.send(:"rendered_#{attribute}=", Markdownizer.markdown(Markdownizer.coderay(value, options), hierarchy))
|
197
|
+
else
|
198
|
+
self.send(:"rendered_#{attribute}=", nil)
|
199
|
+
end
|
200
200
|
end
|
201
201
|
end
|
202
202
|
end
|
data/lib/markdownizer/version.rb
CHANGED
data/markdownizer.gemspec
CHANGED
@@ -18,10 +18,8 @@ Gem::Specification.new do |s|
|
|
18
18
|
s.add_runtime_dependency 'rdiscount'
|
19
19
|
s.add_runtime_dependency 'coderay'
|
20
20
|
|
21
|
-
s.add_development_dependency 'rocco'
|
22
21
|
s.add_development_dependency 'git'
|
23
|
-
s.add_development_dependency '
|
24
|
-
s.add_development_dependency 'rspec', '~> 2.5.0'
|
22
|
+
s.add_development_dependency 'rspec', '~> 2.0'
|
25
23
|
|
26
24
|
s.files = `git ls-files`.split("\n")
|
27
25
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
data/spec/markdownizer_spec.rb
CHANGED
@@ -142,15 +142,6 @@ describe Markdownizer do
|
|
142
142
|
it 'accepts a caption with weird chars inside the code' do
|
143
143
|
subject.coderay(text_with_weird_caption).should match('<h5>This will become an h5, with some/strange.characters\yo</h5>')
|
144
144
|
end
|
145
|
-
it 'marks ruby comments to avoid conflicts with Markdown headers' do
|
146
|
-
code = ''
|
147
|
-
code.stub(:div).and_return ''
|
148
|
-
CodeRay.should_receive(:scan).with do |string|
|
149
|
-
string.should match(/\\#My comment/)
|
150
|
-
string.should match(/\\# My other comment/)
|
151
|
-
end.and_return code
|
152
|
-
subject.coderay(text_with_comments)
|
153
|
-
end
|
154
145
|
it 'passes the caption to the div' do
|
155
146
|
parsed = double :parsed
|
156
147
|
CodeRay.should_receive(:scan).and_return parsed
|
metadata
CHANGED
@@ -1,135 +1,101 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: markdownizer
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
segments:
|
6
|
-
- 0
|
7
|
-
- 3
|
8
|
-
- 6
|
9
|
-
version: 0.3.6
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.3.7
|
10
5
|
platform: ruby
|
11
|
-
authors:
|
6
|
+
authors:
|
12
7
|
- Josep M. Bach
|
13
8
|
- Josep Jaume Rey
|
14
9
|
- Oriol Gual
|
15
10
|
autorequire:
|
16
11
|
bindir: bin
|
17
12
|
cert_chain: []
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
dependencies:
|
22
|
-
- !ruby/object:Gem::Dependency
|
13
|
+
date: 2013-09-19 00:00:00.000000000 Z
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
23
16
|
name: activerecord
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
- - ">="
|
29
|
-
- !ruby/object:Gem::Version
|
30
|
-
segments:
|
31
|
-
- 3
|
32
|
-
- 0
|
33
|
-
- 3
|
17
|
+
requirement: !ruby/object:Gem::Requirement
|
18
|
+
requirements:
|
19
|
+
- - '>='
|
20
|
+
- !ruby/object:Gem::Version
|
34
21
|
version: 3.0.3
|
35
22
|
type: :runtime
|
36
|
-
version_requirements: *id001
|
37
|
-
- !ruby/object:Gem::Dependency
|
38
|
-
name: rdiscount
|
39
23
|
prerelease: false
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
requirements:
|
26
|
+
- - '>='
|
27
|
+
- !ruby/object:Gem::Version
|
28
|
+
version: 3.0.3
|
29
|
+
- !ruby/object:Gem::Dependency
|
30
|
+
name: rdiscount
|
31
|
+
requirement: !ruby/object:Gem::Requirement
|
32
|
+
requirements:
|
33
|
+
- - '>='
|
34
|
+
- !ruby/object:Gem::Version
|
35
|
+
version: '0'
|
48
36
|
type: :runtime
|
49
|
-
version_requirements: *id002
|
50
|
-
- !ruby/object:Gem::Dependency
|
51
|
-
name: coderay
|
52
37
|
prerelease: false
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
38
|
+
version_requirements: !ruby/object:Gem::Requirement
|
39
|
+
requirements:
|
40
|
+
- - '>='
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: '0'
|
43
|
+
- !ruby/object:Gem::Dependency
|
44
|
+
name: coderay
|
45
|
+
requirement: !ruby/object:Gem::Requirement
|
46
|
+
requirements:
|
47
|
+
- - '>='
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
version: '0'
|
61
50
|
type: :runtime
|
62
|
-
version_requirements: *id003
|
63
|
-
- !ruby/object:Gem::Dependency
|
64
|
-
name: rocco
|
65
51
|
prerelease: false
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
- 0
|
73
|
-
version: "0"
|
74
|
-
type: :development
|
75
|
-
version_requirements: *id004
|
76
|
-
- !ruby/object:Gem::Dependency
|
52
|
+
version_requirements: !ruby/object:Gem::Requirement
|
53
|
+
requirements:
|
54
|
+
- - '>='
|
55
|
+
- !ruby/object:Gem::Version
|
56
|
+
version: '0'
|
57
|
+
- !ruby/object:Gem::Dependency
|
77
58
|
name: git
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
- !ruby/object:Gem::Version
|
84
|
-
segments:
|
85
|
-
- 0
|
86
|
-
version: "0"
|
59
|
+
requirement: !ruby/object:Gem::Requirement
|
60
|
+
requirements:
|
61
|
+
- - '>='
|
62
|
+
- !ruby/object:Gem::Version
|
63
|
+
version: '0'
|
87
64
|
type: :development
|
88
|
-
version_requirements: *id005
|
89
|
-
- !ruby/object:Gem::Dependency
|
90
|
-
name: pygments
|
91
65
|
prerelease: false
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
- 0
|
99
|
-
version: "0"
|
100
|
-
type: :development
|
101
|
-
version_requirements: *id006
|
102
|
-
- !ruby/object:Gem::Dependency
|
66
|
+
version_requirements: !ruby/object:Gem::Requirement
|
67
|
+
requirements:
|
68
|
+
- - '>='
|
69
|
+
- !ruby/object:Gem::Version
|
70
|
+
version: '0'
|
71
|
+
- !ruby/object:Gem::Dependency
|
103
72
|
name: rspec
|
104
|
-
|
105
|
-
|
106
|
-
none: false
|
107
|
-
requirements:
|
73
|
+
requirement: !ruby/object:Gem::Requirement
|
74
|
+
requirements:
|
108
75
|
- - ~>
|
109
|
-
- !ruby/object:Gem::Version
|
110
|
-
|
111
|
-
- 2
|
112
|
-
- 5
|
113
|
-
- 0
|
114
|
-
version: 2.5.0
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '2.0'
|
115
78
|
type: :development
|
116
|
-
|
79
|
+
prerelease: false
|
80
|
+
version_requirements: !ruby/object:Gem::Requirement
|
81
|
+
requirements:
|
82
|
+
- - ~>
|
83
|
+
- !ruby/object:Gem::Version
|
84
|
+
version: '2.0'
|
117
85
|
description: Render any text as markdown, with code highlighting and all!
|
118
|
-
email:
|
86
|
+
email:
|
119
87
|
- info@codegram.com
|
120
88
|
executables: []
|
121
|
-
|
122
89
|
extensions: []
|
123
|
-
|
124
90
|
extra_rdoc_files: []
|
125
|
-
|
126
|
-
files:
|
91
|
+
files:
|
127
92
|
- .gemtest
|
128
93
|
- .gitignore
|
129
94
|
- .rspec
|
130
95
|
- .rvmrc
|
131
96
|
- Gemfile
|
132
97
|
- Gemfile.lock
|
98
|
+
- LICENSE
|
133
99
|
- Rakefile
|
134
100
|
- Readme.md
|
135
101
|
- init.rb
|
@@ -140,38 +106,30 @@ files:
|
|
140
106
|
- markdownizer.gemspec
|
141
107
|
- spec/markdownizer_spec.rb
|
142
108
|
- spec/spec_helper.rb
|
143
|
-
has_rdoc: true
|
144
109
|
homepage: http://github.com/codegram/markdownizer
|
145
110
|
licenses: []
|
146
|
-
|
111
|
+
metadata: {}
|
147
112
|
post_install_message:
|
148
113
|
rdoc_options: []
|
149
|
-
|
150
|
-
require_paths:
|
114
|
+
require_paths:
|
151
115
|
- lib
|
152
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
requirements:
|
163
|
-
- - ">="
|
164
|
-
- !ruby/object:Gem::Version
|
165
|
-
segments:
|
166
|
-
- 0
|
167
|
-
version: "0"
|
116
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
117
|
+
requirements:
|
118
|
+
- - '>='
|
119
|
+
- !ruby/object:Gem::Version
|
120
|
+
version: '0'
|
121
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
122
|
+
requirements:
|
123
|
+
- - '>='
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: '0'
|
168
126
|
requirements: []
|
169
|
-
|
170
127
|
rubyforge_project: markdownizer
|
171
|
-
rubygems_version:
|
128
|
+
rubygems_version: 2.0.3
|
172
129
|
signing_key:
|
173
|
-
specification_version:
|
130
|
+
specification_version: 4
|
174
131
|
summary: Render any text as markdown, with code highlighting and all!
|
175
|
-
test_files:
|
132
|
+
test_files:
|
176
133
|
- spec/markdownizer_spec.rb
|
177
134
|
- spec/spec_helper.rb
|
135
|
+
has_rdoc:
|