md_simple_editor 0.2.3.pre3 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (74) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +0 -7
  3. data/.idea/.rakeTasks +7 -0
  4. data/.idea/encodings.xml +5 -0
  5. data/.idea/md_simple_editor.iml +23 -0
  6. data/.idea/misc.xml +36 -0
  7. data/.idea/modules.xml +9 -0
  8. data/.idea/scopes/scope_settings.xml +5 -0
  9. data/.idea/vcs.xml +7 -0
  10. data/.idea/workspace.xml +56 -0
  11. data/CHANGELOG.md +41 -0
  12. data/Gemfile +1 -3
  13. data/README.md +9 -4
  14. data/Rakefile +0 -16
  15. data/app/assets/javascripts/md_simple_editor.js.coffee +61 -41
  16. data/app/assets/stylesheets/md_simple_editor.css.scss +5 -66
  17. data/app/controllers/md_simple_editor_controller.rb +7 -0
  18. data/app/helpers/md_simple_editor/rails/md_helper.rb +32 -22
  19. data/config/routes.rb +3 -3
  20. data/lib/md_simple_editor/engine.rb +2 -3
  21. data/lib/md_simple_editor/version.rb +1 -2
  22. data/lib/md_simple_editor.rb +0 -3
  23. data/md_simple_editor.gemspec +3 -2
  24. metadata +30 -113
  25. data/app/assets/javascripts/md_simple_editor/md_preview.js +0 -2
  26. data/app/assets/stylesheets/md_simple_editor/md_preview.css +0 -4
  27. data/app/controllers/md_simple_editor/application_controller.rb +0 -4
  28. data/app/controllers/md_simple_editor/md_preview_controller.rb +0 -8
  29. data/app/helpers/md_simple_editor/md_preview_helper.rb +0 -4
  30. data/app/views/md_simple_editor/layouts/md_simple_editor/application.html.erb +0 -14
  31. data/app/views/md_simple_editor/md_preview/preview.html.erb +0 -2
  32. data/test/blorgh_test.rb +0 -7
  33. data/test/controllers/md_simple_editor/md_preview_controller_test.rb +0 -11
  34. data/test/dummy/README.rdoc +0 -28
  35. data/test/dummy/Rakefile +0 -6
  36. data/test/dummy/app/assets/images/.keep +0 -0
  37. data/test/dummy/app/assets/javascripts/application.js +0 -13
  38. data/test/dummy/app/assets/stylesheets/application.css +0 -15
  39. data/test/dummy/app/controllers/application_controller.rb +0 -5
  40. data/test/dummy/app/controllers/concerns/.keep +0 -0
  41. data/test/dummy/app/helpers/application_helper.rb +0 -2
  42. data/test/dummy/app/mailers/.keep +0 -0
  43. data/test/dummy/app/models/.keep +0 -0
  44. data/test/dummy/app/models/concerns/.keep +0 -0
  45. data/test/dummy/app/views/layouts/application.html.erb +0 -14
  46. data/test/dummy/bin/bundle +0 -3
  47. data/test/dummy/bin/rails +0 -4
  48. data/test/dummy/bin/rake +0 -4
  49. data/test/dummy/config/application.rb +0 -23
  50. data/test/dummy/config/boot.rb +0 -5
  51. data/test/dummy/config/database.yml +0 -25
  52. data/test/dummy/config/environment.rb +0 -5
  53. data/test/dummy/config/environments/development.rb +0 -29
  54. data/test/dummy/config/environments/production.rb +0 -80
  55. data/test/dummy/config/environments/test.rb +0 -36
  56. data/test/dummy/config/initializers/backtrace_silencers.rb +0 -7
  57. data/test/dummy/config/initializers/filter_parameter_logging.rb +0 -4
  58. data/test/dummy/config/initializers/inflections.rb +0 -16
  59. data/test/dummy/config/initializers/mime_types.rb +0 -5
  60. data/test/dummy/config/initializers/session_store.rb +0 -3
  61. data/test/dummy/config/initializers/wrap_parameters.rb +0 -14
  62. data/test/dummy/config/locales/en.yml +0 -23
  63. data/test/dummy/config/routes.rb +0 -4
  64. data/test/dummy/config/secrets.yml +0 -20
  65. data/test/dummy/config.ru +0 -4
  66. data/test/dummy/lib/assets/.keep +0 -0
  67. data/test/dummy/log/.keep +0 -0
  68. data/test/dummy/public/404.html +0 -67
  69. data/test/dummy/public/422.html +0 -67
  70. data/test/dummy/public/500.html +0 -66
  71. data/test/dummy/public/favicon.ico +0 -0
  72. data/test/helpers/md_simple_editor/md_preview_helper_test.rb +0 -6
  73. data/test/integration/navigation_test.rb +0 -10
  74. data/test/test_helper.rb +0 -15
