-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtextile.tips.inc
279 lines (266 loc) · 6.43 KB
/
textile.tips.inc
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
<?php
use Drupal\Core\Url;
use Drupal\Core\Utility\UnroutedUrlAssembler;
/**
* @file
*
* File for the long description of the filter format.
*/
function _textile_filter_long_tips() {
$generator = Drupal::urlGenerator();
$url = $generator->generateFromPath('core/misc/druplicon.png');
return t('Textile Help
<h2>Block modifier syntax:</h2>
<p>
CSS attributes can be applied to blocks (paragraphs, headers,
etc.). CSS classes are specifed with <q><code>(<em>class</em>)</code></q>;
CSS IDs are specified with <q><code>(#<em>id</em>)</code></q>; both can be
specified with <q><code>(<em>class</em>#<em>id</em>)</code></q>. An arbtirary
CSS style can be applied by using
<q><code>{<em>style</em>}</code></q>. Finally, language attributes are
applied using <q><code>[<em>language</em>]</code></q>.
</p>
<p>
Additionally, alignment and indentation shorthands are provided. To
left-align, right-align, center, and justify text, use
<q><code><</code></q>, <q><code>></code></q>, <q><code>=</code></q>, and
<q><code><></code></q>, respectively. <q><code>(</code></q> left-indents
a block 1em for each occurrence, and <q><code>)</code></q> right-indents
similarly.
</p>
<p>
Tables have additional options. <q><code>^</code></q>, <q><code>-</code></q>,
and <q><code>~</code></q> specify top, middle, and bottom vertical
alignment. The <q><code>_</code></q> attribute on a cell indicates that
it is a table header.
</p>
<p>
The examples below illustrate these attributes.
</p>
<table>
<tr>
<th>textile input</th>
<th>output</th>
</tr>
<tr class="dark">
<td colspan="2">
<h3>Headings</h3>
<code>h<em>x</em>.</code> (where <em>x</em> is 1 - 6)
</td>
</tr>
<tr class="light">
<a name="10"></a>
<td>h1. Heading</td>
<td><h1>Heading</h1></td>
</tr>
<tr class="light">
<td>h2(class). Heading with class</td>
<td><h2 class="class">Heading with class</h2></td>
</tr>
<tr class="dark">
<td colspan="2"><h3>Paragraphs</h3></td>
</tr>
<tr class="light">
<td>p=. Centered text</td>
<td><p style="text-align:center;">Centered text</p></td>
</tr>
<tr class="light">
<td>p())(#id). Indented text with ID</td>
<td>
<p style="padding-left:1em;padding-right:2em;" id="id">Indented
text with ID</p>
</td>
</tr>
<tr class="dark">
<td colspan="2"><h3>Block quotes</h3></td>
</tr>
<tr class="light">
<td>bq(class#id). Quote with class and ID</td>
<td>
<blockquote class="class" id="id">Quote with class and
ID</blockquote>
</td>
</tr>
<tr class="light">
<td>bq[en]. English quote</td>
<td>
<blockquote lang="en">English quote</blockquote>
</td>
</tr>
<tr class="dark">
<td colspan="2"><h3>Ordered lists</h3></td>
</tr>
<tr class="light">
<td>
{color: blue}# Attributes specified<br />
# before the first item<br />
# affect the whole list
</td>
<td>
<ol style="color:blue;">
<li>Attributes specified</li>
<li>before the first item</li>
<li>affect the whole list</li>
</ol>
</td>
</tr>
<tr class="dark">
<td colspan="2"><h3>Unordered lists</h3></td>
</tr>
<tr class="light">
<td>
* Lists can have<br />
## subitems or<br />
## sublists<br />
* too
</td>
<td>
<ul>
<li>Lists can have
<ol>
<li>subitems or</li>
<li>sublists</li>
</ol>
</li>
<li>too</li>
</ul>
</td>
</tr>
<tr class="dark">
<td colspan="2">
<h3>Footnotes</h3>
<code>fn<em>x</em>.</code> (where <em>x</em> is 1 - 100)
</td>
</tr>
<tr class="light">
<td>fn17. Footnote</td>
<td><p id="fn17"><sup>17</sup> Footnote</p></td>
</tr>
<tr class="dark">
<td colspan="2"><h3>Tables</h3></td>
</tr>
<tr class="light">
<td>
|_. A|_. B|_. C|<br />
(dark). |very|simple|table|<br />
|<. left|=. center|>. right|<br />
|^{height:3em}. top|-. middle|~. bottom|
</td>
<td>
<table>
<tr>
<th>A</th>
<th>B</th>
<th>C</th>
</tr>
<tr class="dark">
<td>very</td>
<td>simple</td>
<td>table</td>
</tr>
<tr>
<td style="text-align:left;">left</td>
<td style="text-align:center;">center</td>
<td style="text-align:right;">right</td>
</tr>
<tr>
<td style="vertical-align:top;height:3em;">top</td>
<td style="vertical-align:middle;">middle</td>
<td style="vertical-align:bottom;">bottom</td>
</tr>
</table>
</td>
</tr>
</table>
<h2>Phrase modifier syntax:</h2>
<p>
The class, ID, style, and language attributes described above also
apply to the span phrase modifier as shown below.
</p>
<table>
<tr>
<th>textile input</th>
<th>output</th>
</tr>
<tr class="dark">
<td>_emphasis_</td>
<td><em>emphasis</em></td>
</tr>
<tr class="light">
<td>__italic__</td>
<td><em>italic</em></td>
</tr>
<tr class="dark">
<td>*strong*</td>
<td><strong>strong</strong></td>
</tr>
<tr class="light">
<td>**bold**</td>
<td><b>bold</bold></td>
</tr>
<tr class="dark">
<td>??citation??</td>
<td><cite>citation</cite></td>
</tr>
<tr class="light">
<td>-delete text-</td>
<td><del>deleted text</del></td>
</tr>
<tr class="dark">
<td>+inserted text+</td>
<td><ins>inserted text</ins></td>
</tr>
<tr class="light">
<td>^superscript^</td>
<td><sup>superscript</sup></td>
</tr>
<tr class="dark">
<td>~subscript~</td>
<td><sub>subscript</sub></td>
</tr>
<tr class="light">
<td>@code@</td>
<td><code>code</code></td>
</tr>
<tr class="dark">
<td>%(class)span%</td>
<td><span class="class">span</span></td>
</tr>
<tr class="dark">
<td>%{color:red;}span%</td>
<td><span style="color:red;">span</span></td>
</tr>
<tr class="light">
<td>==no textile==</td>
<td>no textile</td>
</tr>
<tr class="dark">
<td>"link text":@url</td>
<td><a href="@url">link text</a></td>
</tr>
<tr class="light">
<td>"link text(title)":@url</td>
<td><a href="@url" title="title">link text</a></td>
</tr>
<tr class="dark">
<td>!@image-url!</td>
<td><img src="@image-url" /></td>
</tr>
<tr class="light">
<td>!@image-url(alt text)!</td>
<td><img src="@image-url" alt="alt text" /></td>
</tr>
<tr class="dark">
<td>!@image-url!:@url</td>
<td><a href="@url"><img src="@image-url" /></a></td>
</tr>
<tr class="light">
<td>ABC(Always Be Closing)</td>
<td><acronym title="Always Be Closing">ABC</acronym></td>
</tr>
<tr class="dark">
<td>Footnote reference[10]</td>
<td>Footnote reference<sup><a href="#10">10</a></sup></td>
</tr>
</table>', array('@image-url' => $url, '@url' => 'http://drupal.org'));
}