-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
68 lines (50 loc) · 2.43 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
RedCloth Extensions
===================
Rails plugin with various RedCloth extensions:
- new 'textilize' method for the String class
- [:no_span_caps] option has been made the default
- always add cellspacing="0" html attribute to the opening <table> tags
- custom 'picture.' and 'video.' extensions to the textile syntax
- new custom RedCloth HTML formatter for the Polish language (activated when I18n.locale is set to 'pl' or with the :lang option) with the following differences from the default HTML formatter:
* double low-9 opening quote: "\"I am.\", said Paul".textilize => "<p>„I am.”, said Paul</p>"
Requires RedCloth version 4.0+
Installation
============
git submodule add git://github.com/pjg/redcloth_extensions.git vendor/plugins/redcloth_extensions
git commit -m "Add redcloth_extensions plugin as a submodule"
Examples
========
String.textilize method
-----------------------
>> "My name is Paul".textilize
=> "<p>My name is Paul</p>"
Custom 'picture.' textile tag
-----------------------------
picture(class). src|alt|caption?|link
class - class for the outer <div> element
src - <img> src attribute
alt - <img> alt attribute (acts also as a caption)
caption? - whether to include <p class="caption"> element below the picture (true|false)
link - image link
>> "picture(alignright). /pictures/example.jpg|Some great description|true|http://example.org".textilize
=> <div class="alignright">
<p><a href="http://example.org"><img src="/pictures/example.jpg" alt="Some great description" /></a></p>
<p class="caption">Some great description</p>
</div>
Custom 'video.' textile tag
---------------------------
video. src|size
src - path to the video
size - size of the video (450x300, for example)
>> "video. /videos/example.flv|400x300".textilize
=> <div class="video">
<object type="application/x-shockwave-flash" width="400" height="300" data="/videos/player.swf?file=/videos/example.flv">
<param name="movie" value="/videos/player.swf?file=/videos/example.flv" />
<param name="allowFullScreen" value="true" />
</object>
</div>
Choosing the HTML formatter
---------------------------
"I am.".textilize(:lang => 'pl')
=> Will textilize using the Polish language HTML formatter. When you omit the :lang param, it will automatically choose the Polish language HTML formatter when the I18n.locale is set to 'pl'.
Copyright (c) 2008-2010 Paweł Gościcki, released under the MIT license