@@ -0,0 +1,7 @@
1
+ class MdSimpleEditorController < ApplicationController
2
+ def preview
3
+ options = {autolink: true, tables: true, hard_wrap: true, no_intra_emphasis: true, fenced_code:true, gh_blockcode: true}
4
+ html = Redcarpet::Markdown.new(Redcarpet::Render::HTML, options).render(params['md']).html_safe
5
+ render html: html
6
+ end
7
+ end
@@ -3,67 +3,77 @@ module MdSimpleEditor
3
3
  module MdHelper
4
4
  def md_simple_editor
5
5
  content_tag(:div, :id => "md-editor") do
6
- content_tag(:div, :id => "md-toolbar") do
7
- content_tag(:div, :id => "btn-group") do
8
- button_tag(:type => 'button', :class => "btn btn-default md_h1", :style => "font-size: 15px") do
6
+ content_tag(:div, :class => "btn-toolbar", role: "toolbar") do
7
+ content_tag(:div, :class => "btn-group") do
8
+ button_tag(:type => 'button', :class => "btn btn-default md_h1") do
9
9
  content_tag(:strong, 'H1')
10
10
  end +
11
- button_tag(:type => 'button', :class => "btn btn-default md_h2", :style => "font-size: 13px") do
11
+ button_tag(:type => 'button', :class => "btn btn-default md_h2") do
12
12
  content_tag(:strong, 'H2')
13
13
  end +
14
- button_tag(:type => 'button', :class => "btn btn-default md_h3", :style => "font-size: 11px") do
14
+ button_tag(:type => 'button', :class => "btn btn-default md_h3") do
15
15
  content_tag(:strong, 'H3')
16
16
  end +
17
- button_tag(:type => 'button', :class => "btn btn-default md_h4", :style => "font-size: 9px") do
17
+ button_tag(:type => 'button', :class => "btn btn-default md_h4") do
18
18
  content_tag(:strong, 'H4')
19
19
  end +
20
- button_tag(:type => 'button', :class => "btn btn-default md_h5", :style => "font-size: 7px") do
20
+ button_tag(:type => 'button', :class => "btn btn-default md_h5") do
21
21
  content_tag(:strong, 'H5')
22
22
  end
23
23
  end +
24
- content_tag(:div, :id => "btn-group") do
25
- button_tag(:type => 'button', :class => "btn btn-default md_italic", :style => "font-size: 11px") do
24
+ content_tag(:div, :class => "btn-group") do
25
+ button_tag(:type => 'button', :class => "btn btn-default md_italic") do
26
26
  fa_icon "italic"
27
27
  end +
28
- button_tag(:type => 'button', :class => "btn btn-default md_bold", :style => "font-size: 11px") do
28
+ button_tag(:type => 'button', :class => "btn btn-default md_bold") do
29
29
  fa_icon "bold"
30
30
  end +
31
- button_tag(:type => 'button', :class => "btn btn-default md_list-ul", :style => "font-size: 11px") do
31
+ button_tag(:type => 'button', :class => "btn btn-default md_list-ul") do
32
32
  fa_icon "list-ul"
33
33
  end +
34
- button_tag(:type => 'button', :class => "btn btn-default md_list-ol", :style => "font-size: 11px") do
34
+ button_tag(:type => 'button', :class => "btn btn-default md_list-ol") do
35
35
  fa_icon "list-ol"
36
36
  end +
37
- button_tag(:type => 'button', :class => "btn btn-default md_indent", :style => "font-size: 11px") do
37
+ button_tag(:type => 'button', :class => "btn btn-default md_indent") do
38
38
  fa_icon "indent"
39
39
  end +
40
- button_tag(:type => 'button', :class => "btn btn-default md_underline", :style => "font-size: 11px") do
40
+ button_tag(:type => 'button', :class => "btn btn-default md_underline") do
41
41
  fa_icon "underline"
42
42
  end +
