markdown-rails 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
data/History.md CHANGED
@@ -1,6 +1,11 @@
1
+ # 0.2.1
2
+
3
+ * Add support for Rails 2.x
4
+
1
5
  # 0.2.0
2
6
 
3
- * Use MarkdownRails instead of Markdown::Rails to avoid conflict with RDiscount's Markdown class
7
+ * Use MarkdownRails instead of Markdown::Rails to avoid conflict with
8
+ RDiscount's Markdown class
4
9
 
5
10
  # 0.1.0
6
11
 
data/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # markdown-rails
2
2
 
3
+ [![Dependency Status](https://gemnasium.com/joliss/markdown-rails.png)](https://gemnasium.com/joliss/markdown-rails)
4
+
3
5
  This gem allows you to write static Rails views and partials using the
4
6
  [Markdown](http://daringfireball.net/projects/markdown/syntax) syntax. No more
5
7
  editing prose in HTML!
@@ -49,6 +51,12 @@ In `app/views/posts/_edit_help.html.md`:
49
51
  This text is written in **Markdown**. :-)
50
52
  ```
51
53
 
54
+ Note: If you are including Markdown partials from a Haml view, `<pre>` blocks
55
+ inside your Markdown may be indented when Haml is not in ["ugly" (production)
56
+ mode](http://haml-lang.com/docs/yardoc/file.HAML_REFERENCE.html#ugly-option),
57
+ causing leading white-space to appear in development mode. To fix this, set
58
+ `Haml::Template.options[:ugly] = true`.
59
+
52
60
  ## Configuration
53
61
 
54
62
  By default markdown-rails uses the
@@ -92,12 +100,12 @@ Markdown views from a source if you wouldn't trust Erb views from them.
92
100
 
93
101
  * It's not possible to embed Ruby code in the Markdown code. Unfortunately,
94
102
  you cannot simply chain template handlers (`.md.erb`) like you can with
95
- asset handlers. (This is reasonable if you consider that unlike assets,
103
+ asset handlers. This is reasonable if you consider that unlike assets,
96
104
  templates are precompiled not into strings but into Ruby code, which is
97
- then called every time the template is served.) Still, the performance of
98
- modern Markdown parsers is good enough that you can reparse the Markdown on
99
- every template view without precompiling, so this should be possible in
100
- principle.
105
+ then called every time the template is served. Still, the performance of
106
+ modern Markdown parsers is good enough that you could afford to reparse the
107
+ Markdown on every template view, so having Markdown with Erb in it should
108
+ be possible in principle.
101
109
 
102
110
  In the meantime, you can [use HAML's :markdown
103
111
  filter](http://stackoverflow.com/a/4418389/525872) to the same effect.
@@ -33,5 +33,22 @@ MarkdownRails.configure do |config|
33
33
  end
34
34
 
35
35
  handler = MarkdownRails::Handler.new
36
- ActionView::Template.register_template_handler(:md, handler)
37
- ActionView::Template.register_template_handler(:markdown, handler)
36
+
37
+ [:md, :markdown].each do |extension|
38
+ # >= v3.0.5
39
+ if defined? ActionView::Template::Handlers and ActionView::Template::Handlers.respond_to? :register_template_handler
40
+ ActionView::Template::Handlers
41
+ # >= v2.1.0 <= v2.1.0
42
+ elsif defined? ActionView::Template and ActionView::Template.respond_to? :register_template_handler
43
+ ActionView::Template
44
+ # >= v2.2.1 <= v2.3.8
45
+ elsif defined? ActionView::TemplateHandlers and ActionView::TemplateHandlers.respond_to? :register_template_handler
46
+ ActionView::TemplateHandlers
47
+ # <= v2.0.3
48
+ elsif defined? ActionView::Base and ActionView::Base.respond_to? :register_template_handler
49
+ ActionView::Base
50
+ # I give up...
51
+ else
52
+ raise "Couldn't find `register_template_handler' method in ActionView module."
53
+ end.register_template_handler extension, handler
54
+ end
@@ -1,3 +1,3 @@
1
1
  module MarkdownRails
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
@@ -12,10 +12,10 @@ Gem::Specification.new do |s|
12
12
 
13
13
  s.required_rubygems_version = ">= 1.3.6"
14
14
 
15
- s.add_dependency "rails", ">= 3.0.0"
15
+ s.add_dependency "rails"
16
16
  s.add_dependency "rdiscount", [">= 1.6.8", "< 2.0"]
17
17
 
18
18
  s.files = `git ls-files`.split("\n").reject { |f| f =~ /^testapp/ }
19
- s.executables = `git ls-files`.split("\n").select { |f| f =~ /^bin/ }
19
+ s.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
20
20
  s.require_path = 'lib'
21
21
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: markdown-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,22 +9,27 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-02-23 00:00:00.000000000 Z
12
+ date: 2012-08-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
16
- requirement: &16496040 !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
20
20
  - !ruby/object:Gem::Version
21
- version: 3.0.0
21
+ version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *16496040
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
25
30
  - !ruby/object:Gem::Dependency
26
31
  name: rdiscount
27
- requirement: &16495540 !ruby/object:Gem::Requirement
32
+ requirement: !ruby/object:Gem::Requirement
28
33
  none: false
29
34
  requirements:
30
35
  - - ! '>='
@@ -35,7 +40,15 @@ dependencies:
35
40
  version: '2.0'
36
41
  type: :runtime
37
42
  prerelease: false
38
- version_requirements: *16495540
43
+ version_requirements: !ruby/object:Gem::Requirement
44
+ none: false
45
+ requirements:
46
+ - - ! '>='
47
+ - !ruby/object:Gem::Version
48
+ version: 1.6.8
49
+ - - <
50
+ - !ruby/object:Gem::Version
51
+ version: '2.0'
39
52
  description: Markdown as a static templating language for Rails views and partials
40
53
  email:
41
54
  - joliss42@gmail.com
@@ -72,7 +85,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
72
85
  version: 1.3.6
73
86
  requirements: []
74
87
  rubyforge_project:
75
- rubygems_version: 1.8.11
88
+ rubygems_version: 1.8.23
76
89
  signing_key:
77
90
  specification_version: 3
78
91
  summary: Markdown as a Rails templating language