markitup_rails 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (65) hide show
  1. data/.document +5 -0
  2. data/Gemfile +15 -0
  3. data/Gemfile.lock +100 -0
  4. data/LICENSE.txt +30 -0
  5. data/README.rdoc +98 -0
  6. data/Rakefile +53 -0
  7. data/VERSION +1 -0
  8. data/app/assets/images/sets/default/bold.png +0 -0
  9. data/app/assets/images/sets/default/clean.png +0 -0
  10. data/app/assets/images/sets/default/image.png +0 -0
  11. data/app/assets/images/sets/default/italic.png +0 -0
  12. data/app/assets/images/sets/default/link.png +0 -0
  13. data/app/assets/images/sets/default/list-bullet.png +0 -0
  14. data/app/assets/images/sets/default/list-numeric.png +0 -0
  15. data/app/assets/images/sets/default/picture.png +0 -0
  16. data/app/assets/images/sets/default/preview.png +0 -0
  17. data/app/assets/images/sets/default/stroke.png +0 -0
  18. data/app/assets/images/sets/markdown/bold.png +0 -0
  19. data/app/assets/images/sets/markdown/code.png +0 -0
  20. data/app/assets/images/sets/markdown/h1.png +0 -0
  21. data/app/assets/images/sets/markdown/h2.png +0 -0
  22. data/app/assets/images/sets/markdown/h3.png +0 -0
  23. data/app/assets/images/sets/markdown/h4.png +0 -0
  24. data/app/assets/images/sets/markdown/h5.png +0 -0
  25. data/app/assets/images/sets/markdown/h6.png +0 -0
  26. data/app/assets/images/sets/markdown/italic.png +0 -0
  27. data/app/assets/images/sets/markdown/link.png +0 -0
  28. data/app/assets/images/sets/markdown/list-bullet.png +0 -0
  29. data/app/assets/images/sets/markdown/list-numeric.png +0 -0
  30. data/app/assets/images/sets/markdown/picture.png +0 -0
  31. data/app/assets/images/sets/markdown/preview.png +0 -0
  32. data/app/assets/images/sets/markdown/quotes.png +0 -0
  33. data/app/assets/images/skins/markitup/bg-container.png +0 -0
  34. data/app/assets/images/skins/markitup/bg-editor-bbcode.png +0 -0
  35. data/app/assets/images/skins/markitup/bg-editor-dotclear.png +0 -0
  36. data/app/assets/images/skins/markitup/bg-editor-html.png +0 -0
  37. data/app/assets/images/skins/markitup/bg-editor-json.png +0 -0
  38. data/app/assets/images/skins/markitup/bg-editor-markdown.png +0 -0
  39. data/app/assets/images/skins/markitup/bg-editor-textile.png +0 -0
  40. data/app/assets/images/skins/markitup/bg-editor-wiki.png +0 -0
  41. data/app/assets/images/skins/markitup/bg-editor-xml.png +0 -0
  42. data/app/assets/images/skins/markitup/bg-editor.png +0 -0
  43. data/app/assets/images/skins/markitup/handle.png +0 -0
  44. data/app/assets/images/skins/markitup/menu.png +0 -0
  45. data/app/assets/images/skins/markitup/submenu.png +0 -0
  46. data/app/assets/images/skins/simple/handle.png +0 -0
  47. data/app/assets/images/skins/simple/menu.png +0 -0
  48. data/app/assets/images/skins/simple/submenu.png +0 -0
  49. data/app/assets/javascripts/jquery.markitup.js +593 -0
  50. data/app/assets/javascripts/sets/default/set.js +30 -0
  51. data/app/assets/javascripts/sets/markdown/set.js +48 -0
  52. data/app/assets/stylesheets/sets/default/style.css +34 -0
  53. data/app/assets/stylesheets/sets/markdown/style.css +54 -0
  54. data/app/assets/stylesheets/skins/markitup/style.css.scss +152 -0
  55. data/app/assets/stylesheets/skins/simple/style.css.scss +122 -0
  56. data/app/assets/stylesheets/templates/preview.css +5 -0
  57. data/app/controllers/markitup/parsers_controller.rb +6 -0
  58. data/app/views/markitup/parsers/markdown.html.erb +11 -0
  59. data/config/routes.rb +5 -0
  60. data/lib/engine.rb +8 -0
  61. data/lib/markitup_rails.rb +15 -0
  62. data/markitup_rails.gemspec +118 -0
  63. data/test/helper.rb +18 -0
  64. data/test/test_markitup_rails.rb +7 -0
  65. metadata +219 -0