43
- button_tag(:type => 'button', :class => "btn btn-default md_table", :style => "font-size: 11px") do
43
+ button_tag(:type => 'button', :class => "btn btn-default md_table") do
44
44
  fa_icon "table"
45
45
  end +
46
- button_tag(:type => 'button', :class => "btn btn-default md_square", :style => "font-size: 11px") do
46
+ button_tag(:type => 'button', :class => "btn btn-default md_square") do
47
47
  fa_icon "square"
48
48
  end +
49
- button_tag(:type => 'button', :class => "btn btn-default md_minus", :style => "font-size: 11px") do
49
+ button_tag(:type => 'button', :class => "btn btn-default md_minus") do
50
50
  fa_icon "minus"
51
51
  end
52
52
  end +
53
- content_tag(:div, :id => "btn-group") do
54
- button_tag(:type => 'button', :class => "btn btn-default md_link", :style => "font-size: 11px") do
53
+ content_tag(:div, :class => "btn-group") do
54
+ button_tag(:type => 'button', :class => "btn btn-default md_link") do
55
55
  fa_icon "link"
56
56
  end +
57
- button_tag(:type => 'button', :class => "btn btn-default md_camera-retro", :style => "font-size: 11px") do
57
+ button_tag(:type => 'button', :class => "btn btn-default md_camera-retro") do
58
58
  fa_icon "camera-retro"
59
59
  end
60
+ end +
61
+ content_tag(:div, class: 'btn-group pull-righ') do
62
+ button_tag(:type => 'button', :class => "btn btn-primary preview_md") do
63
+ 'Preview'
64
+ end
60
65
  end
61
66
  end +
67
+ content_tag(:br) +
62
68
  content_tag(:div, :id => "md-text") do
63
69
  yield
64
70
  end +
65
- content_tag(:div, :id => "md-preview") do
66
-
71
+ content_tag(:div, class: 'panel panel-success preview-panel', hidden: true) do
72
+ content_tag(:div, class: 'panel-heading') do
73
+ "Preview"
74
+ end +
75
+ content_tag(:div, :id => "md-preview", class: 'panel-body') do
76
+ end
67
77
  end
68
78
  end
69
79
  end
data/config/routes.rb CHANGED
@@ -1,3 +1,3 @@
1
- MdSimpleEditor::Engine.routes.draw do
2
- get "md_preview/preview"
3
- end
1
+ Rails.application.routes.draw do
2
+ post 'md_simple_editor/preview'
3
+ end
@@ -1,7 +1,6 @@
1
1
  module MdSimpleEditor
2
- # module Rails
2
+ module Rails
3
3
  class Engine < ::Rails::Engine
4
- isolate_namespace MdSimpleEditor
5
4
  end
6
- # end
5
+ end
7
6
  end
@@ -1,4 +1,3 @@
1
1
  module MdSimpleEditor
2
- VERSION = "0.2.3.pre3"
2
+ VERSION = "0.2.3"
3
3
  end
4
-
@@ -1,7 +1,4 @@
1
1
  require "md_simple_editor/version"
2
2
  require "md_simple_editor/engine" if defined?(Rails)
3
3
 
4
- module MdSimpleEditor
5
- end
6
-
7
4
 
@@ -14,12 +14,13 @@ Gem::Specification.new do |spec|
14
14
  spec.license = "MIT"
15
15
 
16
16
  spec.files = `git ls-files`.split($/)
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
17
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
18
19
  spec.require_paths = ["lib"]
19
20
 
20
21
  spec.add_development_dependency "bundler", "~> 1.3"
21
22
  spec.add_development_dependency "rake"
22
- spec.add_dependency "rails"
23
23
 
24
- spec.add_dependency "font-awesome-rails", "~> 4.0.3.1"
24
+ spec.add_runtime_dependency "font-awesome-rails"
25
+ spec.add_runtime_dependency "redcarpet", "~> 3.0"
25
26
  end
metadata CHANGED
@@ -1,71 +1,71 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: md_simple_editor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3.pre3
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ruben Espinosa
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-04 00:00:00.000000000 Z
11
+ date: 2016-10-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.3'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.3'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '>='
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
- name: rails
42
+ name: font-awesome-rails
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - '>='
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - '>='
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
- name: font-awesome-rails
56
+ name: redcarpet
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ~>
59
+ - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: 4.0.3.1
61
+ version: '3.0'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ~>
66
+ - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: 4.0.3.1
68
+ version: '3.0'
69
69
  description: Simple editor for markdown and rails
