monologue-markdown 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: e53e97358288c48efcebed3722d71bd7c456f572
4
+ data.tar.gz: 26d13e69f66658abed137f80bf404d60c1aa6e65
5
+ SHA512:
6
+ metadata.gz: 61045826a9579a516d167e3eaed373d2b8b2665d234ee8b6b6afc154bd8cae4f4d1ae92d9141b225669590f11f48b6e50517a01dc867609b7afbc737daf7de19
7
+ data.tar.gz: 2e6da97d49a11ef4e298d9f74a3b80a3d23633f76314b924b91305870f35d00d813c755c4206237b0475ed1ecb824cfaa3d83702b7eb5f3e99c9ee217d6505f9
data/README.md CHANGED
@@ -1,7 +1,9 @@
1
- # Monologue: markdown edition
1
+ # monologue-markdown
2
2
 
3
3
  This is a simple extension that will change [Monologue](https://github.com/jipiboily/monologue)'s default editor to EpicEditor which will let you use Markdown instead of a WYSIWYG edit.
4
4
 
5
+ IMPORTANT: this README is for Monologue 0.3.X.
6
+
5
7
  ## Install on a brand new Monologue installation
6
8
 
7
9
  This is simple, you just have to add this file to your `Gemfile` after Monologue:
@@ -13,14 +15,16 @@ Then run this:
13
15
  bundle exec rake monologue_markdown:install:migrations
14
16
  bundle exec rake db:migrate
15
17
 
16
-
17
18
  ## Install on an already existing Monologue installation
18
19
 
19
20
  You do the same as for a new Monologue installation, but, keep in mind that only new posts will have EpicEditor enabled. All the posts that existed before will still be using the WYSIWYG editor.
20
21
 
22
+ ## For Code Highlighting
23
+
24
+ sudo easy_install Pygments
21
25
 
22
26
  ## Notes
23
27
 
24
28
  There are [Deface](https://github.com/railsdog/deface/) overrides with this project. You might want to (read: "should") turn it off on production. If you do, you can add a Capistrano task to precompile them or precompile them locally.
25
29
 
26
- [Read more about this here.](https://github.com/railsdog/deface/#production--precompiling)
30
+ [Read more about this here.](https://github.com/railsdog/deface/#production--precompiling)
@@ -1,11 +1,11 @@
1
1
  class MonologueMarkdown
2
2
  constructor: ->
3
- @textarea = $("#post_posts_revision_content")
3
+ @textarea = $("#post_content")
4
4
  @opts =
5
5
  container: "epiceditor"
6
6
  basePath: ""
7
+ clientSideStorage: false
7
8
  clientSideStorage: true
8
- localStorageName: "epiceditor"
9
9
  parser: marked
10
10
  file:
11
11
  name: "epiceditor"
@@ -23,34 +23,44 @@ class MonologueMarkdown
23
23
  fullscreen: 70
24
24
  preview: 80
25
25
  edit: 79
26
+
27
+ @initEpicEditor()
28
+ @bindEvents()
29
+ @removeDefaultEditor() # remove CKEDITOR right now if it is already loaded
30
+
31
+ initEpicEditor: ->
26
32
  $(@textarea).after("<div id='epiceditor'></div>")
27
33
  $(@textarea).hide()
28
- that = @
34
+ @editor = new EpicEditor(@opts)
35
+ @bindEpicEvents()
36
+ @editor.load()
29
37
 
30
- editor = new EpicEditor(@opts)
38
+ bindEpicEvents: ->
39
+ @editor.on "load", (data) =>
40
+ @editor.importFile('epiceditor',$(@textarea).val())
31
41
 
32
- editor.on "load", (data) ->
33
- editor.importFile('epiceditor',$(that.textarea).val())
42
+ @editor.on "update", (data) =>
43
+ @update_content(data)
34
44
 
35
- editor.on "update", (data) ->
36
- that.update_content(data)
45
+ bindEvents: ->
46
+ $("form").submit (e) =>
47
+ @editor.emit("update")
37
48
 
38
- editor.load()
49
+ # removing CKEDITOR when loaded
50
+ CKEDITOR.on 'instanceReady', =>
51
+ @removeDefaultEditor()
39
52
 
40
- $("form").submit (e) ->
41
- editor.emit("update")
42
53
  update_content: (data) =>
43
- # forcing unload of tinymce to make sure it doesn't add stuff in our neat content
44
- @force_unload_tiny_mce()
45
54
  # update content with our awesome markdown
46
55
  @textarea.val data.content
47
56
 
48
- force_unload_tiny_mce: =>
57
+ removeDefaultEditor: =>
49
58
  try
50
- tinymce.get(0).remove()
51
- $(".mceEditor").remove()
52
- catch e
53
- # well, it looks like TinyMCE wasn't load for some reason anyway
59
+ CKEDITOR.instances["post_content"].destroy(true)
60
+ $(@textarea).hide()
61
+ catch
62
+ #
63
+ $('#cke_post_content').remove()
54
64
 
55
65
 
56
66
  $(document).ready ->
@@ -0,0 +1,79 @@
1
+
2
+ code .hll { background-color: #ffffcc }
3
+ code .c { color: #408080; font-style: italic } /* Comment */
4
+ code .err { border: 1px solid #FF0000 } /* Error */
5
+ code .k { color: #008000; font-weight: bold } /* Keyword */
6
+ code .o { color: #666666 } /* Operator */
7
+ code .cm { color: #408080; font-style: italic } /* Comment.Multiline */
8
+ code .cp { color: #BC7A00 } /* Comment.Preproc */
9
+ code .c1 { color: #408080; font-style: italic } /* Comment.Single */
10
+ code .cs { color: #408080; font-style: italic } /* Comment.Special */
11
+ code .gd { color: #A00000 } /* Generic.Deleted */
12
+ code .ge { font-style: italic } /* Generic.Emph */
13
+ code .gr { color: #FF0000 } /* Generic.Error */
14
+ code .gh { color: #000080; font-weight: bold } /* Generic.Heading */
15
+ code .gi { color: #00A000 } /* Generic.Inserted */
16
+ code .go { color: #888888 } /* Generic.Output */
17
+ code .gp { color: #000080; font-weight: bold } /* Generic.Prompt */
18
+ code .gs { font-weight: bold } /* Generic.Strong */
19
+ code .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
20
+ code .gt { color: #0044DD } /* Generic.Traceback */
21
+ code .kc { color: #008000; font-weight: bold } /* Keyword.Constant */
22
+ code .kd { color: #008000; font-weight: bold } /* Keyword.Declaration */
23
+ code .kn { color: #008000; font-weight: bold } /* Keyword.Namespace */
24
+ code .kp { color: #008000 } /* Keyword.Pseudo */
25
+ code .kr { color: #008000; font-weight: bold } /* Keyword.Reserved */
26
+ code .kt { color: #B00040 } /* Keyword.Type */
27
+ code .m { color: #666666 } /* Literal.Number */
28
+ code .s { color: #BA2121 } /* Literal.String */
29
+ code .na { color: #7D9029 } /* Name.Attribute */
30
+ code .nb { color: #008000 } /* Name.Builtin */
31
+ code .nc { color: #0000FF; font-weight: bold } /* Name.Class */
32
+ code .no { color: #880000 } /* Name.Constant */
33
+ code .nd { color: #AA22FF } /* Name.Decorator */
34
+ code .ni { color: #999999; font-weight: bold } /* Name.Entity */
35
+ code .ne { color: #D2413A; font-weight: bold } /* Name.Exception */
36
+ code .nf { color: #0000FF } /* Name.Function */
37
+ code .nl { color: #A0A000 } /* Name.Label */
38
+ code .nn { color: #0000FF; font-weight: bold } /* Name.Namespace */
39
+ code .nt { color: #008000; font-weight: bold } /* Name.Tag */
40
+ code .nv { color: #19177C } /* Name.Variable */
41
+ code .ow { color: #AA22FF; font-weight: bold } /* Operator.Word */
42
+ code .w { color: #bbbbbb } /* Text.Whitespace */
43
+ code .mf { color: #666666 } /* Literal.Number.Float */
44
+ code .mh { color: #666666 } /* Literal.Number.Hex */
45
+ code .mi { color: #666666 } /* Literal.Number.Integer */
46
+ code .mo { color: #666666 } /* Literal.Number.Oct */
47
+ code .sb { color: #BA2121 } /* Literal.String.Backtick */
48
+ code .sc { color: #BA2121 } /* Literal.String.Char */
49
+ code .sd { color: #BA2121; font-style: italic } /* Literal.String.Doc */
50
+ code .s2 { color: #BA2121 } /* Literal.String.Double */
51
+ code .se { color: #BB6622; font-weight: bold } /* Literal.String.Escape */
52
+ code .sh { color: #BA2121 } /* Literal.String.Heredoc */
53
+ code .si { color: #BB6688; font-weight: bold } /* Literal.String.Interpol */
54
+ code .sx { color: #008000 } /* Literal.String.Other */
55
+ code .sr { color: #BB6688 } /* Literal.String.Regex */
56
+ code .s1 { color: #BA2121 } /* Literal.String.Single */
57
+ code .ss { color: #19177C } /* Literal.String.Symbol */
58
+ code .bp { color: #008000 } /* Name.Builtin.Pseudo */
59
+ code .vc { color: #19177C } /* Name.Variable.Class */
60
+ code .vg { color: #19177C } /* Name.Variable.Global */
61
+ code .vi { color: #19177C } /* Name.Variable.Instance */
62
+ code .il { color: #666666 } /* Literal.Number.Integer.Long */
63
+
64
+ figure.code .gutter pre {
65
+ margin-right: 10px;
66
+ padding-right: 10px;
67
+ border-right: 1px solid #e5e5e5;
68
+ text-align: right;
69
+ }
70
+
71
+ figure.code {
72
+ margin: 5px;
73
+ padding: 5px;
74
+ white-space:nowrap;
75
+ border:1px solid #eaeaea;
76
+ background-color:#f8f8f8;
77
+ border-radius:3px;
78
+ overflow-x: scroll;
79
+ }
@@ -0,0 +1,26 @@
1
+ Monologue::Post.class_eval do
2
+ before_validation do
3
+ if self.new_record?
4
+ self.is_markdown = true
5
+ end
6
+ end
7
+
8
+ def is_markdown?
9
+ self.is_markdown == true
10
+ end
11
+
12
+ def content
13
+ if self.is_markdown? && !in_admin?(caller)
14
+ pipeline = Content::Pipeline.new
15
+ return pipeline.filter(read_attribute(:content), markdown: { type: :gfm, safe: false })
16
+ end
17
+ read_attribute(:content)
18
+ end
19
+
20
+ def in_admin? caller
21
+ caller.each do |c|
22
+ return true if c.include? "app/controllers/monologue/admin/posts_controller.rb"
23
+ end
24
+ return false
25
+ end
26
+ end
@@ -1 +1 @@
1
- <div id="is_markdown" style="display:none"><%= @post.active_revision.is_markdown?%></div>
1
+ <div id="is_markdown" style="display:none"><%= @post.is_markdown?%></div>
@@ -0,0 +1,33 @@
1
+ class MergeMarkdownRevisionsIntoPosts < ActiveRecord::Migration
2
+ class Monologue::PostsRevision < ActiveRecord::Base
3
+ attr_accessible :title, :content, :url, :published_at, :post_id
4
+ end
5
+
6
+ class Monologue::Post < ActiveRecord::Base
7
+ end
8
+
9
+ def up
10
+ Monologue::PostsRevision.reset_column_information
11
+ Monologue::Post.reset_column_information
12
+ add_column :monologue_posts, :is_markdown, :boolean
13
+
14
+ Monologue::Post.reset_column_information
15
+
16
+ Monologue::Post.all.each do |post|
17
+ latest_revision = latest_revision_for(post)
18
+ post.is_markdown = latest_revision.is_markdown
19
+ post.save(validate: false)
20
+ end
21
+
22
+ remove_column :monologue_posts_revisions, :is_markdown
23
+ end
24
+
25
+ def down
26
+ raise ActiveRecord::IrreversibleMigration
27
+ end
28
+
29
+ private
30
+ def latest_revision_for(post)
31
+ Monologue::PostsRevision.where("post_id = ?", post.id).order("monologue_posts_revisions.updated_at DESC").limit(1).first
32
+ end
33
+ end
@@ -1,5 +1,5 @@
1
1
  require "deface"
2
- require "redcarpet"
2
+ require 'content/pipeline'
3
3
 
4
4
  module MonologueMarkdown
5
5
  class Engine < ::Rails::Engine
@@ -12,6 +12,7 @@ module MonologueMarkdown
12
12
 
13
13
  initializer :assets do |config|
14
14
  Rails.application.config.assets.precompile += %w( monologue-markdown/epiceditor/themes/base/epiceditor.css monologue-markdown/epiceditor/themes/editor/epic-dark.css monologue-markdown/epiceditor/themes/preview/github.css )
15
+ Rails.application.config.assets.precompile += %w( monologue-markdown/code-highlighting.css)
15
16
  end
16
17
 
17
18
  def self.activate
@@ -1,3 +1,3 @@
1
1
  module MonologueMarkdown
2
- VERSION = "0.2.0"
2
+ VERSION = "0.3.0"
3
3
  end
metadata CHANGED
@@ -1,181 +1,219 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: monologue-markdown
3
- version: !ruby/object:Gem::Version
4
- prerelease: false
5
- segments:
6
- - 0
7
- - 2
8
- - 0
9
- version: 0.2.0
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.3.0
10
5
  platform: ruby
11
- authors:
6
+ authors:
12
7
  - Jean-Philippe Boily
13
8
  autorequire:
14
9
  bindir: bin
15
10
  cert_chain: []
16
-
17
- date: 2012-10-18 00:00:00 -04:00
18
- default_executable:
19
- dependencies:
20
- - !ruby/object:Gem::Dependency
11
+ date: 2013-09-22 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
21
14
  name: rails
22
- prerelease: false
23
- requirement: &id001 !ruby/object:Gem::Requirement
24
- requirements:
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
25
17
  - - ~>
26
- - !ruby/object:Gem::Version
27
- segments:
28
- - 3
29
- - 2
30
- - 8
18
+ - !ruby/object:Gem::Version
31
19
  version: 3.2.8
32
20
  type: :runtime
33
- version_requirements: *id001
34
- - !ruby/object:Gem::Dependency
35
- name: monologue
36
21
  prerelease: false
37
- requirement: &id002 !ruby/object:Gem::Requirement
38
- requirements:
39
- - - ">="
40
- - !ruby/object:Gem::Version
41
- segments:
42
- - 0
43
- version: "0"
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: 3.2.8
27
+ - !ruby/object:Gem::Dependency
28
+ name: monologue
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
44
34
  type: :runtime
45
- version_requirements: *id002
46
- - !ruby/object:Gem::Dependency
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
47
42
  name: deface
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ~>
46
+ - !ruby/object:Gem::Version
47
+ version: 1.0.0.rc3
48
+ type: :runtime
48
49
  prerelease: false
49
- requirement: &id003 !ruby/object:Gem::Requirement
50
- requirements:
51
- - - ">="
52
- - !ruby/object:Gem::Version
53
- segments:
54
- - 0
55
- version: "0"
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ~>
53
+ - !ruby/object:Gem::Version
54
+ version: 1.0.0.rc3
55
+ - !ruby/object:Gem::Dependency
56
+ name: github-markdown
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ~>
60
+ - !ruby/object:Gem::Version
61
+ version: 0.5.3
56
62
  type: :runtime
57
- version_requirements: *id003
58
- - !ruby/object:Gem::Dependency
59
- name: redcarpet
60
63
  prerelease: false
61
- requirement: &id004 !ruby/object:Gem::Requirement
62
- requirements:
63
- - - ">="
64
- - !ruby/object:Gem::Version
65
- segments:
66
- - 0
67
- version: "0"
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ~>
67
+ - !ruby/object:Gem::Version
68
+ version: 0.5.3
69
+ - !ruby/object:Gem::Dependency
70
+ name: content-pipeline
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ~>
74
+ - !ruby/object:Gem::Version
75
+ version: 0.2.0
68
76
  type: :runtime
69
- version_requirements: *id004
70
- - !ruby/object:Gem::Dependency
71
- name: jquery-rails
72
77
  prerelease: false
73
- requirement: &id005 !ruby/object:Gem::Requirement
74
- requirements:
75
- - - ">="
76
- - !ruby/object:Gem::Version
77
- segments:
78
- - 0
79
- version: "0"
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ~>
81
+ - !ruby/object:Gem::Version
82
+ version: 0.2.0
83
+ - !ruby/object:Gem::Dependency
84
+ name: pygments.rb
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ~>
88
+ - !ruby/object:Gem::Version
89
+ version: 0.5.2
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ~>
95
+ - !ruby/object:Gem::Version
96
+ version: 0.5.2
97
+ - !ruby/object:Gem::Dependency
98
+ name: jquery-rails
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - '>='
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
80
104
  type: :runtime
81
- version_requirements: *id005
82
- - !ruby/object:Gem::Dependency
83
- name: rspec-rails
84
105
  prerelease: false
85
- requirement: &id006 !ruby/object:Gem::Requirement
86
- requirements:
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - '>='
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: rspec-rails
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
87
115
  - - ~>
88
- - !ruby/object:Gem::Version
89
- segments:
90
- - 2
91
- - 11
92
- version: "2.11"
116
+ - !ruby/object:Gem::Version
117
+ version: '2.11'
93
118
  type: :development
94
- version_requirements: *id006
95
- - !ruby/object:Gem::Dependency
96
- name: factory_girl_rails
97
119
  prerelease: false
98
- requirement: &id007 !ruby/object:Gem::Requirement
99
- requirements:
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ~>
123
+ - !ruby/object:Gem::Version
124
+ version: '2.11'
125
+ - !ruby/object:Gem::Dependency
126
+ name: factory_girl_rails
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
100
129
  - - ~>
101
- - !ruby/object:Gem::Version
102
- segments:
103
- - 4
104
- - 1
105
- - 0
130
+ - !ruby/object:Gem::Version
106
131
  version: 4.1.0
107
132
  type: :development
108
- version_requirements: *id007
109
- - !ruby/object:Gem::Dependency
110
- name: capybara
111
133
  prerelease: false
112
- requirement: &id008 !ruby/object:Gem::Requirement
113
- requirements:
114
- - - ">="
115
- - !ruby/object:Gem::Version
116
- segments:
117
- - 0
118
- version: "0"
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - ~>
137
+ - !ruby/object:Gem::Version
138
+ version: 4.1.0
139
+ - !ruby/object:Gem::Dependency
140
+ name: capybara
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - '>='
144
+ - !ruby/object:Gem::Version
145
+ version: '0'
119
146
  type: :development
120
- version_requirements: *id008
121
- - !ruby/object:Gem::Dependency
122
- name: shoulda
123
147
  prerelease: false
124
- requirement: &id009 !ruby/object:Gem::Requirement
125
- requirements:
126
- - - ">="
127
- - !ruby/object:Gem::Version
128
- segments:
129
- - 0
130
- version: "0"
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - '>='
151
+ - !ruby/object:Gem::Version
152
+ version: '0'
153
+ - !ruby/object:Gem::Dependency
154
+ name: shoulda
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - '>='
158
+ - !ruby/object:Gem::Version
159
+ version: '0'
131
160
  type: :development
132
- version_requirements: *id009
133
- - !ruby/object:Gem::Dependency
134
- name: guard-rspec
135
161
  prerelease: false
136
- requirement: &id010 !ruby/object:Gem::Requirement
137
- requirements:
138
- - - ">="
139
- - !ruby/object:Gem::Version
140
- segments:
141
- - 0
142
- version: "0"
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - '>='
165
+ - !ruby/object:Gem::Version
166
+ version: '0'
167
+ - !ruby/object:Gem::Dependency
168
+ name: guard-rspec
169
+ requirement: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - '>='
172
+ - !ruby/object:Gem::Version
173
+ version: '0'
143
174
  type: :development
144
- version_requirements: *id010
145
- - !ruby/object:Gem::Dependency
146
- name: database_cleaner
147
175
  prerelease: false
148
- requirement: &id011 !ruby/object:Gem::Requirement
149
- requirements:
150
- - - ">="
151
- - !ruby/object:Gem::Version
152
- segments:
153
- - 0
154
- version: "0"
176
+ version_requirements: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - '>='
179
+ - !ruby/object:Gem::Version
180
+ version: '0'
181
+ - !ruby/object:Gem::Dependency
182
+ name: database_cleaner
183
+ requirement: !ruby/object:Gem::Requirement
184
+ requirements:
185
+ - - '>='
186
+ - !ruby/object:Gem::Version
187
+ version: '0'
155
188
  type: :development
156
- version_requirements: *id011
157
- - !ruby/object:Gem::Dependency
158
- name: mysql2
159
189
  prerelease: false
160
- requirement: &id012 !ruby/object:Gem::Requirement
161
- requirements:
162
- - - ">="
163
- - !ruby/object:Gem::Version
164
- segments:
165
- - 0
166
- version: "0"
190
+ version_requirements: !ruby/object:Gem::Requirement
191
+ requirements:
192
+ - - '>='
193
+ - !ruby/object:Gem::Version
194
+ version: '0'
195
+ - !ruby/object:Gem::Dependency
196
+ name: mysql2
197
+ requirement: !ruby/object:Gem::Requirement
198
+ requirements:
199
+ - - '>='
200
+ - !ruby/object:Gem::Version
201
+ version: '0'
167
202
  type: :development
168
- version_requirements: *id012
169
- description: A small and simple efficient extension to Monologue that replace the default WYSIWYG editor with a Markdown editor.
170
- email:
203
+ prerelease: false
204
+ version_requirements: !ruby/object:Gem::Requirement
205
+ requirements:
206
+ - - '>='
207
+ - !ruby/object:Gem::Version
208
+ version: '0'
209
+ description: A small and simple efficient extension to Monologue that replace the
210
+ default WYSIWYG editor with a Markdown editor.
211
+ email:
171
212
  - j@jipi.ca
172
213
  executables: []
173
-
174
214
  extensions: []
175
-
176
215
  extra_rdoc_files: []
177
-
178
- files:
216
+ files:
179
217
  - app/assets/images/monologue-markdown/epiceditor/edit.png
180
218
  - app/assets/images/monologue-markdown/epiceditor/fullscreen.png
181
219
  - app/assets/images/monologue-markdown/epiceditor/preview.png
@@ -183,18 +221,20 @@ files:
183
221
  - app/assets/javascripts/monologue-markdown/epiceditor/epiceditor.min.js.erb
184
222
  - app/assets/javascripts/monologue-markdown/epiceditor_load.coffee.erb
185
223
  - app/assets/stylesheets/monologue-markdown/application.css
224
+ - app/assets/stylesheets/monologue-markdown/code-highlighting.css
186
225
  - app/assets/stylesheets/monologue-markdown/epiceditor/themes/base/epiceditor.css
187
226
  - app/assets/stylesheets/monologue-markdown/epiceditor/themes/editor/epic-dark.css
188
227
  - app/assets/stylesheets/monologue-markdown/epiceditor/themes/editor/epic-light.css
189
228
  - app/assets/stylesheets/monologue-markdown/epiceditor/themes/preview/github.css
190
229
  - app/assets/stylesheets/monologue-markdown/epiceditor/themes/preview/preview-dark.css
191
- - app/models/monologue/posts_revision_decorator.rb
230
+ - app/models/monologue/post_decorator.rb
192
231
  - app/overrides/insert_epiceditor_in_admin.rb
193
232
  - app/overrides/insert_is_markdown_in_post_edit.rb
194
233
  - app/views/monologue-markdown/overrides/_epiceditor.html.erb
195
234
  - app/views/monologue-markdown/overrides/_is_markdown.html.erb
196
235
  - config/routes.rb
197
236
  - db/migrate/20120924111013_add_is_markown_to_posts_revision.rb
237
+ - db/migrate/20130913004609_merge_markdown_revisions_into_posts.rb
198
238
  - lib/monologue-markdown/engine.rb
199
239
  - lib/monologue-markdown/version.rb
200
240
  - lib/monologue-markdown.rb
@@ -202,35 +242,28 @@ files:
202
242
  - MIT-LICENSE
203
243
  - Rakefile
204
244
  - README.md
205
- has_rdoc: true
206
245
  homepage: https://github.com/jipiboily/monologue-markdown
207
246
  licenses: []
208
-
247
+ metadata: {}
209
248
  post_install_message:
210
249
  rdoc_options: []
211
-
212
- require_paths:
250
+ require_paths:
213
251
  - lib
214
- required_ruby_version: !ruby/object:Gem::Requirement
215
- requirements:
216
- - - ">="
217
- - !ruby/object:Gem::Version
218
- segments:
219
- - 0
220
- version: "0"
221
- required_rubygems_version: !ruby/object:Gem::Requirement
222
- requirements:
223
- - - ">="
224
- - !ruby/object:Gem::Version
225
- segments:
226
- - 0
227
- version: "0"
252
+ required_ruby_version: !ruby/object:Gem::Requirement
253
+ requirements:
254
+ - - '>='
255
+ - !ruby/object:Gem::Version
256
+ version: '0'
257
+ required_rubygems_version: !ruby/object:Gem::Requirement
258
+ requirements:
259
+ - - '>='
260
+ - !ruby/object:Gem::Version
261
+ version: '0'
228
262
  requirements: []
229
-
230
263
  rubyforge_project:
231
- rubygems_version: 1.3.6
264
+ rubygems_version: 2.0.2
232
265
  signing_key:
233
- specification_version: 3
234
- summary: A small and simple efficient extension to Monologue that replace the default WYSIWYG editor with a Markdown editor.
266
+ specification_version: 4
267
+ summary: A small and simple efficient extension to Monologue that replace the default
268
+ WYSIWYG editor with a Markdown editor.
235
269
  test_files: []
236
-
@@ -1,28 +0,0 @@
1
- Monologue::PostsRevision.class_eval do
2
- before_validation do
3
- if self.post.nil? || self.post.posts_revision_id.nil?
4
- self.is_markdown = true
5
- else
6
- self.is_markdown = self.post.active_revision.is_markdown
7
- end
8
- end
9
-
10
- def is_markdown?
11
- self.is_markdown != false
12
- end
13
-
14
- def content
15
- if self.is_markdown? && !in_admin?(caller)
16
- markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML, :autolink => true, :space_after_headers => true)
17
- return markdown.render(read_attribute(:content))
18
- end
19
- read_attribute(:content)
20
- end
21
-
22
- def in_admin? caller
23
- caller.each do |c|
24
- return true if c.include? "app/controllers/monologue/admin/posts_controller.rb"
25
- end
26
- return false
27
- end
28
- end