textile_extension_pack 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/MIT-LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright 2012 YOURNAME
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.textile ADDED
@@ -0,0 +1,3 @@
1
+ h1. textile_extension_pack
2
+
3
+ Extends textile with some custom tags.
data/Rakefile ADDED
File without changes
@@ -0,0 +1,30 @@
1
+ module TextileExtensionPack
2
+ module Tags
3
+
4
+ def icon(opts)
5
+ img, text, url = opts[:text].split('|').map! { |str| str.strip }
6
+ html = %Q{<figure>\n}
7
+ html << %Q{<div class="image-wrapper #{opts[:class]}">\n}
8
+ html << %Q{<div class="image-wrapper-inner">\n}
9
+ html << %Q{<div class="image-wrapper-inner-inner">\n}
10
+ html << %Q{ <a href="#{url}" title="#{text}">} if url.present?
11
+ html << %Q{ <img src="#{img}" alt="#{text}" />}
12
+ html << %Q{ </a>\n} if url.present?
13
+ html << %Q{</div>\n}
14
+ html << %Q{</div>\n}
15
+ html << %Q{</div>\n}
16
+ html << %Q{ <figcaption>#{text}</figcaption>\n} if text.present?
17
+ html << %Q{</figure>\n}
18
+ end
19
+ end
20
+
21
+ module RegularExpressions
22
+ def tags(text)
23
+ text.gsub!(/cleaner./, '<hr class="cleaner" />')
24
+ text.gsub!(/columnstart./, '<div class="column">')
25
+ text.gsub!(/columnend./, '</div>')
26
+ text.gsub!(/decolumnize./, '</div>')
27
+ text.gsub!(/columnize./, '<div class="columnized">')
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,3 @@
1
+ require 'textile_extension_pack'
2
+ RedCloth.send(:include, TextileExtensionPack::RegularExpressions)
3
+ RedCloth::Formatters::HTML.send(:include, TextileExtensionPack::Tags)
metadata ADDED
@@ -0,0 +1,61 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: textile_extension_pack
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Patrik Jíra
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-03-11 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: RedCloth
16
+ requirement: &4183440 !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: *4183440
25
+ description: Extends textile with some custom tags like images with colorbox support
26
+ or google maps.
27
+ email: patrikjira@gmail.com
28
+ executables: []
29
+ extensions: []
30
+ extra_rdoc_files: []
31
+ files:
32
+ - lib/textile_extension_pack/tags.rb
33
+ - lib/textile_extension_pack.rb
34
+ - MIT-LICENSE
35
+ - Rakefile
36
+ - README.textile
37
+ homepage: http://github.com/papricek/textile_extension_pack
38
+ licenses: []
39
+ post_install_message:
40
+ rdoc_options: []
41
+ require_paths:
42
+ - lib
43
+ required_ruby_version: !ruby/object:Gem::Requirement
44
+ none: false
45
+ requirements:
46
+ - - ! '>='
47
+ - !ruby/object:Gem::Version
48
+ version: '0'
49
+ required_rubygems_version: !ruby/object:Gem::Requirement
50
+ none: false
51
+ requirements:
52
+ - - ! '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ requirements: []
56
+ rubyforge_project:
57
+ rubygems_version: 1.8.5
58
+ signing_key:
59
+ specification_version: 3
60
+ summary: Textile extension pack
61
+ test_files: []