70
70
  email:
71
71
  - rderoldan1@gmail.com
@@ -73,70 +73,30 @@ executables: []
73
73
  extensions: []
74
74
  extra_rdoc_files: []
75
75
  files:
76
- - .gitignore
76
+ - ".gitignore"
77
+ - ".idea/.rakeTasks"
78
+ - ".idea/encodings.xml"
79
+ - ".idea/md_simple_editor.iml"
80
+ - ".idea/misc.xml"
81
+ - ".idea/modules.xml"
82
+ - ".idea/scopes/scope_settings.xml"
83
+ - ".idea/vcs.xml"
84
+ - ".idea/workspace.xml"
85
+ - CHANGELOG.md
77
86
  - Gemfile
78
87
  - LICENSE
79
88
  - LICENSE.txt
80
89
  - README.md
81
90
  - Rakefile
82
91
  - app/assets/javascripts/md_simple_editor.js.coffee
83
- - app/assets/javascripts/md_simple_editor/md_preview.js
84
92
  - app/assets/stylesheets/md_simple_editor.css.scss
85
- - app/assets/stylesheets/md_simple_editor/md_preview.css
86
- - app/controllers/md_simple_editor/application_controller.rb
87
- - app/controllers/md_simple_editor/md_preview_controller.rb
88
- - app/helpers/md_simple_editor/md_preview_helper.rb
93
+ - app/controllers/md_simple_editor_controller.rb
89
94
  - app/helpers/md_simple_editor/rails/md_helper.rb
90
- - app/views/md_simple_editor/layouts/md_simple_editor/application.html.erb
91
- - app/views/md_simple_editor/md_preview/preview.html.erb
92
95
  - config/routes.rb
93
96
  - lib/md_simple_editor.rb
94
97
  - lib/md_simple_editor/engine.rb
95
98
  - lib/md_simple_editor/version.rb
96
99
  - md_simple_editor.gemspec
97
- - test/blorgh_test.rb
98
- - test/controllers/md_simple_editor/md_preview_controller_test.rb
99
- - test/dummy/README.rdoc
100
- - test/dummy/Rakefile
101
- - test/dummy/app/assets/images/.keep
102
- - test/dummy/app/assets/javascripts/application.js
103
- - test/dummy/app/assets/stylesheets/application.css
104
- - test/dummy/app/controllers/application_controller.rb
105
- - test/dummy/app/controllers/concerns/.keep
106
- - test/dummy/app/helpers/application_helper.rb
107
- - test/dummy/app/mailers/.keep
108
- - test/dummy/app/models/.keep
109
- - test/dummy/app/models/concerns/.keep
110
- - test/dummy/app/views/layouts/application.html.erb
111
- - test/dummy/bin/bundle
112
- - test/dummy/bin/rails
113
- - test/dummy/bin/rake
114
- - test/dummy/config.ru
115
- - test/dummy/config/application.rb
116
- - test/dummy/config/boot.rb
117
- - test/dummy/config/database.yml
118
- - test/dummy/config/environment.rb
119
- - test/dummy/config/environments/development.rb
120
- - test/dummy/config/environments/production.rb
121
- - test/dummy/config/environments/test.rb
122
- - test/dummy/config/initializers/backtrace_silencers.rb
123
- - test/dummy/config/initializers/filter_parameter_logging.rb
124
- - test/dummy/config/initializers/inflections.rb
125
- - test/dummy/config/initializers/mime_types.rb
126
- - test/dummy/config/initializers/session_store.rb
127
- - test/dummy/config/initializers/wrap_parameters.rb
128
- - test/dummy/config/locales/en.yml
129
- - test/dummy/config/routes.rb
130
- - test/dummy/config/secrets.yml
131
- - test/dummy/lib/assets/.keep
132
- - test/dummy/log/.keep
133
- - test/dummy/public/404.html
134
- - test/dummy/public/422.html
135
- - test/dummy/public/500.html
136
- - test/dummy/public/favicon.ico
137
- - test/helpers/md_simple_editor/md_preview_helper_test.rb
138
- - test/integration/navigation_test.rb
139
- - test/test_helper.rb
140
100
  homepage: http://rderoldan1.github.io/md_simple_editor/
141
101
  licenses:
142
102
  - MIT
@@ -147,61 +107,18 @@ require_paths:
147
107
  - lib
