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.
- checksums.yaml +4 -4
- data/.gitignore +0 -7
- data/.idea/.rakeTasks +7 -0
- data/.idea/encodings.xml +5 -0
- data/.idea/md_simple_editor.iml +23 -0
- data/.idea/misc.xml +36 -0
- data/.idea/modules.xml +9 -0
- data/.idea/scopes/scope_settings.xml +5 -0
- data/.idea/vcs.xml +7 -0
- data/.idea/workspace.xml +56 -0
- data/CHANGELOG.md +41 -0
- data/Gemfile +1 -3
- data/README.md +9 -4
- data/Rakefile +0 -16
- data/app/assets/javascripts/md_simple_editor.js.coffee +61 -41
- data/app/assets/stylesheets/md_simple_editor.css.scss +5 -66
- data/app/controllers/md_simple_editor_controller.rb +7 -0
- data/app/helpers/md_simple_editor/rails/md_helper.rb +32 -22
- data/config/routes.rb +3 -3
- data/lib/md_simple_editor/engine.rb +2 -3
- data/lib/md_simple_editor/version.rb +1 -2
- data/lib/md_simple_editor.rb +0 -3
- data/md_simple_editor.gemspec +3 -2
- metadata +30 -113
- data/app/assets/javascripts/md_simple_editor/md_preview.js +0 -2
- data/app/assets/stylesheets/md_simple_editor/md_preview.css +0 -4
- data/app/controllers/md_simple_editor/application_controller.rb +0 -4
- data/app/controllers/md_simple_editor/md_preview_controller.rb +0 -8
- data/app/helpers/md_simple_editor/md_preview_helper.rb +0 -4
- data/app/views/md_simple_editor/layouts/md_simple_editor/application.html.erb +0 -14
- data/app/views/md_simple_editor/md_preview/preview.html.erb +0 -2
- data/test/blorgh_test.rb +0 -7
- data/test/controllers/md_simple_editor/md_preview_controller_test.rb +0 -11
- data/test/dummy/README.rdoc +0 -28
- data/test/dummy/Rakefile +0 -6
- data/test/dummy/app/assets/images/.keep +0 -0
- data/test/dummy/app/assets/javascripts/application.js +0 -13
- data/test/dummy/app/assets/stylesheets/application.css +0 -15
- data/test/dummy/app/controllers/application_controller.rb +0 -5
- data/test/dummy/app/controllers/concerns/.keep +0 -0
- data/test/dummy/app/helpers/application_helper.rb +0 -2
- data/test/dummy/app/mailers/.keep +0 -0
- data/test/dummy/app/models/.keep +0 -0
- data/test/dummy/app/models/concerns/.keep +0 -0
- data/test/dummy/app/views/layouts/application.html.erb +0 -14
- data/test/dummy/bin/bundle +0 -3
- data/test/dummy/bin/rails +0 -4
- data/test/dummy/bin/rake +0 -4
- data/test/dummy/config/application.rb +0 -23
- data/test/dummy/config/boot.rb +0 -5
- data/test/dummy/config/database.yml +0 -25
- data/test/dummy/config/environment.rb +0 -5
- data/test/dummy/config/environments/development.rb +0 -29
- data/test/dummy/config/environments/production.rb +0 -80
- data/test/dummy/config/environments/test.rb +0 -36
- data/test/dummy/config/initializers/backtrace_silencers.rb +0 -7
- data/test/dummy/config/initializers/filter_parameter_logging.rb +0 -4
- data/test/dummy/config/initializers/inflections.rb +0 -16
- data/test/dummy/config/initializers/mime_types.rb +0 -5
- data/test/dummy/config/initializers/session_store.rb +0 -3
- data/test/dummy/config/initializers/wrap_parameters.rb +0 -14
- data/test/dummy/config/locales/en.yml +0 -23
- data/test/dummy/config/routes.rb +0 -4
- data/test/dummy/config/secrets.yml +0 -20
- data/test/dummy/config.ru +0 -4
- data/test/dummy/lib/assets/.keep +0 -0
- data/test/dummy/log/.keep +0 -0
- data/test/dummy/public/404.html +0 -67
- data/test/dummy/public/422.html +0 -67
- data/test/dummy/public/500.html +0 -66
- data/test/dummy/public/favicon.ico +0 -0
- data/test/helpers/md_simple_editor/md_preview_helper_test.rb +0 -6
- data/test/integration/navigation_test.rb +0 -10
- 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, :
|
7
|
-
content_tag(:div, :
|
8
|
-
button_tag(:type => 'button', :class => "btn btn-default md_h1"
|
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"
|
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"
|
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"
|
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"
|
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, :
|
25
|
-
button_tag(:type => 'button', :class => "btn btn-default md_italic"
|
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"
|
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"
|
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"
|
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"
|
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"
|
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"
|
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"
|
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"
|
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, :
|
54
|
-
button_tag(:type => 'button', :class => "btn btn-default md_link"
|
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"
|
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, :
|
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
|
-
|
2
|
-
|
3
|
-
end
|
1
|
+
Rails.application.routes.draw do
|
2
|
+
post 'md_simple_editor/preview'
|
3
|
+
end
|
data/lib/md_simple_editor.rb
CHANGED
data/md_simple_editor.gemspec
CHANGED
@@ -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.
|
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
|
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:
|
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:
|
56
|
+
name: redcarpet
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - ~>
|
59
|
+
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
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:
|
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/
|
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:
|
117
|
+
version: '0'
|
158
118
|
requirements: []
|
159
119
|
rubyforge_project:
|
160
|
-
rubygems_version: 2.
|
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,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>
|