RedCloth 3.0.3 → 3.0.4
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of RedCloth might be problematic. Click here for more details.
- data/bin/redcloth +1 -1
- data/doc/CHANGELOG +160 -0
- data/doc/COPYING +25 -0
- data/doc/README +106 -0
- data/doc/REFERENCE +216 -0
- data/doc/make.rb +359 -0
- data/lib/redcloth.rb +77 -60
- data/run-tests.rb +3 -1
- data/setup.rb +1376 -0
- data/tests/hard_breaks.yml +26 -0
- data/tests/table.yml +4 -4
- data/tests/textism.yml +9 -0
- metadata +19 -11
data/bin/redcloth
CHANGED
data/doc/CHANGELOG
ADDED
@@ -0,0 +1,160 @@
|
|
1
|
+
--- %YAML:1.0
|
2
|
+
- version: 3.0.4
|
3
|
+
date: 2005-02-18
|
4
|
+
changes:
|
5
|
+
- The caps class doesn't swallow spaces.
|
6
|
+
- Horizontal rules required to be on an empty line.
|
7
|
+
- Hard breaks don't screw with Markdown headers any longer.
|
8
|
+
- Fixed error triggered by complex lists.
|
9
|
+
- Inline markups need to be butted up against enclosing text, no spaces.
|
10
|
+
- Fixed problem with intermingled single and double quotes.
|
11
|
+
- Brought back lite_mode.
|
12
|
+
|
13
|
+
- version: 3.0.3
|
14
|
+
date: 2005-02-06
|
15
|
+
changes:
|
16
|
+
- Stack overflow regexp on code inlines obliterated.
|
17
|
+
- Citations scaled back.
|
18
|
+
- Toggle span tags on CAPS with :no_span_tags accessor.
|
19
|
+
|
20
|
+
- version: 3.0.2
|
21
|
+
date: 2005-02-02
|
22
|
+
changes:
|
23
|
+
- Stack overflow Regexps replaced.
|
24
|
+
- All code blocks protected from formatting.
|
25
|
+
- Hard breaks working.
|
26
|
+
- Filter HTML now uses detailed cleaner.
|
27
|
+
|
28
|
+
- version: 3.0.1
|
29
|
+
date: 2004-11-15
|
30
|
+
changes:
|
31
|
+
- Using `float' rather than `text-align' to align image blocks.
|
32
|
+
- Shelving more HTML attributes to prevent them from clashing with Textile glyphs.
|
33
|
+
- Simplifying the block regexp.
|
34
|
+
|
35
|
+
- version: 3.0
|
36
|
+
date: 2004-10-26
|
37
|
+
changes:
|
38
|
+
- Broke up the Textile engine into smaller parts, recoded central block parser.
|
39
|
+
- Added preliminary support for Markdown.
|
40
|
+
- Added support for custom Textile prefixes.
|
41
|
+
- RedCloth now generates XHTML fragments.
|
42
|
+
- Complete HTML documents should now work, RedCloth ignores complex HTML.
|
43
|
+
|
44
|
+
- version: 2.0.12
|
45
|
+
date: 2004-08-09
|
46
|
+
changes:
|
47
|
+
- Escaping tighter for <pre> tags that share a single line.
|
48
|
+
- No more String#htmlesc!. Moved to RedCloth#htmlesc.
|
49
|
+
- Pruned out the code that was handling multibyte.
|
50
|
+
|
51
|
+
- version: 2.0.11
|
52
|
+
date: 2004-06-01
|
53
|
+
changes:
|
54
|
+
- Fixed the new 2.0-style aliased links.
|
55
|
+
- Lines starting with div opening or closing tags aren't given paragraph tags.
|
56
|
+
- Escaped some sample markup that was being translated by RDoc.
|
57
|
+
- Subtle changes to the quick tags to help them interact with surrounding HTML better.
|
58
|
+
- Ensure angle brackets inside code quick tags get escaped.
|
59
|
+
- New patch and test by F. Ros to fix <pre> tags with class settings.
|
60
|
+
- Commented out encode_entities and fix_entities, they do nothing now. Thanks, Denis.
|
61
|
+
- Scaled back QTAGS a back to avoid mixing up hyphens and dels. Thanks, Denis.
|
62
|
+
- Work on the references to ensure they are generating at least XHTML 1.0 Transitional.
|
63
|
+
|
64
|
+
- version: 2.0.10
|
65
|
+
date: 2004-05-26
|
66
|
+
changes:
|
67
|
+
- Table and list problems. Rewrote the <pre> handling code.. again.
|
68
|
+
|
69
|
+
- version: 2.0.9
|
70
|
+
date: 2004-05-26
|
71
|
+
changes:
|
72
|
+
- Improved RDoc. Ri documentation is auto-installed now!
|
73
|
+
- Links were consuming closing HTML tags. (See latest test in tests/links.yml.)
|
74
|
+
- Further speed patch from Denis. Good good.
|
75
|
+
- Patch by F. Ros to fix <pre> tags with class settings.
|
76
|
+
|
77
|
+
- version: 2.0.8
|
78
|
+
date: 2004-05-22
|
79
|
+
changes:
|
80
|
+
- First scan of the glyphs() method only scans for pre|notextile|code, the
|
81
|
+
deeper passes scan for all HTML. Now inlines work around HTML tags!
|
82
|
+
(What a pain!)
|
83
|
+
- Moved tables and blocks into glyphs to keep them shielded from the parser
|
84
|
+
if they are in <pre> tags.
|
85
|
+
- Patch by Denis Mertz to speed up RedCloth by compiling the various RegExps
|
86
|
+
only once. Thanks, David!
|
87
|
+
|
88
|
+
- version: 2.0.7
|
89
|
+
date: 2004-04-21
|
90
|
+
changes:
|
91
|
+
- New REFERENCE and QUICK-REFERENCE. See http://hobix.com/textile/.
|
92
|
+
- Lists rewritten to accomplish better line folding.
|
93
|
+
- Better, greedier links.
|
94
|
+
- Additional link and list tests.
|
95
|
+
|
96
|
+
- version: 2.0.6
|
97
|
+
date: 2004-04-16
|
98
|
+
changes:
|
99
|
+
- Bold and strong tags were mixed up. '*' is now strong. '**' is bold.
|
100
|
+
They were swapped until now.
|
101
|
+
- Horizontal alignments were pretty buggy. Combining alignments with
|
102
|
+
indents was totally broken.
|
103
|
+
- Fixed table problem. Now glyphs are handled between tables and blocks.
|
104
|
+
- Nested <pre> and <code> tags are now escaped. Much better handling of
|
105
|
+
HTML inside <pre> tags. Really: quite nice.
|
106
|
+
- Patch from Florian Gross to fix an html filtration inconsistency.
|
107
|
+
|
108
|
+
- version: 2.0.5
|
109
|
+
date: 2004-04-14
|
110
|
+
changes:
|
111
|
+
- Added safe mode (patch courtesy of Florian Gross).
|
112
|
+
- Added line folding (suggested by Jim Menard).
|
113
|
+
- Fixing notextile tags to work multi-line.
|
114
|
+
- Ambiguity with em-dash and block opener.
|
115
|
+
- Footnote bug. (Thanks, Jim Menard!)
|
116
|
+
|
117
|
+
- version: 2.0.4
|
118
|
+
date: 2004-04-08
|
119
|
+
changes:
|
120
|
+
- Scaled back aggresiveness of the inline matching to aid the em-dash.
|
121
|
+
- Scaled back footnotes to stay out of array indices.
|
122
|
+
|
123
|
+
- version: 2.0.3
|
124
|
+
date: 2004-04-02
|
125
|
+
changes:
|
126
|
+
- Handling of pre, code, notextile was all wrong. Also, got rid of the goofed up
|
127
|
+
split then collect. Now using gsub! and recursion to handle inlines and glyphs.
|
128
|
+
- Better acronym support.
|
129
|
+
- Suppression of Regexp warnings.
|
130
|
+
- Single- and double-quoted string wierdness. Thanks, Bret Pettichord.
|
131
|
+
|
132
|
+
- version: 2.0.2
|
133
|
+
date: 2004-03-08
|
134
|
+
changes:
|
135
|
+
- Fixed broken lists, broken tables.
|
136
|
+
- code/pre tags now escape properly, glyphs are working, spans are working when surrounded by html tags.
|
137
|
+
- Fixed classes and ids.
|
138
|
+
- Restricted notextile tags to a single line.
|
139
|
+
|
140
|
+
- version: 2.0.1
|
141
|
+
date: 2004-02-10
|
142
|
+
changes:
|
143
|
+
- Unmatched closing slash on regexps in ruby 1.6.8.
|
144
|
+
- Fixes to bulleted lists.
|
145
|
+
|
146
|
+
- version: 2.0
|
147
|
+
date: 2004-02-06
|
148
|
+
changes:
|
149
|
+
- Complete rewrite of RedCloth, against beta2 from textism.com.
|
150
|
+
|
151
|
+
- version: 0.41
|
152
|
+
date: 2003-06-20
|
153
|
+
changes:
|
154
|
+
- Newlines were outputing as escaped.
|
155
|
+
|
156
|
+
- version: 0.4
|
157
|
+
date: 2003-06-20
|
158
|
+
changes:
|
159
|
+
- Initial public release.
|
160
|
+
- Integration of YAML-based PyTextile tests.
|
data/doc/COPYING
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
Redistribution and use in source and binary forms, with or without
|
2
|
+
modification, are permitted provided that the following conditions are met:
|
3
|
+
|
4
|
+
* Redistributions of source code must retain the above copyright notice,
|
5
|
+
this list of conditions and the following disclaimer.
|
6
|
+
|
7
|
+
* Redistributions in binary form must reproduce the above copyright notice,
|
8
|
+
this list of conditions and the following disclaimer in the documentation
|
9
|
+
and/or other materials provided with the distribution.
|
10
|
+
|
11
|
+
* Neither the name Textile nor the names of its contributors may be used to
|
12
|
+
endorse or promote products derived from this software without specific
|
13
|
+
prior written permission.
|
14
|
+
|
15
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
16
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
17
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
18
|
+
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
19
|
+
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
20
|
+
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
21
|
+
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
22
|
+
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
23
|
+
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
24
|
+
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
25
|
+
POSSIBILITY OF SUCH DAMAGE.
|
data/doc/README
ADDED
@@ -0,0 +1,106 @@
|
|
1
|
+
p=. !redcloth3-title.png!
|
2
|
+
|
3
|
+
<div id="sidebar">
|
4
|
+
|
5
|
+
h4. Get RedCloth 3
|
6
|
+
|
7
|
+
p(example1). *Stable version:* "3.0.3":http://rubyforge.org/frs/download.php/2896/RedCloth-3.0.3.tar.gz
|
8
|
+
|
9
|
+
Take a complete tour of Textile at "A Textile Reference":http://hobix.com/textile/.
|
10
|
+
|
11
|
+
For fast syntax checking, try the "Quick Reference":http://hobix.com/textile/quick.html.
|
12
|
+
|
13
|
+
p(example1). Upgrade with "RubyGems":http://rubygems.rubyforge.org/! Try:
|
14
|
+
@gem install RedCloth@.
|
15
|
+
|
16
|
+
See the "project page":http://rubyforge.org/projects/redcloth/ for bug reporting, old releases and CVS instructions. "Documentation":http://redcloth.rubyforge.org/rdoc/ is also hosted at RubyForge.
|
17
|
+
|
18
|
+
h4. RedCloth Links
|
19
|
+
|
20
|
+
"Instiki":http://www.instiki.org is the greatest Wiki ever! Uses RedCloth for its markup!
|
21
|
+
|
22
|
+
"Hobix":http://hobix.com is a lovely little blogging package which uses RedCloth for blog entries.
|
23
|
+
|
24
|
+
<div id="css-buttons">
|
25
|
+
|
26
|
+
* "(css-button w3c)%W3C% xhtml 1.0(Valid XHTML 1.0!)":http://validator.w3.org/check?uri=referer
|
27
|
+
* "(css-button w3c w3c2)%W3C% valid css(Valid CSS!)":http://jigsaw.w3.org/css-validator/check/referer
|
28
|
+
|
29
|
+
</div>
|
30
|
+
|
31
|
+
</div>
|
32
|
+
|
33
|
+
RedCloth is a module for using Textile in Ruby. Textile is a text format. A very simple text format. Another stab at making readable text that can be converted to HTML.
|
34
|
+
|
35
|
+
h2. What is Textile?
|
36
|
+
|
37
|
+
Textile is a simple markup language.
|
38
|
+
|
39
|
+
table{width:400px}.
|
40
|
+
|_. textile|_. to|_. html|
|
41
|
+
| <notextile>_a phrase_</notextile> |->|_a phrase_|
|
42
|
+
| <notextile>*a phrase*</notextile> |->|*a phrase*|
|
43
|
+
| <notextile>_*a phrase*_</notextile> |->|_*a phrase*_|
|
44
|
+
| <notextile>"Google":http://google.com</notextile> |->|"Google":http://google.com|
|
45
|
+
|
46
|
+
No need to use verbose HTML to build your docs, your blogs, your pages. Textile gives you readable text while you're writing and beautiful text for your readers. And if you need to break out into HTML, Textile will allow you to do so.
|
47
|
+
|
48
|
+
Textile also handles some subtleties of formatting which will enhance your document's readability:
|
49
|
+
|
50
|
+
* Single- and double-quotes around words or phrases are converted to curly quotations, much easier on
|
51
|
+
the eye. "Observe!"
|
52
|
+
|
53
|
+
* Double hyphens are replaced with an em-dash. Observe -- very nice!
|
54
|
+
|
55
|
+
* Single hyphens are replaced with en-dashes. Observe - so cute!
|
56
|
+
|
57
|
+
* Triplets of periods become an ellipsis. Observe...
|
58
|
+
|
59
|
+
* The letter 'x' becomes a dimension sign when used alone. Observe: 2 x 2.
|
60
|
+
|
61
|
+
* Conversion of <notextile>(TM)</notextile> to (TM), <notextile>(R)</notextile> to (R), <notextile>(C)</notextile> to (C).
|
62
|
+
|
63
|
+
For more on Textile's language, hop over to "A Textile Reference":http://hobix.com/textile/.
|
64
|
+
|
65
|
+
h2. Using RedCloth
|
66
|
+
|
67
|
+
The RedCloth class is an extension of Ruby's String class. Use it like you would a String:
|
68
|
+
|
69
|
+
<pre>
|
70
|
+
>> r = RedCloth.new "*strong text* and _emphasized text_"
|
71
|
+
=> "*strong text* and _emphasized text_"
|
72
|
+
>> r.gsub!( 'text', 'words' )
|
73
|
+
=> "*strong words* and _emphasized words_"
|
74
|
+
</pre>
|
75
|
+
|
76
|
+
To generate HTML from your RedCloth object, use the @RedCloth#to_html@ method:
|
77
|
+
|
78
|
+
<pre>
|
79
|
+
>> r.to_html
|
80
|
+
=> "<p><strong>strong words</strong> and <em>emphasized words</em></p>"
|
81
|
+
</pre>
|
82
|
+
|
83
|
+
|
84
|
+
h2. Installing RedCloth
|
85
|
+
|
86
|
+
To install RedCloth via RubyGems:
|
87
|
+
|
88
|
+
<pre>
|
89
|
+
gem install RedCloth
|
90
|
+
</pre>
|
91
|
+
|
92
|
+
Or "download RedCloth":http://rubyforge.org/frs/download.php/2896/RedCloth-3.0.3.tar.gz and simply run the install.rb like so:
|
93
|
+
|
94
|
+
<pre>
|
95
|
+
ruby install.rb config
|
96
|
+
ruby install.rb setup
|
97
|
+
sudo ruby install.rb install
|
98
|
+
</pre>
|
99
|
+
|
100
|
+
|
101
|
+
h2. Acknowledgements
|
102
|
+
|
103
|
+
Textile is (c) 2003 Dean Allen. All rights reserved. You can read more "here":http://www.textism.com/tools/textile/.
|
104
|
+
|
105
|
+
RedCloth is also based on PyTextile, which is: Copyright (c) 2003, "Mark Pilgrim":http://diveintomark.org/. All rights reserved. You can read more about PyTextile "here":http://dealmeida.net/projects/textile.
|
106
|
+
|
data/doc/REFERENCE
ADDED
@@ -0,0 +1,216 @@
|
|
1
|
+
---
|
2
|
+
- A Textile Reference:
|
3
|
+
- Textile is a simple text markup. Simple symbols mark words' emphasis. Blocks of text
|
4
|
+
can be easily tagged as headers, quotes, or lists. A Textile document can then be
|
5
|
+
converted to HTML(Hypertext Markup Language) for viewing on the web.
|
6
|
+
- You can try Textile out on the "Textile home page":http://www.textism.com/tools/textile/.
|
7
|
+
Textile is also available as "RedCloth":http://whytheluckystiff.net/ruby/redcloth/ for
|
8
|
+
Ruby or "PyTextile":http://dealmeida.net/projects/textile for Python.
|
9
|
+
- Also refer to the "*Quick Reference*":javascript:quickRedReference(); for this guide.
|
10
|
+
- h4. Reading the Examples
|
11
|
+
- In each section below, examples are provided to clearly illustrate. In each example,
|
12
|
+
the Textile example is followed by the raw HTML it is translated into, followed by how
|
13
|
+
the HTML appears in the browser.
|
14
|
+
-
|
15
|
+
- Textile example
|
16
|
+
- Converted to HTML
|
17
|
+
- Browser-view
|
18
|
+
- Writing in Textile:
|
19
|
+
- Textile looks for paragraphs in your text. Paragraphs are separated by one blank line.
|
20
|
+
Every paragraph is translated as an HTML paragraph.
|
21
|
+
- !!example "A single paragraph.\n\nFollowed by another."
|
22
|
+
- h4. Using HTML in Textile
|
23
|
+
- You can certainly use HTML tags inside your Textile documents. HTML will only be escaped
|
24
|
+
if it's found in a @pre@ or @code@ block.
|
25
|
+
- !!example "I am <b>very</b> serious.\n\n<pre>\n I am <b>very</b> serious.\n</pre>"
|
26
|
+
- h4. Line Breaks
|
27
|
+
- Line breaks are ignored.
|
28
|
+
- !!example "I spoke.\nAnd none replied."
|
29
|
+
- Line breaks can be converted to HTML breaks by setting @hard_breaks@.
|
30
|
+
- h4. Entities
|
31
|
+
- Single- and double-quotes around words or phrases are converted to curly quotations, much easier on the eye.
|
32
|
+
- !!example '"Observe!"'
|
33
|
+
- Double hyphens are replaced with an em-dash.
|
34
|
+
- !!example Observe -- very nice!
|
35
|
+
- Single hyphens are replaced with en-dashes.
|
36
|
+
- !!example Observe - tiny and brief.
|
37
|
+
- Triplets of periods become an ellipsis.
|
38
|
+
- !!example Observe...
|
39
|
+
- The letter 'x' becomes a dimension sign when used alone.
|
40
|
+
- !!example 'Observe: 2 x 2.'
|
41
|
+
- Conversion of trademark and copyright symbols.
|
42
|
+
- !!example 'one(TM), two(R), three(C).'
|
43
|
+
- Quick Block Modifiers:
|
44
|
+
- Blocks of text default to being treated as paragraphs. But modifers can be affixed
|
45
|
+
to the beginning of a block to change its treatment.
|
46
|
+
- h4. Headers
|
47
|
+
- To make an entire paragraph into a Header, place "h<em>n</em>." at
|
48
|
+
its beginning, where _n_ is a number from 1-6.
|
49
|
+
- !!example h1. Header 1
|
50
|
+
- !!example h2. Header 2
|
51
|
+
- !!example h3. Header 3
|
52
|
+
- h4. Block Quotes
|
53
|
+
- To make an entire paragraph into a block quotation, place
|
54
|
+
"bq." before it.
|
55
|
+
- !!example "An old text\n\nbq. A block quotation.\n\nAny old text"
|
56
|
+
- h4. Footnotes
|
57
|
+
- Numeric references within text to footnotes appear between square brackets.
|
58
|
+
- !!example This is covered elsewhere[1].
|
59
|
+
- To create the footnote that corresponds to its reference within the text, begin a new paragraph with fn and the
|
60
|
+
footnote's number, followed by a dot and a space.
|
61
|
+
- !!example fn1. Down here, in fact.
|
62
|
+
- Quick Phrase Modifiers:
|
63
|
+
- h4. Structural Emphasis
|
64
|
+
- Emphasis to text is added by surrounding a phrase with underscores. In HTML, this often
|
65
|
+
appears as <em>italics</em>.
|
66
|
+
- !!example I _believe_ every word.
|
67
|
+
- Strength can be give to text by surrounding with asterisks. In HTML, this strength appears
|
68
|
+
as <strong>bold</strong>.
|
69
|
+
- !!example And then? She *fell*!
|
70
|
+
- Both italics and bold can be forced by doubling the underscores or asterisks.
|
71
|
+
- !!example "I __know__.\nI **really** __know__."
|
72
|
+
- Use double question marks to indicate _citation_. The title of a book, for instance.
|
73
|
+
- !!example "??Cat's Cradle?? by Vonnegut"
|
74
|
+
- Code phrases can be surrounded by at-symbols.
|
75
|
+
- !!example "Convert with @r.to_html@"
|
76
|
+
- To indicate a passage which has been deleted, surround the passage with hypens.
|
77
|
+
- !!example "I'm -sure- not sure."
|
78
|
+
- Pluses around a passage indicate its insertion.
|
79
|
+
- !!example "You are a +pleasant+ child."
|
80
|
+
- To superscript a phrase, surround with carets.
|
81
|
+
- !!example "a^2^ + b^2^ = c^2^"
|
82
|
+
- To subscript, surround with tildes.
|
83
|
+
- !!example "log~2~x"
|
84
|
+
- h4. HTML-Specific
|
85
|
+
- Lastly, if you find yourself needing to customize the style of a passage, use percent symbols
|
86
|
+
to translate the passage as an HTML span.
|
87
|
+
- !!example I'm %unaware% of most soft drinks.
|
88
|
+
- This way, you can apply style settings, as described in the next section to arbitrary phrases.
|
89
|
+
- !!example "I'm %{color:red}unaware%\nof most soft drinks."
|
90
|
+
- Attributes:
|
91
|
+
- Tailoring Textile to suit your needs is quite easy. Attributes allow you to provide CSS(Cascading
|
92
|
+
Style Sheets) information about any phrase.
|
93
|
+
- h4. Block Attributes
|
94
|
+
- A block can be tagged with a CSS class by circling the class in parentheses and
|
95
|
+
placing it just before the period which marks the block.
|
96
|
+
- !!example p(example1). An example
|
97
|
+
- An element ID can be given by prefixing the ID with a pound symbol and using it in place of
|
98
|
+
the class.
|
99
|
+
- !!example p(#big-red). Red here
|
100
|
+
- Class and ID can be combined by placing the class first.
|
101
|
+
- !!example p(example1#big-red2). Red here
|
102
|
+
- Style settings can be provided directly by surrounding them in curly braces.
|
103
|
+
- !!example p{color:blue;margin:30px}. Spacey blue
|
104
|
+
- Language designations can be given between angel brackets.
|
105
|
+
- !!example p[fr]. rouge
|
106
|
+
- h4. Phrase Attributes
|
107
|
+
- All block attributes can be applied to phrases as well by placing them just inside the
|
108
|
+
opening modifier.
|
109
|
+
- !!example "I seriously *{color:red}blushed*\nwhen I _(big)sprouted_ that\ncorn stalk from my\n%[es]cabeza%."
|
110
|
+
- h4. Block Alignments
|
111
|
+
- Text inside blocks can be aligned in four basic ways.
|
112
|
+
- !!example p<. align left
|
113
|
+
- !!example p>. align right
|
114
|
+
- !!example p=. centered
|
115
|
+
- !!example p<>. justified
|
116
|
+
- Indentation can also be specified by provide a single left paren for every 1em to the left. A single right
|
117
|
+
paren for every 1em to the right.
|
118
|
+
- !!example p(. left ident 1em
|
119
|
+
- !!example p((. left ident 2em
|
120
|
+
- !!example p))). right ident 3em
|
121
|
+
- h4. Combining Alignments
|
122
|
+
- Identation may be coupled with alignment.
|
123
|
+
- !!example "h2()>. Bingo."
|
124
|
+
- And, furthermore, coupled with language settings and CSS styles.
|
125
|
+
- !!example "h3()>[no]{color:red}. Bingo"
|
126
|
+
- h4. HTML in Textile
|
127
|
+
- Textile is designed for quickening the simple markups. For more complex formatting, you are encouraged
|
128
|
+
to break out into HTML.
|
129
|
+
- For example, long code blocks belong between @pre@ and @code@ tags. Please also indent your code inside
|
130
|
+
the tags to be sure that all Textile processors out there will ignore the contents.
|
131
|
+
- !!example |
|
132
|
+
<pre>
|
133
|
+
<code>
|
134
|
+
a.gsub!( /</, '' )
|
135
|
+
</code>
|
136
|
+
</pre>
|
137
|
+
- You may also choose to surround sections with @div@ tags to separate your document into sections.
|
138
|
+
"Instiki":http://www.instiki.org/ uses this technique to float a sidebar to the right.
|
139
|
+
- !!example |
|
140
|
+
<div style="float:right;">
|
141
|
+
|
142
|
+
h3. Sidebar
|
143
|
+
|
144
|
+
"Hobix":http://hobix.com/
|
145
|
+
"Ruby":http://ruby-lang.org/
|
146
|
+
|
147
|
+
</div>
|
148
|
+
|
149
|
+
The main text of the
|
150
|
+
page goes here and will
|
151
|
+
stay to the left of the
|
152
|
+
sidebar.
|
153
|
+
|
154
|
+
- Lists:
|
155
|
+
- h4. Numeric Lists
|
156
|
+
- To make a numbered list, place each item in its own paragraph, preceded by "#".
|
157
|
+
- !!example "# A first item\n# A second item\n# A third"
|
158
|
+
- These lists may be nested by increasing the number of pound symbols preceding child entries.
|
159
|
+
- !!example "# Fuel could be:\n## Coal\n## Gasoline\n## Electricity\n# Humans need only:\n## Water\n## Protein"
|
160
|
+
- h4. Bulleted Lists
|
161
|
+
- Bulleted lists use an asterisk in place of the pound.
|
162
|
+
- !!example "* A first item\n* A second item\n* A third"
|
163
|
+
- These lists may be nested in like manner.
|
164
|
+
- !!example "* Fuel could be:\n** Coal\n** Gasoline\n** Electricity\n* Humans need only:\n** Water\n** Protein"
|
165
|
+
- External References:
|
166
|
+
- h4. Hypertext Links
|
167
|
+
- Basic links are comprised of a phrase which is linked to a URL(Universal Resource Locator). Place the
|
168
|
+
descriptive phrase in quotation marks. Follow it immediately by a colon and the URL.
|
169
|
+
- !!example I searched "Google":http://google.com.
|
170
|
+
- Notice, the link won't include any trailing punctuation.
|
171
|
+
- h4. Link Aliases
|
172
|
+
- If you are using the same link several times in your document, or you'd just like to be a tad more
|
173
|
+
organized, you can use a link alias. Place the URL anywhere in your document, beginning with its
|
174
|
+
alias in square brackets. Then, use the alias in place of the URL, using the link format above.
|
175
|
+
- !!example |
|
176
|
+
I am crazy about "Hobix":hobix
|
177
|
+
and "it's":hobix "all":hobix I ever
|
178
|
+
"link to":hobix!
|
179
|
+
|
180
|
+
[hobix]http://hobix.com
|
181
|
+
- h4. Embedded Images
|
182
|
+
- You can embed an image in your Textile document by surrounding its URL with exclamation marks.
|
183
|
+
- !!example "!http://hobix.com/sample.jpg!"
|
184
|
+
- URLs may be relative.
|
185
|
+
- A title for the image can also be provided in parens, just before the closing exclamation.
|
186
|
+
- !!example "!openwindow1.gif(Bunny.)!"
|
187
|
+
- The title also acts as *alt* text should the image not be found.
|
188
|
+
- Links can be attached to images with a colon.
|
189
|
+
- !!example "!openwindow1.gif!:http://hobix.com/"
|
190
|
+
- h4. Image Alignments
|
191
|
+
- Alignments can be applied as well to images.
|
192
|
+
- !!example "!>obake.gif!\n\nAnd others sat all round the small\nmachine and paid it to sing to them."
|
193
|
+
- h4. Acronyms
|
194
|
+
- Definitions for acronyms can be provided by following an acronym with its definition in parens.
|
195
|
+
- !!example We use CSS(Cascading Style Sheets).
|
196
|
+
- Tables:
|
197
|
+
- Simple tables can be built by separating fields with pipe characters
|
198
|
+
- !!example "| name | age | sex |\n| joan | 24 | f |\n| archie | 29 | m |\n| bella | 45 | f |"
|
199
|
+
- Specify header cells by marking them with an underscore and period.
|
200
|
+
- !!example "|_. name |_. age |_. sex |\n| joan | 24 | f |\n| archie | 29 | m |\n| bella | 45 | f |"
|
201
|
+
- h4. Cell Attributes
|
202
|
+
- The period used above marks the end of a cell's attributes. Other attributes can be applied as well.
|
203
|
+
- !!example "|_. attribute list |\n|<. align left |\n|>. align right|\n|=. center |\n|<>. justify |\n|^. valign top |\n|~. bottom |"
|
204
|
+
- You can also specify colspans with a backslash, followed by the cell width.
|
205
|
+
- !!example "|\\2. spans two cols |\n| col 1 | col 2 |"
|
206
|
+
- Rowspan is specified by a forward slash, followed by the row height.
|
207
|
+
- !!example "|/3. spans 3 rows | a |\n| b |\n| c |"
|
208
|
+
- All block attributes can be applied to table cells as well.
|
209
|
+
- !!example "|{background:#ddd}. Grey cell|"
|
210
|
+
- h4. Table and Row Attributes
|
211
|
+
- Table-wide attributes can be applied before the first row of the table. On its own line, followed by
|
212
|
+
a period.
|
213
|
+
- !!example "table{border:1px solid black}.\n|This|is|a|row|\n|This|is|a|row|"
|
214
|
+
- Attributes can be applied to a single row by supplying the attribute before the row starts, using a
|
215
|
+
@table@ modifier and following it by a period.
|
216
|
+
- !!example "|This|is|a|row|\n{background:#ddd}. |This|is|grey|row|"
|