148
108
  required_ruby_version: !ruby/object:Gem::Requirement
149
109
  requirements:
150
- - - '>='
110
+ - - ">="
151
111
  - !ruby/object:Gem::Version
152
112
  version: '0'
153
113
  required_rubygems_version: !ruby/object:Gem::Requirement
154
114
  requirements:
155
- - - '>'
115
+ - - ">="
156
116
  - !ruby/object:Gem::Version
157
- version: 1.3.1
117
+ version: '0'
158
118
  requirements: []
159
119
  rubyforge_project:
160
- rubygems_version: 2.2.1
120
+ rubygems_version: 2.6.6
161
121
  signing_key:
162
122
  specification_version: 4
163
123
  summary: Simple editor for markdown and rails
164
- test_files:
165
- - test/blorgh_test.rb
166
- - test/controllers/md_simple_editor/md_preview_controller_test.rb
167
- - test/dummy/README.rdoc
168
- - test/dummy/Rakefile
169
- - test/dummy/app/assets/images/.keep
170
- - test/dummy/app/assets/javascripts/application.js
171
- - test/dummy/app/assets/stylesheets/application.css
172
- - test/dummy/app/controllers/application_controller.rb
173
- - test/dummy/app/controllers/concerns/.keep
174
- - test/dummy/app/helpers/application_helper.rb
175
- - test/dummy/app/mailers/.keep
176
- - test/dummy/app/models/.keep
177
- - test/dummy/app/models/concerns/.keep
178
- - test/dummy/app/views/layouts/application.html.erb
179
- - test/dummy/bin/bundle
180
- - test/dummy/bin/rails
181
- - test/dummy/bin/rake
182
- - test/dummy/config.ru
183
- - test/dummy/config/application.rb
184
- - test/dummy/config/boot.rb
185
- - test/dummy/config/database.yml
186
- - test/dummy/config/environment.rb
187
- - test/dummy/config/environments/development.rb
188
- - test/dummy/config/environments/production.rb
189
- - test/dummy/config/environments/test.rb
190
- - test/dummy/config/initializers/backtrace_silencers.rb
191
- - test/dummy/config/initializers/filter_parameter_logging.rb
192
- - test/dummy/config/initializers/inflections.rb
193
- - test/dummy/config/initializers/mime_types.rb
194
- - test/dummy/config/initializers/session_store.rb
195
- - test/dummy/config/initializers/wrap_parameters.rb
196
- - test/dummy/config/locales/en.yml
197
- - test/dummy/config/routes.rb
198
- - test/dummy/config/secrets.yml
199
- - test/dummy/lib/assets/.keep
200
- - test/dummy/log/.keep
201
- - test/dummy/public/404.html
202
- - test/dummy/public/422.html
203
- - test/dummy/public/500.html
204
- - test/dummy/public/favicon.ico
205
- - test/helpers/md_simple_editor/md_preview_helper_test.rb
206
- - test/integration/navigation_test.rb
207
- - test/test_helper.rb
124
+ test_files: []
@@ -1,2 +0,0 @@
1
- // Place all the behaviors and hooks related to the matching controller here.
2
- // All this logic will automatically be available in application.js.
@@ -1,4 +0,0 @@
1
- /*
2
- Place all the styles related to the matching controller here.
3
- They will automatically be included in application.css.
4
- */
@@ -1,4 +0,0 @@
1
- module MdSimpleEditor
2
- class ApplicationController < ActionController::Base
3
- end
4
- end
@@ -1,8 +0,0 @@
1
- require_dependency "md_simple_editor/application_controller"
2
-
3
- module MdSimpleEditor
4
- class MdPreviewController < ApplicationController
5
- def preview
6
- end
7
- end
8
- end
@@ -1,4 +0,0 @@
1
- module MdSimpleEditor
2
- module MdPreviewHelper
3
- end
4
- end
@@ -1,14 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>Blorgh</title>
5
- <%= stylesheet_link_tag "blorgh/application", media: "all" %>
6
- <%= javascript_include_tag "blorgh/application" %>
7
- <%= csrf_meta_tags %>
8
- </head>
9
- <body>
10
-
11
- <%= yield %>
12
-
13
- </body>
14
- </html>
@@ -1,2 +0,0 @@
1
- <h1>MdPreview#preview</h1>
2
- <p>Find me in app/views/md_simple_editor/md_preview/preview.html.erb</p>