RedCloth 4.0.0-x86-mswin32-60
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/CHANGELOG +17 -0
- data/COPYING +18 -0
- data/README +156 -0
- data/Rakefile +240 -0
- data/bin/redcloth +28 -0
- data/ext/redcloth_scan/extconf.rb +9 -0
- data/ext/redcloth_scan/redcloth.h +149 -0
- data/ext/redcloth_scan/redcloth_attributes.c +650 -0
- data/ext/redcloth_scan/redcloth_attributes.rl +78 -0
- data/ext/redcloth_scan/redcloth_common.rl +113 -0
- data/ext/redcloth_scan/redcloth_inline.c +5102 -0
- data/ext/redcloth_scan/redcloth_inline.rl +282 -0
- data/ext/redcloth_scan/redcloth_scan.c +9300 -0
- data/ext/redcloth_scan/redcloth_scan.rl +523 -0
- data/extras/mingw-rbconfig.rb +176 -0
- data/extras/ragel_profiler.rb +73 -0
- data/lib/redcloth.rb +24 -0
- data/lib/redcloth/formatters/base.rb +50 -0
- data/lib/redcloth/formatters/html.rb +342 -0
- data/lib/redcloth/formatters/latex.rb +227 -0
- data/lib/redcloth/formatters/latex_entities.yml +2414 -0
- data/lib/redcloth/textile_doc.rb +105 -0
- data/lib/redcloth/version.rb +18 -0
- data/lib/redcloth_scan.bundle +0 -0
- data/lib/redcloth_scan.so +0 -0
- data/test/basic.yml +794 -0
- data/test/code.yml +195 -0
- data/test/definitions.yml +71 -0
- data/test/extra_whitespace.yml +64 -0
- data/test/filter_html.yml +177 -0
- data/test/filter_pba.yml +12 -0
- data/test/helper.rb +108 -0
- data/test/html.yml +271 -0
- data/test/images.yml +202 -0
- data/test/instiki.yml +38 -0
- data/test/links.yml +214 -0
- data/test/lists.yml +283 -0
- data/test/poignant.yml +89 -0
- data/test/sanitize_html.yml +42 -0
- data/test/table.yml +267 -0
- data/test/test_custom_tags.rb +46 -0
- data/test/test_extensions.rb +31 -0
- data/test/test_formatters.rb +15 -0
- data/test/test_parser.rb +68 -0
- data/test/test_restrictions.rb +41 -0
- data/test/textism.yml +480 -0
- data/test/threshold.yml +772 -0
- data/test/validate_fixtures.rb +73 -0
- metadata +104 -0
@@ -0,0 +1,105 @@
|
|
1
|
+
module RedCloth
|
2
|
+
class TextileDoc < String
|
3
|
+
#
|
4
|
+
# Accessors for setting security restrictions.
|
5
|
+
#
|
6
|
+
# This is a nice thing if you're using RedCloth for
|
7
|
+
# formatting in public places (e.g. Wikis) where you
|
8
|
+
# don't want users to abuse HTML for bad things.
|
9
|
+
#
|
10
|
+
# If +:filter_html+ is set, HTML which wasn't
|
11
|
+
# created by the Textile processor will be escaped.
|
12
|
+
# Alternatively, if +:sanitize_html+ is set,
|
13
|
+
# HTML can pass through the Textile processor but
|
14
|
+
# unauthorized tags and attributes will be removed.
|
15
|
+
#
|
16
|
+
# If +:filter_styles+ is set, it will also disable
|
17
|
+
# the style markup specifier. ('{color: red}')
|
18
|
+
#
|
19
|
+
# If +:filter_classes+ is set, it will also disable
|
20
|
+
# class attributes. ('!(classname)image!')
|
21
|
+
#
|
22
|
+
# If +:filter_ids+ is set, it will also disable
|
23
|
+
# id attributes. ('!(classname#id)image!')
|
24
|
+
#
|
25
|
+
attr_accessor :filter_html, :sanitize_html, :filter_styles, :filter_classes, :filter_ids
|
26
|
+
|
27
|
+
#
|
28
|
+
# Deprecated accessor for toggling hard breaks.
|
29
|
+
#
|
30
|
+
# Traditional RedCloth converted single newlines
|
31
|
+
# to HTML break tags, but later versions required
|
32
|
+
# +:hard_breaks+ be set to enable this behavior.
|
33
|
+
# +:hard_breaks+ is once again the default. The
|
34
|
+
# accessor is deprecated and will be removed in a
|
35
|
+
# future version.
|
36
|
+
#
|
37
|
+
attr_accessor :hard_breaks
|
38
|
+
|
39
|
+
# Accessor for toggling lite mode.
|
40
|
+
#
|
41
|
+
# In lite mode, block-level rules are ignored. This means
|
42
|
+
# that tables, paragraphs, lists, and such aren't available.
|
43
|
+
# Only the inline markup for bold, italics, entities and so on.
|
44
|
+
#
|
45
|
+
# r = RedCloth.new( "And then? She *fell*!", [:lite_mode] )
|
46
|
+
# r.to_html
|
47
|
+
# #=> "And then? She <strong>fell</strong>!"
|
48
|
+
#
|
49
|
+
attr_accessor :lite_mode
|
50
|
+
|
51
|
+
#
|
52
|
+
# Accessor for toggling span caps.
|
53
|
+
#
|
54
|
+
# Textile places `span' tags around capitalized
|
55
|
+
# words by default, but this wreaks havoc on Wikis.
|
56
|
+
# If +:no_span_caps+ is set, this will be
|
57
|
+
# suppressed.
|
58
|
+
#
|
59
|
+
attr_accessor :no_span_caps
|
60
|
+
|
61
|
+
# Returns a new RedCloth object, based on _string_, observing
|
62
|
+
# any _restrictions_ specified.
|
63
|
+
#
|
64
|
+
# r = RedCloth.new( "h1. A *bold* man" )
|
65
|
+
# #=> "h1. A *bold* man"
|
66
|
+
# r.to_html
|
67
|
+
# #=>"<h1>A <b>bold</b> man</h1>"
|
68
|
+
#
|
69
|
+
def initialize( string, restrictions = [] )
|
70
|
+
restrictions.each { |r| method("#{r}=").call( true ) }
|
71
|
+
super( string )
|
72
|
+
end
|
73
|
+
|
74
|
+
#
|
75
|
+
# Generates HTML from the Textile contents.
|
76
|
+
#
|
77
|
+
# RedCloth.new( "And then? She *fell*!" ).to_html
|
78
|
+
# #=>"<p>And then? She <strong>fell</strong>!</p>"
|
79
|
+
#
|
80
|
+
def to_html( *rules )
|
81
|
+
apply_rules(rules)
|
82
|
+
|
83
|
+
to(RedCloth::Formatters::HTML)
|
84
|
+
end
|
85
|
+
|
86
|
+
#
|
87
|
+
# Generates LaTeX from the Textile contents.
|
88
|
+
#
|
89
|
+
# RedCloth.new( "And then? She *fell*!" ).to_latex
|
90
|
+
# #=> "And then? She \\textbf{fell}!\n\n"
|
91
|
+
#
|
92
|
+
def to_latex( *rules )
|
93
|
+
apply_rules(rules)
|
94
|
+
|
95
|
+
to(RedCloth::Formatters::LATEX)
|
96
|
+
end
|
97
|
+
|
98
|
+
private
|
99
|
+
def apply_rules(rules)
|
100
|
+
rules.each do |r|
|
101
|
+
method(r).call(self) if self.respond_to?(r)
|
102
|
+
end
|
103
|
+
end
|
104
|
+
end
|
105
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module RedCloth
|
2
|
+
module VERSION
|
3
|
+
MAJOR = 4
|
4
|
+
MINOR = 0
|
5
|
+
TINY = 0
|
6
|
+
RELEASE_CANDIDATE = nil
|
7
|
+
|
8
|
+
STRING = [MAJOR, MINOR, TINY].join('.')
|
9
|
+
TAG = "REL_#{[MAJOR, MINOR, TINY, RELEASE_CANDIDATE].compact.join('_')}".upcase.gsub(/\.|-/, '_')
|
10
|
+
FULL_VERSION = "#{[MAJOR, MINOR, TINY, RELEASE_CANDIDATE].compact.join('.')}"
|
11
|
+
end
|
12
|
+
|
13
|
+
NAME = "RedCloth"
|
14
|
+
GEM_NAME = NAME
|
15
|
+
URL = "http://redcloth.org/"
|
16
|
+
|
17
|
+
DESCRIPTION = "#{NAME}-#{VERSION::FULL_VERSION} - Textile parser for Ruby.\n#{URL}"
|
18
|
+
end
|
Binary file
|
Binary file
|
data/test/basic.yml
ADDED
@@ -0,0 +1,794 @@
|
|
1
|
+
---
|
2
|
+
name: paragraphs
|
3
|
+
desc: Textile looks for paragraphs in your text. Paragraphs are separated by one blank line. Every paragraph is translated as an HTML paragraph.
|
4
|
+
in: |-
|
5
|
+
A single paragraph.
|
6
|
+
|
7
|
+
Followed by another.
|
8
|
+
html: |-
|
9
|
+
<p>A single paragraph.</p>
|
10
|
+
<p>Followed by another.</p>
|
11
|
+
---
|
12
|
+
name: block containing block start
|
13
|
+
in: |-
|
14
|
+
I saw a ship. It ate my elephant.
|
15
|
+
html: |-
|
16
|
+
<p>I saw a ship. It ate my elephant.</p>
|
17
|
+
---
|
18
|
+
name: extended block containing block start
|
19
|
+
in: |-
|
20
|
+
p.. I saw a ship. It ate my elephant.
|
21
|
+
|
22
|
+
When the elephant comes to take a p. you...
|
23
|
+
html: |-
|
24
|
+
<p>I saw a ship. It ate my elephant.</p>
|
25
|
+
<p>When the elephant comes to take a p. you…</p>
|
26
|
+
---
|
27
|
+
name: blockquote containing block start
|
28
|
+
in: |-
|
29
|
+
bq. I saw a ship. It ate my elephant.
|
30
|
+
html: |-
|
31
|
+
<blockquote>
|
32
|
+
<p>I saw a ship. It ate my elephant.</p>
|
33
|
+
</blockquote>
|
34
|
+
---
|
35
|
+
name: extended blockquote containing block start
|
36
|
+
in: |-
|
37
|
+
bq.. I saw a ship. It ate my elephant.
|
38
|
+
|
39
|
+
When the elephant comes to take a p. you...
|
40
|
+
html: |-
|
41
|
+
<blockquote>
|
42
|
+
<p>I saw a ship. It ate my elephant.</p>
|
43
|
+
<p>When the elephant comes to take a p. you…</p>
|
44
|
+
</blockquote>
|
45
|
+
---
|
46
|
+
name: notextile block containing block start
|
47
|
+
in: |-
|
48
|
+
notextile. I saw a ship. It ate my elephant.
|
49
|
+
html: |-
|
50
|
+
I saw a ship. It ate my elephant.
|
51
|
+
valid_html: false
|
52
|
+
---
|
53
|
+
name: extended notextile block containing block start
|
54
|
+
in: |-
|
55
|
+
notextile.. I saw a ship. It ate my elephant.
|
56
|
+
|
57
|
+
When the elephant comes to take a p. you...
|
58
|
+
html: |-
|
59
|
+
I saw a ship. It ate my elephant.
|
60
|
+
|
61
|
+
When the elephant comes to take a p. you...
|
62
|
+
valid_html: false
|
63
|
+
---
|
64
|
+
name: pre block containing block start
|
65
|
+
in: |-
|
66
|
+
pre. I saw a ship. It ate my elephant.
|
67
|
+
html: |-
|
68
|
+
<pre>I saw a ship. It ate my elephant.</pre>
|
69
|
+
---
|
70
|
+
name: extended pre block containing block start
|
71
|
+
in: |-
|
72
|
+
pre.. I saw a ship. It ate my elephant.
|
73
|
+
|
74
|
+
When the elephant comes to take a p. you...
|
75
|
+
html: |-
|
76
|
+
<pre>I saw a ship. It ate my elephant.</pre>
|
77
|
+
|
78
|
+
<pre>When the elephant comes to take a p. you…</pre>
|
79
|
+
---
|
80
|
+
name: html tags
|
81
|
+
desc: You can certainly use HTML tags inside your Textile documents. HTML will only be escaped if it’s found in a <code>pre</code> or <code>code</code> block.
|
82
|
+
in: |-
|
83
|
+
I am <b>very</b> serious.
|
84
|
+
|
85
|
+
<pre>
|
86
|
+
I am <b>very</b> serious.
|
87
|
+
</pre>
|
88
|
+
html: |-
|
89
|
+
<p>I am <b>very</b> serious.</p>
|
90
|
+
<pre>
|
91
|
+
I am <b>very</b> serious.
|
92
|
+
</pre>
|
93
|
+
---
|
94
|
+
name: line breaks
|
95
|
+
desc: Line breaks are converted to HTML breaks.
|
96
|
+
in: |-
|
97
|
+
I spoke.
|
98
|
+
And none replied.
|
99
|
+
html: |-
|
100
|
+
<p>I spoke.<br />
|
101
|
+
And none replied.</p>
|
102
|
+
html_no_breaks: |-
|
103
|
+
<p>I spoke.
|
104
|
+
And none replied.</p>
|
105
|
+
lite_mode_html: |-
|
106
|
+
I spoke.<br />
|
107
|
+
And none replied.
|
108
|
+
---
|
109
|
+
name: curly quotes
|
110
|
+
desc: Single- and double-quotes around words or phrases are converted to curly quotations, much easier on the eye.
|
111
|
+
in: "\"Observe!\""
|
112
|
+
html: <p>“Observe!”</p>
|
113
|
+
---
|
114
|
+
name: double hyphens
|
115
|
+
desc: Double hyphens are replaced with an em-dash.
|
116
|
+
in: Observe--very nice!
|
117
|
+
html: <p>Observe—very nice!</p>
|
118
|
+
latex: "Observe---very nice!\n\n"
|
119
|
+
---
|
120
|
+
name: double hyphens with spaces
|
121
|
+
desc: Double hyphens are replaced with an em-dash and surrounding spaces are preserved.
|
122
|
+
in: Observe -- very nice!
|
123
|
+
html: <p>Observe — very nice!</p>
|
124
|
+
latex: "Observe --- very nice!\n\n"
|
125
|
+
---
|
126
|
+
name: single hyphens with spaces
|
127
|
+
desc: Single hyphens are replaced with en-dashes if they are surrounded by spaces.
|
128
|
+
in: Observe - tiny and brief.
|
129
|
+
html: <p>Observe – tiny and brief.</p>
|
130
|
+
latex: "Observe--tiny and brief.\n\n"
|
131
|
+
---
|
132
|
+
name: midword hyphens
|
133
|
+
desc: Single hyphens are left alone if not surrounded by spaces.
|
134
|
+
in: Observe the nicely-done hyphen.
|
135
|
+
html: <p>Observe the nicely-done hyphen.</p>
|
136
|
+
---
|
137
|
+
name: ellipses
|
138
|
+
desc: Triplets of periods become an ellipsis.
|
139
|
+
in: Observe...
|
140
|
+
html: <p>Observe…</p>
|
141
|
+
lite_mode_html: Observe…
|
142
|
+
---
|
143
|
+
name: dimension sign
|
144
|
+
desc: The letter 'x' becomes a dimension sign when used between digits.
|
145
|
+
in: "Observe: 2x3."
|
146
|
+
html: "<p>Observe: 2×3.</p>"
|
147
|
+
---
|
148
|
+
name: dimension sign with spaces
|
149
|
+
in: "Observe: 2 x 4."
|
150
|
+
html: "<p>Observe: 2 × 4.</p>"
|
151
|
+
---
|
152
|
+
name: dimension signs chained
|
153
|
+
in: "Observe: 2x3x4."
|
154
|
+
html: "<p>Observe: 2×3×4.</p>"
|
155
|
+
lite_mode_html: "Observe: 2×3×4."
|
156
|
+
---
|
157
|
+
name: dimension sign with double quotes
|
158
|
+
in: 'My mouse: 2.5" x 4".'
|
159
|
+
html: '<p>My mouse: 2.5" × 4".</p>'
|
160
|
+
---
|
161
|
+
name: dimension sign with single quotes
|
162
|
+
in: "My office: 5' x 4.5'."
|
163
|
+
html: "<p>My office: 5’ × 4.5’.</p>"
|
164
|
+
---
|
165
|
+
name: trademark and copyright
|
166
|
+
desc: Conversion of trademark and copyright symbols.
|
167
|
+
in: one(TM), two(R), three(C).
|
168
|
+
html: <p>one™, two®, three©.</p>
|
169
|
+
lite_mode_html: one™, two®, three©.
|
170
|
+
---
|
171
|
+
name: headers
|
172
|
+
desc: To make an entire paragraph into a Header, place “h<em>n</em>.” at its beginning, where <em>n</em> is a number from 1-6.
|
173
|
+
in: h3. Header 3
|
174
|
+
html: <h3>Header 3</h3>
|
175
|
+
---
|
176
|
+
name: blockquote
|
177
|
+
desc: To make an entire paragraph into a block quotation, place “bq.” before it.
|
178
|
+
in: |-
|
179
|
+
Any old text
|
180
|
+
|
181
|
+
bq. A block quotation.
|
182
|
+
|
183
|
+
Any old text
|
184
|
+
html: |-
|
185
|
+
<p>Any old text</p>
|
186
|
+
<blockquote>
|
187
|
+
<p>A block quotation.</p>
|
188
|
+
</blockquote>
|
189
|
+
<p>Any old text</p>
|
190
|
+
---
|
191
|
+
name: footnote reference
|
192
|
+
desc: Numeric references within text to footnotes appear between square brackets.
|
193
|
+
in: This is covered elsewhere[1].
|
194
|
+
html: <p>This is covered elsewhere<sup class="footnote"><a href="#fn1">1</a></sup>.</p>
|
195
|
+
---
|
196
|
+
name: footnote
|
197
|
+
desc: To create the footnote that corresponds to its reference within the text, begin a new paragraph with fn and the footnote’s number, followed by a dot and a space.
|
198
|
+
in: fn1. Down here, in fact.
|
199
|
+
html: <p class="footnote" id="fn1"><sup>1</sup> Down here, in fact.</p>
|
200
|
+
---
|
201
|
+
name: em
|
202
|
+
desc: Emphasis to text is added by surrounding a phrase with underscores. In HTML, this often appears as <em>italics</em>.
|
203
|
+
in: I _believe_ every word.
|
204
|
+
html: <p>I <em>believe</em> every word.</p>
|
205
|
+
lite_mode_html: "I <em>believe</em> every word."
|
206
|
+
---
|
207
|
+
name: strong
|
208
|
+
desc: Strength can be give to text by surrounding with asterisks. In HTML, this strength appears as <strong>bold</strong>.
|
209
|
+
in: And then? She *fell*!
|
210
|
+
html: <p>And then? She <strong>fell</strong>!</p>
|
211
|
+
lite_mode_html: "And then? She <strong>fell</strong>!"
|
212
|
+
---
|
213
|
+
name: force bold italics
|
214
|
+
desc: Both italics and bold can be forced by doubling the underscores or asterisks.
|
215
|
+
in: |-
|
216
|
+
I __know__.
|
217
|
+
I **really** __know__.
|
218
|
+
html: |-
|
219
|
+
<p>I <i>know</i>.<br />
|
220
|
+
I <b>really</b> <i>know</i>.</p>
|
221
|
+
---
|
222
|
+
name: citation
|
223
|
+
desc: Use double question marks to indicate <em>citation</em>. The title of a book, for instance.
|
224
|
+
in: ??Cat's Cradle?? by Vonnegut
|
225
|
+
html: <p><cite>Cat’s Cradle</cite> by Vonnegut</p>
|
226
|
+
---
|
227
|
+
name: code phrases
|
228
|
+
desc: Code phrases can be surrounded by at-symbols.
|
229
|
+
in: Convert with @r.to_html@
|
230
|
+
html: <p>Convert with <code>r.to_html</code></p>
|
231
|
+
lite_mode_html: Convert with <code>r.to_html</code>
|
232
|
+
---
|
233
|
+
name: code phrases not created with multiple email addresses
|
234
|
+
in: Please email why@domain.com or jason@domain.com.
|
235
|
+
html: <p>Please email why@domain.com or jason@domain.com.</p>
|
236
|
+
---
|
237
|
+
name: del
|
238
|
+
desc: To indicate a passage which has been deleted, surround the passage with hypens.
|
239
|
+
in: I'm -sure- not sure.
|
240
|
+
html: <p>I’m <del>sure</del> not sure.</p>
|
241
|
+
---
|
242
|
+
name: ins
|
243
|
+
desc: Pluses around a passage indicate its insertion.
|
244
|
+
in: You are a +pleasant+ child.
|
245
|
+
html: <p>You are a <ins>pleasant</ins> child.</p>
|
246
|
+
---
|
247
|
+
name: superscript
|
248
|
+
desc: To superscript a phrase, surround with carets.
|
249
|
+
in: a ^2^ + b ^2^ = c ^2^
|
250
|
+
html: <p>a <sup>2</sup> + b <sup>2</sup> = c <sup>2</sup></p>
|
251
|
+
---
|
252
|
+
name: subscript
|
253
|
+
desc: To subscript, surround with tildes.
|
254
|
+
in: log ~2~ x
|
255
|
+
html: <p>log <sub>2</sub> x</p>
|
256
|
+
---
|
257
|
+
name: span
|
258
|
+
desc: Lastly, if you find yourself needing to customize the style of a passage, use percent symbols to translate the passage as an HTML span.
|
259
|
+
in: I'm %unaware% of most soft drinks.
|
260
|
+
html: <p>I’m <span>unaware</span> of most soft drinks.</p>
|
261
|
+
---
|
262
|
+
name: style span
|
263
|
+
desc: This way, you can apply style settings, as described in the next section to arbitrary phrases.
|
264
|
+
in: |-
|
265
|
+
I'm %{color:red}unaware%
|
266
|
+
of most soft drinks.
|
267
|
+
html: |-
|
268
|
+
<p>I’m <span style="color:red;">unaware</span><br />
|
269
|
+
of most soft drinks.</p>
|
270
|
+
lite_mode_html: |-
|
271
|
+
I’m <span style="color:red;">unaware</span><br />
|
272
|
+
of most soft drinks.
|
273
|
+
---
|
274
|
+
name: css class
|
275
|
+
desc: A block can be tagged with a CSS class by circling the class in parentheses and placing it just before the period which marks the block.
|
276
|
+
in: p(example1). An example
|
277
|
+
html: <p class="example1">An example</p>
|
278
|
+
---
|
279
|
+
name: css id
|
280
|
+
desc: An element ID can be given by prefixing the ID with a pound symbol and using it in place of the class.
|
281
|
+
in: p(#big-red). Red here
|
282
|
+
html: <p id="big-red">Red here</p>
|
283
|
+
---
|
284
|
+
name: class and id combined
|
285
|
+
desc: Class and ID can be combined by placing the class first.
|
286
|
+
in: p(example1#big-red2). Red here
|
287
|
+
html: <p class="example1" id="big-red2">Red here</p>
|
288
|
+
---
|
289
|
+
name: css style
|
290
|
+
desc: Style settings can be provided directly by surrounding them in curly braces.
|
291
|
+
in: p{color:blue;margin:30px}. Spacey blue
|
292
|
+
html: <p style="color:blue;margin:30px;">Spacey blue</p>
|
293
|
+
---
|
294
|
+
name: language designations
|
295
|
+
desc: Language designations can be given between angel brackets.
|
296
|
+
in: p[fr]. rouge
|
297
|
+
html: <p lang="fr">rouge</p>
|
298
|
+
---
|
299
|
+
name: block attributes on phrase modifiers
|
300
|
+
desc: All block attributes can be applied to phrases as well by placing them just inside the opening modifier.
|
301
|
+
in: |-
|
302
|
+
I seriously *{color:red}blushed*
|
303
|
+
when I _(big)sprouted_ that
|
304
|
+
corn stalk from my
|
305
|
+
%[es]cabeza%.
|
306
|
+
html: |-
|
307
|
+
<p>I seriously <strong style="color:red;">blushed</strong><br />
|
308
|
+
when I <em class="big">sprouted</em> that<br />
|
309
|
+
corn stalk from my<br />
|
310
|
+
<span lang="es">cabeza</span>.</p>
|
311
|
+
---
|
312
|
+
name: inline attributes preceded by text are treated as literal
|
313
|
+
desc: modifiers must come first, without anything before them
|
314
|
+
in: |-
|
315
|
+
I *seriously {color:red}blushed*
|
316
|
+
when I _first (big)sprouted_ that
|
317
|
+
corn stalk from my
|
318
|
+
%grande [es]cabeza%.
|
319
|
+
html: |-
|
320
|
+
<p>I <strong>seriously {color:red}blushed</strong><br />
|
321
|
+
when I <em>first (big)sprouted</em> that<br />
|
322
|
+
corn stalk from my<br />
|
323
|
+
<span>grande [es]cabeza</span>.</p>
|
324
|
+
---
|
325
|
+
name: align justified
|
326
|
+
desc: Text inside blocks can be aligned in four basic ways.
|
327
|
+
in: p<>. justified
|
328
|
+
html: <p style="text-align:justify;">justified</p>
|
329
|
+
---
|
330
|
+
name: indentation
|
331
|
+
desc: Indentation can also be specified by provide a single left paren for every 1em to the left. A single right paren for every 1em to the right.
|
332
|
+
in: p))). right ident 3em
|
333
|
+
html: <p style="padding-right:3em;">right ident 3em</p>
|
334
|
+
---
|
335
|
+
name: indentation and alignment
|
336
|
+
desc: Identation may be coupled with alignment.
|
337
|
+
in: h2()>. Bingo.
|
338
|
+
html: <h2 style="padding-left:1em;padding-right:1em;text-align:right;">Bingo.</h2>
|
339
|
+
---
|
340
|
+
name: many modifiers combined
|
341
|
+
desc: And, furthermore, coupled with language settings and CSS styles.
|
342
|
+
in: h3()>[no]{color:red}. Bingo
|
343
|
+
html: <h3 style="padding-left:1em;padding-right:1em;text-align:right;color:red;" lang="no">Bingo</h3>
|
344
|
+
---
|
345
|
+
name: code blocks
|
346
|
+
desc: For example, long code blocks belong between <code>pre</code> and <code>code</code> tags. Please also indent your code inside the tags to be sure that all Textile processors out there will ignore the contents.
|
347
|
+
in: |
|
348
|
+
<pre>
|
349
|
+
<code>
|
350
|
+
a.gsub!( /</, '' )
|
351
|
+
</code>
|
352
|
+
</pre>
|
353
|
+
html: |-
|
354
|
+
<pre>
|
355
|
+
<code>
|
356
|
+
a.gsub!( /</, '' )
|
357
|
+
</code>
|
358
|
+
</pre>
|
359
|
+
---
|
360
|
+
name: div tags
|
361
|
+
desc: You may also choose to surround sections with <code>div</code> tags to separate your document into sections. <a href="http://www.instiki.org/">Instiki</a> uses this technique to float a sidebar to the right.
|
362
|
+
in: |
|
363
|
+
<div style="float:right;">
|
364
|
+
|
365
|
+
h3. Sidebar
|
366
|
+
|
367
|
+
"Hobix":http://hobix.com/
|
368
|
+
"Ruby":http://ruby-lang.org/
|
369
|
+
|
370
|
+
</div>
|
371
|
+
|
372
|
+
The main text of the page goes here and will stay to the left of the sidebar.
|
373
|
+
html: |-
|
374
|
+
<div style="float:right;">
|
375
|
+
<h3>Sidebar</h3>
|
376
|
+
<p><a href="http://hobix.com/">Hobix</a><br />
|
377
|
+
<a href="http://ruby-lang.org/">Ruby</a></p>
|
378
|
+
</div>
|
379
|
+
<p>The main text of the page goes here and will stay to the left of the sidebar.</p>
|
380
|
+
---
|
381
|
+
name: numbered list
|
382
|
+
desc: To make a numbered list, place each item in its own paragraph, preceded by ”#”.
|
383
|
+
in: |-
|
384
|
+
# A first item
|
385
|
+
# A second item
|
386
|
+
# A third
|
387
|
+
html: |-
|
388
|
+
<ol>
|
389
|
+
<li>A first item</li>
|
390
|
+
<li>A second item</li>
|
391
|
+
<li>A third</li>
|
392
|
+
</ol>
|
393
|
+
---
|
394
|
+
name: nested numbered lists
|
395
|
+
desc: These lists may be nested by increasing the number of pound symbols preceding child entries.
|
396
|
+
in: |-
|
397
|
+
# Fuel could be:
|
398
|
+
## Coal
|
399
|
+
## Gasoline
|
400
|
+
## Electricity
|
401
|
+
# Humans need only:
|
402
|
+
## Water
|
403
|
+
## Protein
|
404
|
+
html: |-
|
405
|
+
<ol>
|
406
|
+
<li>Fuel could be:
|
407
|
+
<ol>
|
408
|
+
<li>Coal</li>
|
409
|
+
<li>Gasoline</li>
|
410
|
+
<li>Electricity</li>
|
411
|
+
</ol></li>
|
412
|
+
<li>Humans need only:
|
413
|
+
<ol>
|
414
|
+
<li>Water</li>
|
415
|
+
<li>Protein</li>
|
416
|
+
</ol></li>
|
417
|
+
</ol>
|
418
|
+
---
|
419
|
+
name: bulleted list
|
420
|
+
desc: Bulleted lists use an asterisk in place of the pound.
|
421
|
+
in: |-
|
422
|
+
* A first item
|
423
|
+
* A second item
|
424
|
+
* A third
|
425
|
+
html: |-
|
426
|
+
<ul>
|
427
|
+
<li>A first item</li>
|
428
|
+
<li>A second item</li>
|
429
|
+
<li>A third</li>
|
430
|
+
</ul>
|
431
|
+
---
|
432
|
+
name: nested bulleted lists
|
433
|
+
desc: These lists may be nested in like manner.
|
434
|
+
in: |-
|
435
|
+
* Fuel could be:
|
436
|
+
** Coal
|
437
|
+
** Gasoline
|
438
|
+
** Electricity
|
439
|
+
* Humans need only:
|
440
|
+
** Water
|
441
|
+
** Protein
|
442
|
+
html: |-
|
443
|
+
<ul>
|
444
|
+
<li>Fuel could be:
|
445
|
+
<ul>
|
446
|
+
<li>Coal</li>
|
447
|
+
<li>Gasoline</li>
|
448
|
+
<li>Electricity</li>
|
449
|
+
</ul></li>
|
450
|
+
<li>Humans need only:
|
451
|
+
<ul>
|
452
|
+
<li>Water</li>
|
453
|
+
<li>Protein</li>
|
454
|
+
</ul></li>
|
455
|
+
</ul>
|
456
|
+
---
|
457
|
+
name: links
|
458
|
+
desc: Basic links are comprised of a phrase which is linked to a <acronym title="Universal Resource Locator">URL</acronym>. Place the descriptive phrase in quotation marks. Follow it immediately by a colon and the URL.
|
459
|
+
in: I searched "Google":http://google.com.
|
460
|
+
html: <p>I searched <a href="http://google.com">Google</a>.</p>
|
461
|
+
lite_mode_html: I searched <a href="http://google.com">Google</a>.
|
462
|
+
---
|
463
|
+
name: link aliases
|
464
|
+
desc: If you are using the same link several times in your document, or you’d just like to be a tad more organized, you can use a link alias. Place the URL anywhere in your document, beginning with its alias in square brackets. Then, use the alias in place of the URL, using the link format above.
|
465
|
+
in: |-
|
466
|
+
I am crazy about "Hobix":hobix
|
467
|
+
and "it's":hobix "all":hobix I ever
|
468
|
+
"link to":hobix!
|
469
|
+
|
470
|
+
[hobix]http://hobix.com
|
471
|
+
html: |-
|
472
|
+
<p>I am crazy about <a href="http://hobix.com">Hobix</a><br />
|
473
|
+
and <a href="http://hobix.com">it’s</a> <a href="http://hobix.com">all</a> I ever<br />
|
474
|
+
<a href="http://hobix.com">link to</a>!</p>
|
475
|
+
---
|
476
|
+
name: image
|
477
|
+
desc: You can embed an image in your Textile document by surrounding its URL with exclamation marks.
|
478
|
+
in: "!http://hobix.com/sample.jpg!"
|
479
|
+
html: <p><img src="http://hobix.com/sample.jpg" alt="" /></p>
|
480
|
+
lite_mode_html: <img src="http://hobix.com/sample.jpg" alt="" />
|
481
|
+
---
|
482
|
+
name: image title
|
483
|
+
desc: A title for the image can also be provided in parens, just before the closing exclamation.
|
484
|
+
in: "!openwindow1.gif(Bunny.)!"
|
485
|
+
html: <p><img src="openwindow1.gif" title="Bunny." alt="Bunny." /></p>
|
486
|
+
---
|
487
|
+
name: image links
|
488
|
+
desc: Links can be attached to images with a colon.
|
489
|
+
in: "!openwindow1.gif!:http://hobix.com/"
|
490
|
+
html: <p><a href="http://hobix.com/"><img src="openwindow1.gif" alt="" /></a></p>
|
491
|
+
---
|
492
|
+
name: image alignments
|
493
|
+
desc: Alignments can be applied as well to images.
|
494
|
+
in: |-
|
495
|
+
!>obake.gif!
|
496
|
+
|
497
|
+
And others sat all round the small
|
498
|
+
machine and paid it to sing to them.
|
499
|
+
html: |-
|
500
|
+
<p style="float:right;"><img src="obake.gif" alt="" /></p>
|
501
|
+
<p>And others sat all round the small<br />
|
502
|
+
machine and paid it to sing to them.</p>
|
503
|
+
---
|
504
|
+
name: acronym definitions
|
505
|
+
desc: Definitions for acronyms can be provided by following an acronym with its definition in parens.
|
506
|
+
in: We use CSS(Cascading Style Sheets).
|
507
|
+
html: <p>We use <acronym title="Cascading Style Sheets"><span class="caps">CSS</span></acronym>.</p>
|
508
|
+
lite_mode_html: We use <acronym title="Cascading Style Sheets"><span class="caps">CSS</span></acronym>.
|
509
|
+
no_span_caps_html: <p>We use <acronym title="Cascading Style Sheets">CSS</acronym>.</p>
|
510
|
+
---
|
511
|
+
name: tables
|
512
|
+
desc: Simple tables can be built by separating fields with pipe characters
|
513
|
+
in: |-
|
514
|
+
| name | age | sex |
|
515
|
+
| joan | 24 | f |
|
516
|
+
| archie | 29 | m |
|
517
|
+
| bella | 45 | f |
|
518
|
+
html: |-
|
519
|
+
<table>
|
520
|
+
<tr>
|
521
|
+
<td> name </td>
|
522
|
+
<td> age </td>
|
523
|
+
<td> sex </td>
|
524
|
+
</tr>
|
525
|
+
<tr>
|
526
|
+
<td> joan </td>
|
527
|
+
<td> 24 </td>
|
528
|
+
<td> f </td>
|
529
|
+
</tr>
|
530
|
+
<tr>
|
531
|
+
<td> archie </td>
|
532
|
+
<td> 29 </td>
|
533
|
+
<td> m </td>
|
534
|
+
</tr>
|
535
|
+
<tr>
|
536
|
+
<td> bella </td>
|
537
|
+
<td> 45 </td>
|
538
|
+
<td> f </td>
|
539
|
+
</tr>
|
540
|
+
</table>
|
541
|
+
---
|
542
|
+
name: table headers
|
543
|
+
desc: Specify header cells by marking them with an underscore and period.
|
544
|
+
in: |-
|
545
|
+
|_. name |_. age |_. sex |
|
546
|
+
| joan | 24 | f |
|
547
|
+
| archie | 29 | m |
|
548
|
+
| bella | 45 | f |
|
549
|
+
html: |-
|
550
|
+
<table>
|
551
|
+
<tr>
|
552
|
+
<th>name </th>
|
553
|
+
<th>age </th>
|
554
|
+
<th>sex </th>
|
555
|
+
</tr>
|
556
|
+
<tr>
|
557
|
+
<td> joan </td>
|
558
|
+
<td> 24 </td>
|
559
|
+
<td> f </td>
|
560
|
+
</tr>
|
561
|
+
<tr>
|
562
|
+
<td> archie </td>
|
563
|
+
<td> 29 </td>
|
564
|
+
<td> m </td>
|
565
|
+
</tr>
|
566
|
+
<tr>
|
567
|
+
<td> bella </td>
|
568
|
+
<td> 45 </td>
|
569
|
+
<td> f </td>
|
570
|
+
</tr>
|
571
|
+
</table>
|
572
|
+
---
|
573
|
+
name: table cell attributes
|
574
|
+
desc: The period used above marks the end of a cell’s attributes. Other attributes can be applied as well.
|
575
|
+
in: |-
|
576
|
+
|_. attribute list |
|
577
|
+
|<. align left |
|
578
|
+
|>. align right|
|
579
|
+
|=. center |
|
580
|
+
|<>. justify |
|
581
|
+
|^. valign top |
|
582
|
+
|~. bottom |
|
583
|
+
html: |-
|
584
|
+
<table>
|
585
|
+
<tr>
|
586
|
+
<th>attribute list </th>
|
587
|
+
</tr>
|
588
|
+
<tr>
|
589
|
+
<td style="text-align:left;">align left </td>
|
590
|
+
</tr>
|
591
|
+
<tr>
|
592
|
+
<td style="text-align:right;">align right</td>
|
593
|
+
</tr>
|
594
|
+
<tr>
|
595
|
+
<td style="text-align:center;">center </td>
|
596
|
+
</tr>
|
597
|
+
<tr>
|
598
|
+
<td style="text-align:justify;">justify </td>
|
599
|
+
</tr>
|
600
|
+
<tr>
|
601
|
+
<td style="vertical-align:top;">valign top </td>
|
602
|
+
</tr>
|
603
|
+
<tr>
|
604
|
+
<td style="vertical-align:bottom;">bottom </td>
|
605
|
+
</tr>
|
606
|
+
</table>
|
607
|
+
---
|
608
|
+
name: table colspan
|
609
|
+
desc: You can also specify colspans with a backslash, followed by the cell width.
|
610
|
+
in: |-
|
611
|
+
|\2. spans two cols |
|
612
|
+
| col 1 | col 2 |
|
613
|
+
html: |-
|
614
|
+
<table>
|
615
|
+
<tr>
|
616
|
+
<td colspan="2">spans two cols </td>
|
617
|
+
</tr>
|
618
|
+
<tr>
|
619
|
+
<td> col 1 </td>
|
620
|
+
<td> col 2 </td>
|
621
|
+
</tr>
|
622
|
+
</table>
|
623
|
+
---
|
624
|
+
name: table rowspan
|
625
|
+
desc: Rowspan is specified by a forward slash, followed by the row height.
|
626
|
+
in: |-
|
627
|
+
|/3. spans 3 rows | a |
|
628
|
+
| b |
|
629
|
+
| c |
|
630
|
+
html: |-
|
631
|
+
<table>
|
632
|
+
<tr>
|
633
|
+
<td rowspan="3">spans 3 rows </td>
|
634
|
+
<td> a </td>
|
635
|
+
</tr>
|
636
|
+
<tr>
|
637
|
+
<td> b </td>
|
638
|
+
</tr>
|
639
|
+
<tr>
|
640
|
+
<td> c </td>
|
641
|
+
</tr>
|
642
|
+
</table>
|
643
|
+
---
|
644
|
+
name: block attributes applied to table cells
|
645
|
+
desc: All block attributes can be applied to table cells as well.
|
646
|
+
in: "|{background:#ddd}. Grey cell|"
|
647
|
+
html: |-
|
648
|
+
<table>
|
649
|
+
<tr>
|
650
|
+
<td style="background:#ddd;">Grey cell</td>
|
651
|
+
</tr>
|
652
|
+
</table>
|
653
|
+
---
|
654
|
+
name: black attributes applied to a table
|
655
|
+
desc: Table-wide attributes can be applied before the first row of the table. On its own line, followed by a period.
|
656
|
+
in: |-
|
657
|
+
table{border:1px solid black}.
|
658
|
+
|This|is|a|row|
|
659
|
+
|This|is|a|row|
|
660
|
+
html: |-
|
661
|
+
<table style="border:1px solid black;">
|
662
|
+
<tr>
|
663
|
+
<td>This</td>
|
664
|
+
<td>is</td>
|
665
|
+
<td>a</td>
|
666
|
+
<td>row</td>
|
667
|
+
</tr>
|
668
|
+
<tr>
|
669
|
+
<td>This</td>
|
670
|
+
<td>is</td>
|
671
|
+
<td>a</td>
|
672
|
+
<td>row</td>
|
673
|
+
</tr>
|
674
|
+
</table>
|
675
|
+
---
|
676
|
+
name: black attributes applied to a table row
|
677
|
+
desc: Attributes can be applied to a single row by supplying the attribute before the row starts, using a <code>table</code> modifier and following it by a period.
|
678
|
+
in: |-
|
679
|
+
|This|is|a|row|
|
680
|
+
{background:#ddd}. |This|is|grey|row|
|
681
|
+
html: |-
|
682
|
+
<table>
|
683
|
+
<tr>
|
684
|
+
<td>This</td>
|
685
|
+
<td>is</td>
|
686
|
+
<td>a</td>
|
687
|
+
<td>row</td>
|
688
|
+
</tr>
|
689
|
+
<tr style="background:#ddd;">
|
690
|
+
<td>This</td>
|
691
|
+
<td>is</td>
|
692
|
+
<td>grey</td>
|
693
|
+
<td>row</td>
|
694
|
+
</tr>
|
695
|
+
</table>
|
696
|
+
---
|
697
|
+
name: extended block followed by pre block
|
698
|
+
in: |-
|
699
|
+
div.. Just a test.
|
700
|
+
|
701
|
+
Second div.
|
702
|
+
|
703
|
+
pre. A pre block ends it.
|
704
|
+
html: |-
|
705
|
+
<div>Just a test.</div>
|
706
|
+
<div>Second div.</div>
|
707
|
+
<pre>A pre block ends it.</pre>
|
708
|
+
---
|
709
|
+
name: extended block followed by blockquote
|
710
|
+
in: |-
|
711
|
+
div.. Just a test.
|
712
|
+
|
713
|
+
Second div.
|
714
|
+
|
715
|
+
bq. A blockquote ends it.
|
716
|
+
html: |-
|
717
|
+
<div>Just a test.</div>
|
718
|
+
<div>Second div.</div>
|
719
|
+
<blockquote>
|
720
|
+
<p>A blockquote ends it.</p>
|
721
|
+
</blockquote>
|
722
|
+
---
|
723
|
+
name: extended block followed by block code
|
724
|
+
in: |-
|
725
|
+
div.. Just a test.
|
726
|
+
|
727
|
+
Second div.
|
728
|
+
|
729
|
+
bc. A blockcode ends it.
|
730
|
+
html: |-
|
731
|
+
<div>Just a test.</div>
|
732
|
+
<div>Second div.</div>
|
733
|
+
<pre><code>A blockcode ends it.</code></pre>
|
734
|
+
---
|
735
|
+
name: extended block followed by notextile block
|
736
|
+
in: |-
|
737
|
+
div.. Just a test.
|
738
|
+
|
739
|
+
Second div.
|
740
|
+
|
741
|
+
notextile. A notextile block ends it.
|
742
|
+
html: |-
|
743
|
+
<div>Just a test.</div>
|
744
|
+
<div>Second div.</div>
|
745
|
+
A notextile block ends it.
|
746
|
+
valid_html: false
|
747
|
+
---
|
748
|
+
name: simple parentheses
|
749
|
+
in: |-
|
750
|
+
before (in parens) after
|
751
|
+
html: |-
|
752
|
+
<p>before (in parens) after</p>
|
753
|
+
---
|
754
|
+
name: parentheses in underscores
|
755
|
+
in: |-
|
756
|
+
before _(in parens)_ after
|
757
|
+
html: |-
|
758
|
+
<p>before <em>(in parens)</em> after</p>
|
759
|
+
---
|
760
|
+
name: parentheses in asterisks
|
761
|
+
in: |-
|
762
|
+
before *(in parens)* after
|
763
|
+
html: |-
|
764
|
+
<p>before <strong>(in parens)</strong> after</p>
|
765
|
+
---
|
766
|
+
name: parentheses in underscores in quotes
|
767
|
+
in: |-
|
768
|
+
"before _(in parens)_ after"
|
769
|
+
html: |-
|
770
|
+
<p>“before <em>(in parens)</em> after”</p>
|
771
|
+
---
|
772
|
+
name: underscores in parentheses
|
773
|
+
in: |-
|
774
|
+
one _two three_ (four _five six_) seven
|
775
|
+
html: |-
|
776
|
+
<p>one <em>two three</em> (four <em>five six</em>) seven</p>
|
777
|
+
---
|
778
|
+
name: underscores in parentheses in quotes
|
779
|
+
in: |-
|
780
|
+
"one _two three_ (four _five six_) seven"
|
781
|
+
html: |-
|
782
|
+
<p>“one <em>two three</em> (four <em>five six</em>) seven”</p>
|
783
|
+
---
|
784
|
+
name: underscores in parentheses 2
|
785
|
+
in: |-
|
786
|
+
one (two _three four_) five
|
787
|
+
html: |-
|
788
|
+
<p>one (two <em>three four</em>) five</p>
|
789
|
+
---
|
790
|
+
name: underscores in parentheses in quotes 2
|
791
|
+
in: |-
|
792
|
+
"one (two _three four_) five"
|
793
|
+
html: |-
|
794
|
+
<p>“one (two <em>three four</em>) five”</p>
|