org-ruby 0.7.2 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +10 -0
- data/README.rdoc +55 -51
- data/lib/org-ruby.rb +1 -1
- data/lib/org-ruby/headline.rb +0 -1
- data/lib/org-ruby/html_output_buffer.rb +201 -214
- data/lib/org-ruby/html_symbol_replace.rb +359 -340
- data/lib/org-ruby/line.rb +79 -24
- data/lib/org-ruby/output_buffer.rb +144 -146
- data/lib/org-ruby/parser.rb +37 -122
- data/lib/org-ruby/regexp_helper.rb +49 -49
- data/lib/org-ruby/textile_output_buffer.rb +91 -44
- data/lib/org-ruby/textile_symbol_replace.rb +360 -341
- metadata +3 -14
@@ -1,346 +1,365 @@
|
|
1
|
-
#
|
1
|
+
# -*- coding: utf-8 -*-
|
2
2
|
# Autogenerated by util/gen-special-replace.el
|
3
3
|
|
4
4
|
module Orgmode
|
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
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
5
|
+
TextileEntities = {
|
6
|
+
"Agrave" => "À",
|
7
|
+
"agrave" => "à",
|
8
|
+
"Aacute" => "Á",
|
9
|
+
"aacute" => "á",
|
10
|
+
"Acirc" => "Â",
|
11
|
+
"acirc" => "â",
|
12
|
+
"Atilde" => "Ã",
|
13
|
+
"atilde" => "ã",
|
14
|
+
"Auml" => "Ä",
|
15
|
+
"auml" => "ä",
|
16
|
+
"Aring" => "Å",
|
17
|
+
"AA" => "Å",
|
18
|
+
"aring" => "å",
|
19
|
+
"AElig" => "Æ",
|
20
|
+
"aelig" => "æ",
|
21
|
+
"Ccedil" => "Ç",
|
22
|
+
"ccedil" => "ç",
|
23
|
+
"Egrave" => "È",
|
24
|
+
"egrave" => "è",
|
25
|
+
"Eacute" => "É",
|
26
|
+
"eacute" => "é",
|
27
|
+
"Ecirc" => "Ê",
|
28
|
+
"ecirc" => "ê",
|
29
|
+
"Euml" => "Ë",
|
30
|
+
"euml" => "ë",
|
31
|
+
"Igrave" => "Ì",
|
32
|
+
"igrave" => "ì",
|
33
|
+
"Iacute" => "Í",
|
34
|
+
"iacute" => "í",
|
35
|
+
"Icirc" => "Î",
|
36
|
+
"icirc" => "î",
|
37
|
+
"Iuml" => "Ï",
|
38
|
+
"iuml" => "ï",
|
39
|
+
"Ntilde" => "Ñ",
|
40
|
+
"ntilde" => "ñ",
|
41
|
+
"Ograve" => "Ò",
|
42
|
+
"ograve" => "ò",
|
43
|
+
"Oacute" => "Ó",
|
44
|
+
"oacute" => "ó",
|
45
|
+
"Ocirc" => "Ô",
|
46
|
+
"ocirc" => "ô",
|
47
|
+
"Otilde" => "Õ",
|
48
|
+
"otilde" => "õ",
|
49
|
+
"Ouml" => "Ö",
|
50
|
+
"ouml" => "ö",
|
51
|
+
"Oslash" => "Ø",
|
52
|
+
"oslash" => "ø",
|
53
|
+
"OElig" => "Œ",
|
54
|
+
"oelig" => "œ",
|
55
|
+
"Scaron" => "Š",
|
56
|
+
"scaron" => "š",
|
57
|
+
"szlig" => "ß",
|
58
|
+
"Ugrave" => "Ù",
|
59
|
+
"ugrave" => "ù",
|
60
|
+
"Uacute" => "Ú",
|
61
|
+
"uacute" => "ú",
|
62
|
+
"Ucirc" => "Û",
|
63
|
+
"ucirc" => "û",
|
64
|
+
"Uuml" => "Ü",
|
65
|
+
"uuml" => "ü",
|
66
|
+
"Yacute" => "Ý",
|
67
|
+
"yacute" => "ý",
|
68
|
+
"Yuml" => "Ÿ",
|
69
|
+
"yuml" => "ÿ",
|
70
|
+
"fnof" => "ƒ",
|
71
|
+
"real" => "ℜ",
|
72
|
+
"image" => "ℑ",
|
73
|
+
"weierp" => "℘",
|
74
|
+
"Alpha" => "Α",
|
75
|
+
"alpha" => "α",
|
76
|
+
"Beta" => "Β",
|
77
|
+
"beta" => "β",
|
78
|
+
"Gamma" => "Γ",
|
79
|
+
"gamma" => "γ",
|
80
|
+
"Delta" => "Δ",
|
81
|
+
"delta" => "δ",
|
82
|
+
"Epsilon" => "Ε",
|
83
|
+
"epsilon" => "ε",
|
84
|
+
"varepsilon" => "ε",
|
85
|
+
"Zeta" => "Ζ",
|
86
|
+
"zeta" => "ζ",
|
87
|
+
"Eta" => "Η",
|
88
|
+
"eta" => "η",
|
89
|
+
"Theta" => "Θ",
|
90
|
+
"theta" => "θ",
|
91
|
+
"thetasym" => "ϑ",
|
92
|
+
"vartheta" => "ϑ",
|
93
|
+
"Iota" => "Ι",
|
94
|
+
"iota" => "ι",
|
95
|
+
"Kappa" => "Κ",
|
96
|
+
"kappa" => "κ",
|
97
|
+
"Lambda" => "Λ",
|
98
|
+
"lambda" => "λ",
|
99
|
+
"Mu" => "Μ",
|
100
|
+
"mu" => "μ",
|
101
|
+
"nu" => "ν",
|
102
|
+
"Nu" => "Ν",
|
103
|
+
"Xi" => "Ξ",
|
104
|
+
"xi" => "ξ",
|
105
|
+
"Omicron" => "Ο",
|
106
|
+
"omicron" => "ο",
|
107
|
+
"Pi" => "Π",
|
108
|
+
"pi" => "π",
|
109
|
+
"Rho" => "Ρ",
|
110
|
+
"rho" => "ρ",
|
111
|
+
"Sigma" => "Σ",
|
112
|
+
"sigma" => "σ",
|
113
|
+
"sigmaf" => "ς",
|
114
|
+
"varsigma" => "ς",
|
115
|
+
"Tau" => "Τ",
|
116
|
+
"Upsilon" => "Υ",
|
117
|
+
"upsih" => "ϒ",
|
118
|
+
"upsilon" => "υ",
|
119
|
+
"Phi" => "Φ",
|
120
|
+
"phi" => "φ",
|
121
|
+
"Chi" => "Χ",
|
122
|
+
"chi" => "χ",
|
123
|
+
"acutex" => "𝑥́",
|
124
|
+
"Psi" => "Ψ",
|
125
|
+
"psi" => "ψ",
|
126
|
+
"tau" => "τ",
|
127
|
+
"Omega" => "Ω",
|
128
|
+
"omega" => "ω",
|
129
|
+
"piv" => "ϖ",
|
130
|
+
"partial" => "∂",
|
131
|
+
"alefsym" => "ℵ",
|
132
|
+
"ETH" => "Ð",
|
133
|
+
"eth" => "ð",
|
134
|
+
"THORN" => "Þ",
|
135
|
+
"thorn" => "þ",
|
136
|
+
"dots" => "…",
|
137
|
+
"hellip" => "…",
|
138
|
+
"middot" => "·",
|
139
|
+
"iexcl" => "¡",
|
140
|
+
"iquest" => "¿",
|
141
|
+
"shy" => "",
|
142
|
+
"ndash" => "–",
|
143
|
+
"mdash" => "—",
|
144
|
+
"quot" => "\"",
|
145
|
+
"acute" => "´",
|
146
|
+
"ldquo" => "“",
|
147
|
+
"rdquo" => "”",
|
148
|
+
"bdquo" => "„",
|
149
|
+
"lsquo" => "‘",
|
150
|
+
"rsquo" => "’",
|
151
|
+
"sbquo" => "‚",
|
152
|
+
"laquo" => "«",
|
153
|
+
"raquo" => "»",
|
154
|
+
"lsaquo" => "‹",
|
155
|
+
"rsaquo" => "›",
|
156
|
+
"circ" => "ˆ",
|
157
|
+
"vert" => "|",
|
158
|
+
"brvbar" => "¦",
|
159
|
+
"sect" => "§",
|
160
|
+
"amp" => "&",
|
161
|
+
"lt" => "<",
|
162
|
+
"gt" => ">",
|
163
|
+
"tilde" => "~",
|
164
|
+
"slash" => "/",
|
165
|
+
"plus" => "+",
|
166
|
+
"under" => "_",
|
167
|
+
"equal" => "=",
|
168
|
+
"asciicirc" => "^",
|
169
|
+
"dagger" => "†",
|
170
|
+
"Dagger" => "‡",
|
171
|
+
"nbsp" => " ",
|
172
|
+
"ensp" => " ",
|
173
|
+
"emsp" => " ",
|
174
|
+
"thinsp" => " ",
|
175
|
+
"curren" => "¤",
|
176
|
+
"cent" => "¢",
|
177
|
+
"pound" => "£",
|
178
|
+
"yen" => "¥",
|
179
|
+
"euro" => "€",
|
180
|
+
"EUR" => "€",
|
181
|
+
"EURdig" => "€",
|
182
|
+
"EURhv" => "€",
|
183
|
+
"EURcr" => "€",
|
184
|
+
"EURtm" => "€",
|
185
|
+
"copy" => "©",
|
186
|
+
"reg" => "®",
|
187
|
+
"trade" => "™",
|
188
|
+
"minus" => "−",
|
189
|
+
"pm" => "±",
|
190
|
+
"plusmn" => "±",
|
191
|
+
"times" => "×",
|
192
|
+
"frasl" => "⁄",
|
193
|
+
"div" => "÷",
|
194
|
+
"frac12" => "½",
|
195
|
+
"frac14" => "¼",
|
196
|
+
"frac34" => "¾",
|
197
|
+
"permil" => "‰",
|
198
|
+
"sup1" => "¹",
|
199
|
+
"sup2" => "²",
|
200
|
+
"sup3" => "³",
|
201
|
+
"radic" => "√",
|
202
|
+
"sum" => "∑",
|
203
|
+
"prod" => "∏",
|
204
|
+
"micro" => "µ",
|
205
|
+
"macr" => "¯",
|
206
|
+
"deg" => "°",
|
207
|
+
"prime" => "′",
|
208
|
+
"Prime" => "″",
|
209
|
+
"infin" => "∞",
|
210
|
+
"infty" => "∞",
|
211
|
+
"prop" => "∝",
|
212
|
+
"proptp" => "∝",
|
213
|
+
"not" => "¬",
|
214
|
+
"neg" => "¬",
|
215
|
+
"land" => "∧",
|
216
|
+
"wedge" => "∧",
|
217
|
+
"lor" => "∨",
|
218
|
+
"vee" => "∨",
|
219
|
+
"cap" => "∩",
|
220
|
+
"cup" => "∪",
|
221
|
+
"int" => "∫",
|
222
|
+
"there4" => "∴",
|
223
|
+
"sim" => "∼",
|
224
|
+
"cong" => "≅",
|
225
|
+
"simeq" => "≅",
|
226
|
+
"asymp" => "≈",
|
227
|
+
"approx" => "≈",
|
228
|
+
"ne" => "≠",
|
229
|
+
"neq" => "≠",
|
230
|
+
"equiv" => "≡",
|
231
|
+
"le" => "≤",
|
232
|
+
"ge" => "≥",
|
233
|
+
"sub" => "⊂",
|
234
|
+
"subset" => "⊂",
|
235
|
+
"sup" => "⊃",
|
236
|
+
"supset" => "⊃",
|
237
|
+
"nsub" => "⊄",
|
238
|
+
"sube" => "⊆",
|
239
|
+
"nsup" => "⊅",
|
240
|
+
"supe" => "⊇",
|
241
|
+
"forall" => "∀",
|
242
|
+
"exist" => "∃",
|
243
|
+
"exists" => "∃",
|
244
|
+
"empty" => "∅",
|
245
|
+
"emptyset" => "∅",
|
246
|
+
"isin" => "∈",
|
247
|
+
"in" => "∈",
|
248
|
+
"notin" => "∉",
|
249
|
+
"ni" => "∋",
|
250
|
+
"nabla" => "∇",
|
251
|
+
"ang" => "∠",
|
252
|
+
"angle" => "∠",
|
253
|
+
"perp" => "⊥",
|
254
|
+
"sdot" => "⋅",
|
255
|
+
"cdot" => "⋅",
|
256
|
+
"lceil" => "⌈",
|
257
|
+
"rceil" => "⌉",
|
258
|
+
"lfloor" => "⌊",
|
259
|
+
"rfloor" => "⌋",
|
260
|
+
"lang" => "⟨",
|
261
|
+
"rang" => "⟩",
|
262
|
+
"larr" => "←",
|
263
|
+
"leftarrow" => "←",
|
264
|
+
"gets" => "←",
|
265
|
+
"lArr" => "⇐",
|
266
|
+
"Leftarrow" => "⇐",
|
267
|
+
"uarr" => "↑",
|
268
|
+
"uparrow" => "↑",
|
269
|
+
"uArr" => "⇑",
|
270
|
+
"Uparrow" => "⇑",
|
271
|
+
"rarr" => "→",
|
272
|
+
"to" => "→",
|
273
|
+
"rightarrow" => "→",
|
274
|
+
"rArr" => "⇒",
|
275
|
+
"Rightarrow" => "⇒",
|
276
|
+
"darr" => "↓",
|
277
|
+
"downarrow" => "↓",
|
278
|
+
"dArr" => "⇓",
|
279
|
+
"Downarrow" => "⇓",
|
280
|
+
"harr" => "↔",
|
281
|
+
"leftrightarrow" => "↔",
|
282
|
+
"hArr" => "⇔",
|
283
|
+
"Leftrightarrow" => "⇔",
|
284
|
+
"crarr" => "↵",
|
285
|
+
"hookleftarrow" => "↵",
|
286
|
+
"arccos" => "arccos",
|
287
|
+
"arcsin" => "arcsin",
|
288
|
+
"arctan" => "arctan",
|
289
|
+
"arg" => "arg",
|
290
|
+
"cos" => "cos",
|
291
|
+
"cosh" => "cosh",
|
292
|
+
"cot" => "cot",
|
293
|
+
"coth" => "coth",
|
294
|
+
"csc" => "csc",
|
295
|
+
"deg" => "deg",
|
296
|
+
"det" => "det",
|
297
|
+
"dim" => "dim",
|
298
|
+
"exp" => "exp",
|
299
|
+
"gcd" => "gcd",
|
300
|
+
"hom" => "hom",
|
301
|
+
"inf" => "inf",
|
302
|
+
"ker" => "ker",
|
303
|
+
"lg" => "lg",
|
304
|
+
"lim" => "lim",
|
305
|
+
"liminf" => "liminf",
|
306
|
+
"limsup" => "limsup",
|
307
|
+
"ln" => "ln",
|
308
|
+
"log" => "log",
|
309
|
+
"max" => "max",
|
310
|
+
"min" => "min",
|
311
|
+
"Pr" => "Pr",
|
312
|
+
"sec" => "sec",
|
313
|
+
"sin" => "sin",
|
314
|
+
"sinh" => "sinh",
|
315
|
+
"sup" => "sup",
|
316
|
+
"tan" => "tan",
|
317
|
+
"tanh" => "tanh",
|
318
|
+
"bull" => "•",
|
319
|
+
"bullet" => "•",
|
320
|
+
"star" => "⋆",
|
321
|
+
"lowast" => "∗",
|
322
|
+
"ast" => "*",
|
323
|
+
"odot" => "ʘ",
|
324
|
+
"oplus" => "⊕",
|
325
|
+
"otimes" => "⊗",
|
326
|
+
"checkmark" => "✓",
|
327
|
+
"para" => "¶",
|
328
|
+
"ordf" => "ª",
|
329
|
+
"ordm" => "º",
|
330
|
+
"cedil" => "¸",
|
331
|
+
"oline" => "‾",
|
332
|
+
"uml" => "¨",
|
333
|
+
"zwnj" => "",
|
334
|
+
"zwj" => "",
|
335
|
+
"lrm" => "",
|
336
|
+
"rlm" => "",
|
337
|
+
"smile" => "⌣",
|
338
|
+
"smiley" => "☺",
|
339
|
+
"blacksmile" => "☻",
|
340
|
+
"sad" => "☹",
|
341
|
+
"clubs" => "♣",
|
342
|
+
"clubsuit" => "♣",
|
343
|
+
"spades" => "♠",
|
344
|
+
"spadesuit" => "♠",
|
345
|
+
"hearts" => "♥",
|
346
|
+
"heartsuit" => "♥",
|
347
|
+
"diams" => "♦",
|
348
|
+
"diamondsuit" => "♦",
|
349
|
+
"Diamond" => "⋄",
|
350
|
+
"loz" => "◊"
|
351
|
+
}
|
352
|
+
@org_entities_regexp = /\\(there4|sup[123]|frac[13][24]|[a-zA-Z]+)($|\{\}|[^a-zA-Z])/
|
353
|
+
|
354
|
+
def Orgmode.special_symbols_to_textile str
|
355
|
+
str.gsub! @org_entities_regexp do |match|
|
356
|
+
if TextileEntities[$1]
|
357
|
+
if $2 == "{}" then "#{TextileEntities[$1]}"
|
358
|
+
else "#{TextileEntities[$1]}#{$2}"
|
359
|
+
end
|
360
|
+
else
|
361
|
+
$&
|
362
|
+
end
|
363
|
+
end
|
345
364
|
end
|
346
365
|
end # module Orgmode
|