data/.document ADDED
@@ -0,0 +1,5 @@
1
+ lib/**/*.rb
2
+ bin/*
3
+ -
4
+ features/**/*.feature
5
+ LICENSE.txt
data/Gemfile ADDED
@@ -0,0 +1,15 @@
1
+ source "http://rubygems.org"
2
+ # Add dependencies required to use your gem here.
3
+ # Example:
4
+ # gem "activesupport", ">= 2.3.5"
5
+
6
+ # Add dependencies to develop your gem here.
7
+ # Include everything needed to run rake, tests, features, etc.
8
+ group :development do
9
+ gem "shoulda", ">= 0"
10
+ gem "bundler", "~> 1.0.0"
11
+ gem "jeweler", "~> 1.6.4"
12
+ gem "rcov", ">= 0"
13
+ end
14
+ gem "rails", "~> 3.1"
15
+ gem "bluecloth"
data/Gemfile.lock ADDED
@@ -0,0 +1,100 @@
1
+ GEM
2
+ remote: http://rubygems.org/
3
+ specs:
4
+ actionmailer (3.1.3)
5
+ actionpack (= 3.1.3)
6
+ mail (~> 2.3.0)
7
+ actionpack (3.1.3)
8
+ activemodel (= 3.1.3)
9
+ activesupport (= 3.1.3)
10
+ builder (~> 3.0.0)
11
+ erubis (~> 2.7.0)
12
+ i18n (~> 0.6)
13
+ rack (~> 1.3.5)
14
+ rack-cache (~> 1.1)
15
+ rack-mount (~> 0.8.2)
16
+ rack-test (~> 0.6.1)
17
+ sprockets (~> 2.0.3)
18
+ activemodel (3.1.3)
19
+ activesupport (= 3.1.3)
20
+ builder (~> 3.0.0)
21
+ i18n (~> 0.6)
22
+ activerecord (3.1.3)
23
+ activemodel (= 3.1.3)
24
+ activesupport (= 3.1.3)
25
+ arel (~> 2.2.1)
26
+ tzinfo (~> 0.3.29)
27
+ activeresource (3.1.3)
28
+ activemodel (= 3.1.3)
29
+ activesupport (= 3.1.3)
30
+ activesupport (3.1.3)
31
+ multi_json (~> 1.0)
32
+ arel (2.2.1)
33
+ bluecloth (2.2.0)
34
+ builder (3.0.0)
35
+ erubis (2.7.0)
36
+ git (1.2.5)
37
+ hike (1.2.1)
38
+ i18n (0.6.0)
39
+ jeweler (1.6.4)
40
+ bundler (~> 1.0)
41
+ git (>= 1.2.5)
42
+ rake
43
+ json (1.6.3)
44
+ mail (2.3.0)
45
+ i18n (>= 0.4.0)
46
+ mime-types (~> 1.16)
47
+ treetop (~> 1.4.8)
48
+ mime-types (1.17.2)
49
+ multi_json (1.0.4)
50
+ polyglot (0.3.3)
51
+ rack (1.3.5)
52
+ rack-cache (1.1)
53
+ rack (>= 0.4)
54
+ rack-mount (0.8.3)
55
+ rack (>= 1.0.0)
56
+ rack-ssl (1.3.2)
57
+ rack
58
+ rack-test (0.6.1)
59
+ rack (>= 1.0)
60
+ rails (3.1.3)
61
+ actionmailer (= 3.1.3)
62
+ actionpack (= 3.1.3)
63
+ activerecord (= 3.1.3)
64
+ activeresource (= 3.1.3)
65
+ activesupport (= 3.1.3)
66
+ bundler (~> 1.0)
67
+ railties (= 3.1.3)
68
+ railties (3.1.3)
69
+ actionpack (= 3.1.3)
70
+ activesupport (= 3.1.3)
71
+ rack-ssl (~> 1.3.2)
72
+ rake (>= 0.8.7)
73
+ rdoc (~> 3.4)
74
+ thor (~> 0.14.6)
75
+ rake (0.9.2.2)
76
+ rcov (0.9.11)
77
+ rdoc (3.11)
78
+ json (~> 1.4)
79
+ shoulda (2.11.3)
80
+ sprockets (2.0.3)
81
+ hike (~> 1.2)
82
+ rack (~> 1.0)
83
+ tilt (~> 1.1, != 1.3.0)
84
+ thor (0.14.6)
85
+ tilt (1.3.3)
86
+ treetop (1.4.10)
87
+ polyglot
88
+ polyglot (>= 0.3.1)
89
+ tzinfo (0.3.31)
90
+
91
+ PLATFORMS
92
+ ruby
93
+
94
+ DEPENDENCIES
95
+ bluecloth
96
+ bundler (~> 1.0.0)
97
+ jeweler (~> 1.6.4)
98
+ rails (~> 3.1)
99
+ rcov
100
+ shoulda
data/LICENSE.txt ADDED
@@ -0,0 +1,30 @@
1
+ ----------------------------------------------------------------------------
2
+ markItUp! Universal MarkUp Engine, JQuery plugin
3
+ v 1.1.x
4
+ Dual licensed under the MIT and GPL licenses.
5
+ ----------------------------------------------------------------------------
6
+ Copyright (C) 2007-2011 Jay Salvat
7
+ http:markitup.jaysalvat.com/
8
+
9
+ markitup_rails
10
+ Copyright (C) 2011 Jeff Wigal
11
+ http://dropkickstudios.com
12
+
13
+ Permission is hereby granted, free of charge, to any person obtaining
14
+ a copy of this software and associated documentation files (the
15
+ "Software"), to deal in the Software without restriction, including
16
+ without limitation the rights to use, copy, modify, merge, publish,
17
+ distribute, sublicense, and/or sell copies of the Software, and to
18
+ permit persons to whom the Software is furnished to do so, subject to
19
+ the following conditions:
20
+
21
+ The above copyright notice and this permission notice shall be
22
+ included in all copies or substantial portions of the Software.
23
+
24
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
25
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
26
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
27
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
28
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
29
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
30
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.rdoc ADDED
@@ -0,0 +1,98 @@
1
+ = markitup_rails
2
+
3
+ Markitup_rails is a Rails 3.1 engine that allows you to integrate the {MarkItUp}[http://markitup.jaysalvat.com/home/] text editor into the asset pipeline.
4
+
5
+ This uses the 1.1.12 release of Markitup, by {Jay Salvat}[http://jaysalvat.com]
6
+
7
+ This engine allows you to add in the CSS and Javascript as written in the MarkItUp plugin. I would strongly recommend that you read the documentation tha comes with MarkItUp.
8
+
9
+ This engine includes the following MarkItUp elements:
10
+
11
+ * MarkItUp images and stylesheets
12
+ * MarkItUp javascript
13
+ * a MarkItUp set for Markdown
14
+
15
+ MarkItUp support a variety of markup parsers, however, this plugin only includes support for Markdown and HTML.
16
+ Pull requests are welcome!
17
+
18
+ = Usage
19
+
20
+ Add the markitup_rails gem to your Gemfile. In Gemfile:
21
+
22
+ gem "markitup_rails"
23
+
24
+ == Markdown
25
+
26
+ /* app/assets/stylesheets/application.css */
27
+ /* the following directives will include the markitup CSS */
28
+ /* the skins/markitup CSS will define how the text area will look */
29
+ /* the sets/markdown CSS defines the markdown-specific buttons */
30
+
31
+ /*
32
+ *= require skins/markitup/style.css
33
+ *= require sets/markdown/style.css
34
+ */
35
+
36
+ // in app/assets/javascripts/application.js
37
+
38
+ // include the main MarkItUp javascript
39
+ //= require jquery.markitup
40
+
41
+ // include a set, which defines the javascript rules for the particular parser. Markdown is included with this:
42
+ // The sets/markdown/set.js file will define a Javascript variable called "myMarkdownSettings".
43
+ //= require ./sets/markdown/set.js
44
+
45
+ $(document).ready(function(){
46
+ $("textarea").markItUp(myMarkdownSettings);
47
+ });
48
+
49
+ == HTML
50
+
51
+ /* app/assets/stylesheets/application.css */
52
+ /* the following directives will include the markitup CSS */
53
+ /* the skins/markitup CSS will define how the text area will look */
54
+ /* the sets/markdown CSS defines the markdown-specific buttons */
55
+
56
+ /*
57
+ *= require skins/markitup/style.css
58
+ *= require sets/default/style.css
59
+ */
60
+
61
+ // in app/assets/javascripts/application.js
62
+
63
+ // include the main MarkItUp javascript
64
+ //= require jquery.markitup
65
+
66
+ // include a set, which defines the javascript rules for the particular parser.
67
+ // The sets/default/set.js file will define a Javascript variable called "mySettings".
68
+ //= require ./sets/default/set.js
69
+
70
+ $(document).ready(function(){
71
+ $("textarea").markItUp(mySettings);
72
+ });
73
+
74
+
75
+ The engine also comes with a simple controller that MarkItUp can send text to your application, and return a response parsed with BlueCloth, and render a preview using Ajax.
76
+
77
+ == Contributing to markitup_rails
78
+
79
+ * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
80
+ * Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
81
+ * Fork the project
82
+ * Start a feature/bugfix branch
83
+ * Commit and push until you are happy with your contribution
84
+ * Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
85
+ * Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
86
+
87
+
88
+ == License
89
+
90
+ Dual licensed under the MIT and GPL licenses.
91
+
92
+ markItUp! Universal MarkUp Engine, JQuery plugin
93
+ v 1.1.x
94
+ Copyright (C) 2007-2011 Jay Salvat http:markitup.jaysalvat.com/
95
+
96
+ markitup_rails
97
+ Copyright (C) 2011 Jeff Wigal
98
+ http://dropkickstudios.com
data/Rakefile ADDED
@@ -0,0 +1,53 @@
1
+ # encoding: utf-8
2
+
3
+ require 'rubygems'
4
+ require 'bundler'
5
+ begin
6
+ Bundler.setup(:default, :development)
7
+ rescue Bundler::BundlerError => e
8
+ $stderr.puts e.message
9
+ $stderr.puts "Run `bundle install` to install missing gems"
10
+ exit e.status_code
11
+ end
12
+ require 'rake'
13
+
14
+ require 'jeweler'
15
+ Jeweler::Tasks.new do |gem|
16
+ # gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
17
+ gem.name = "markitup_rails"
18
+ gem.homepage = "http://github.com/jwigal/markitup_rails"
19
+ gem.license = "MIT"
20
+ gem.summary = %Q{Rails 3.1 engine that allows you to integrate the markItUp editor into the asset pipeline}
21
+ gem.description = %Q{Rails 3.1 engine that allows you to integrate the markItUp editor into the asset pipeline}
22
+ gem.email = "jeff@assignr.com"
23
+ gem.authors = ["Jeff Wigal"]
24
+ # dependencies defined in Gemfile
25
+ end
26
+ Jeweler::RubygemsDotOrgTasks.new
27
+
28
+ require 'rake/testtask'
29
+ Rake::TestTask.new(:test) do |test|
30
+ test.libs << 'lib' << 'test'
31
+ test.pattern = 'test/**/test_*.rb'
32
+ test.verbose = true
33
+ end
34
+
35
+ require 'rcov/rcovtask'
36
+ Rcov::RcovTask.new do |test|
37
+ test.libs << 'test'
38
+ test.pattern = 'test/**/test_*.rb'
39
+ test.verbose = true
40
+ test.rcov_opts << '--exclude "gems/*"'
41
+ end
42
+
43
+ task :default => :test
44
+
45
+ require 'rake/rdoctask'
46
+ Rake::RDocTask.new do |rdoc|
47
+ version = File.exist?('VERSION') ? File.read('VERSION') : ""
48
+
49
+ rdoc.rdoc_dir = 'rdoc'
50
+ rdoc.title = "markitup_rails #{version}"
51
+ rdoc.rdoc_files.include('README*')
52
+ rdoc.rdoc_files.include('lib/**/*.rb')
53
+ end
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.1.0