krz/orgo
Lightning fast org-mode static site generator.
clone: git clone https://gitbay.org/krz/orgo.git
v0.22.0: src/entities.rs · raw
1//! Org's entity table: `\\alpha` and friends, name to HTML.
2//!
3//! Generated from Emacs' own `org-entities` — the table is long, arbitrary and exactly
4//! what a reader's file will contain, so copying it by hand would be a slow way to
5//! introduce typos. Regenerate with:
6//!
7//! ```sh
8//! emacs --batch --eval '(progn (require (quote org)) \
9//! (dolist (e org-entities) (when (and (listp e) (nth 3 e)) \
10//! (princ (format "%s\t%s\n" (nth 0 e) (nth 3 e))))))'
11//! ```
12//!
13//! The HTML column is used rather than the UTF-8 one, so output matches what Emacs
14//! writes for the same source.
15
16/// `(name, html)` for every entity org knows, sorted by name.
17pub const ENTITIES: &[(&str, &str)] = &[
18 ("AA", "Å"),
19 ("AElig", "Æ"),
20 ("Aacute", "Á"),
21 ("Acirc", "Â"),
22 ("Agrave", "À"),
23 ("Alpha", "Α"),
24 ("Amacr", "Ā"),
25 ("Aring", "Å"),
26 ("Atilde", "Ã"),
27 ("Auml", "Ä"),
28 ("Beta", "Β"),
29 ("Ccedil", "Ç"),
30 ("Chi", "Χ"),
31 ("Dagger", "‡"),
32 ("Delta", "Δ"),
33 ("Diamond", "⋄"),
34 ("Downarrow", "⇓"),
35 ("ETH", "Ð"),
36 ("EUR", "€"),
37 ("Eacute", "É"),
38 ("Ecirc", "Ê"),
39 ("Egrave", "È"),
40 ("Epsilon", "Ε"),
41 ("Eta", "Η"),
42 ("Euml", "Ë"),
43 ("Gamma", "Γ"),
44 ("Gg", "⋙"),
45 ("Iacute", "Í"),
46 ("Icirc", "Î"),
47 ("Idot", "&idot;"),
48 ("Igrave", "Ì"),
49 ("Iota", "Ι"),
50 ("Iuml", "Ï"),
51 ("Kappa", "Κ"),
52 ("Lambda", "Λ"),
53 ("Leftarrow", "⇐"),
54 ("Leftrightarrow", "⇔"),
55 ("Ll", "⋘"),
56 ("Mu", "Μ"),
57 ("Ntilde", "Ñ"),
58 ("Nu", "Ν"),
59 ("OElig", "Œ"),
60 ("Oacute", "Ó"),
61 ("Ocirc", "Ô"),
62 ("Ograve", "Ò"),
63 ("Omega", "Ω"),
64 ("Omicron", "Ο"),
65 ("Oslash", "Ø"),
66 ("Otilde", "Õ"),
67 ("Ouml", "Ö"),
68 ("P", "¶"),
69 ("Phi", "Φ"),
70 ("Pi", "Π"),
71 ("Pr", "Pr"),
72 ("Prime", "″"),
73 ("Psi", "Ψ"),
74 ("Rho", "Ρ"),
75 ("Rightarrow", "⇒"),
76 ("S", "§"),
77 ("Scaron", "Š"),
78 ("Sigma", "Σ"),
79 ("THORN", "Þ"),
80 ("Tau", "Τ"),
81 ("Theta", "Θ"),
82 ("USD", "$"),
83 ("Uacute", "Ú"),
84 ("Ucirc", "Û"),
85 ("Ugrave", "Ù"),
86 ("Uparrow", "⇑"),
87 ("Upsilon", "Υ"),
88 ("Uuml", "Ü"),
89 ("Xi", "Ξ"),
90 ("Yacute", "Ý"),
91 ("Yuml", "Ÿ"),
92 ("Zeta", "Ζ"),
93 ("_ ", " "),
94 ("_ ", "  "),
95 ("_ ", "   "),
96 ("_ ", "    "),
97 ("_ ", "     "),
98 ("_ ", "      "),
99 ("_ ", "       "),
100 ("_ ", "        "),
101 ("_ ", "         "),
102 ("_ ", "          "),
103 ("_ ", "           "),
104 ("_ ", "            "),
105 ("_ ", "             "),
106 ("_ ", "              "),
107 ("_ ", "               "),
108 ("_ ", "                "),
109 ("_ ", "                 "),
110 ("_ ", "                  "),
111 ("_ ", "                   "),
112 ("_ ", "                    "),
113 ("aacute", "á"),
114 ("acirc", "â"),
115 ("acute", "´"),
116 ("acutex", "´x"),
117 ("aelig", "æ"),
118 ("agrave", "à"),
119 ("alefsym", "ℵ"),
120 ("aleph", "ℵ"),
121 ("alpha", "α"),
122 ("amacr", "ā"),
123 ("amp", "&"),
124 ("ang", "∠"),
125 ("angle", "∠"),
126 ("approx", "≈"),
127 ("arccos", "arccos"),
128 ("arcsin", "arcsin"),
129 ("arctan", "arctan"),
130 ("arg", "arg"),
131 ("aring", "å"),
132 ("asciicirc", "^"),
133 ("ast", "∗"),
134 ("asymp", "≈"),
135 ("atilde", "ã"),
136 ("auml", "ä"),
137 ("bdquo", "„"),
138 ("because", "∵"),
139 ("beta", "β"),
140 ("beth", "ℶ"),
141 ("blacksmile", "☻"),
142 ("brvbar", "¦"),
143 ("bull", "•"),
144 ("bullet", "•"),
145 ("cap", "∩"),
146 ("ccedil", "ç"),
147 ("cdot", "⋅"),
148 ("cdots", "⋯"),
149 ("cedil", "¸"),
150 ("cent", "¢"),
151 ("check", "✓"),
152 ("checkmark", "✓"),
153 ("chi", "χ"),
154 ("circ", "ˆ"),
155 ("clubs", "♣"),
156 ("clubsuit", "♣"),
157 ("colon", ":"),
158 ("cong", "≅"),
159 ("copy", "©"),
160 ("cos", "cos"),
161 ("cosh", "cosh"),
162 ("cot", "cot"),
163 ("coth", "coth"),
164 ("crarr", "↵"),
165 ("csc", "csc"),
166 ("cup", "∪"),
167 ("curren", "¤"),
168 ("dArr", "⇓"),
169 ("dag", "†"),
170 ("dagger", "†"),
171 ("dalet", "ℸ"),
172 ("darr", "↓"),
173 ("ddag", "‡"),
174 ("deg", "°"),
175 ("delta", "δ"),
176 ("det", "det"),
177 ("diamond", "⋄"),
178 ("diamondsuit", "♦"),
179 ("diams", "♦"),
180 ("dim", "dim"),
181 ("div", "÷"),
182 ("dollar", "$"),
183 ("dots", "…"),
184 ("downarrow", "↓"),
185 ("eacute", "é"),
186 ("ecirc", "ê"),
187 ("egrave", "è"),
188 ("ell", "ℓ"),
189 ("empty", "∅"),
190 ("emptyset", "∅"),
191 ("emsp", " "),
192 ("ensp", " "),
193 ("epsilon", "ε"),
194 ("equal", "="),
195 ("equiv", "≡"),
196 ("eta", "η"),
197 ("eth", "ð"),
198 ("euml", "ë"),
199 ("euro", "€"),
200 ("exist", "∃"),
201 ("exists", "∃"),
202 ("exp", "exp"),
203 ("fnof", "ƒ"),
204 ("forall", "∀"),
205 ("frac12", "½"),
206 ("frac14", "¼"),
207 ("frac34", "¾"),
208 ("frasl", "⁄"),
209 ("frown", "⌢"),
210 ("frowny", "☹"),
211 ("gamma", "γ"),
212 ("gcd", "gcd"),
213 ("ge", "≥"),
214 ("geq", "≥"),
215 ("gets", "←"),
216 ("gg", "≫"),
217 ("ggg", "⋙"),
218 ("gimel", "ℷ"),
219 ("gt", ">"),
220 ("hArr", "⇔"),
221 ("harr", "↔"),
222 ("hbar", "ℏ"),
223 ("hearts", "♥"),
224 ("heartsuit", "♥"),
225 ("hellip", "…"),
226 ("hom", "hom"),
227 ("hookleftarrow", "↵"),
228 ("iacute", "í"),
229 ("icirc", "î"),
230 ("iexcl", "¡"),
231 ("igrave", "ì"),
232 ("image", "ℑ"),
233 ("imath", "ı"),
234 ("in", "∈"),
235 ("inf", "inf"),
236 ("infin", "∞"),
237 ("infty", "∞"),
238 ("inodot", "ı"),
239 ("int", "∫"),
240 ("iota", "ι"),
241 ("iquest", "¿"),
242 ("isin", "∈"),
243 ("iuml", "ï"),
244 ("jmath", "ȷ"),
245 ("kappa", "κ"),
246 ("ker", "ker"),
247 ("lArr", "⇐"),
248 ("lambda", "λ"),
249 ("land", "∧"),
250 ("lang", "⟨"),
251 ("langle", "⟨"),
252 ("laquo", "«"),
253 ("larr", "←"),
254 ("lceil", "⌈"),
255 ("ldquo", "“"),
256 ("le", "≤"),
257 ("leftarrow", "←"),
258 ("leftrightarrow", "↔"),
259 ("leq", "≤"),
260 ("lesseqgtr", "⋚"),
261 ("lessgtr", "≶"),
262 ("lfloor", "⌊"),
263 ("lg", "lg"),
264 ("lim", "lim"),
265 ("liminf", "liminf"),
266 ("limsup", "limsup"),
267 ("ll", "≪"),
268 ("lll", "⋘"),
269 ("ln", "ln"),
270 ("log", "log"),
271 ("lor", "∨"),
272 ("lowast", "∗"),
273 ("loz", "◊"),
274 ("lrm", "‎"),
275 ("lsaquo", "‹"),
276 ("lsquo", "‘"),
277 ("lt", "<"),
278 ("macr", "¯"),
279 ("max", "max"),
280 ("mdash", "—"),
281 ("mho", "℧"),
282 ("micro", "µ"),
283 ("middot", "·"),
284 ("min", "min"),
285 ("minus", "−"),
286 ("mu", "μ"),
287 ("nabla", "∇"),
288 ("nbsp", " "),
289 ("ndash", "–"),
290 ("ne", "≠"),
291 ("neg", "¬"),
292 ("neq", "≠"),
293 ("nexist", "∃"),
294 ("nexists", "∃"),
295 ("ni", "∋"),
296 ("not", "¬"),
297 ("notin", "∉"),
298 ("nsub", "⊄"),
299 ("nsup", "⊅"),
300 ("ntilde", "ñ"),
301 ("nu", "ν"),
302 ("oacute", "ó"),
303 ("ocirc", "ô"),
304 ("odot", "o"),
305 ("oelig", "œ"),
306 ("ograve", "ò"),
307 ("oline", "‾"),
308 ("omega", "ω"),
309 ("omicron", "ο"),
310 ("oplus", "⊕"),
311 ("ordf", "ª"),
312 ("ordm", "º"),
313 ("oslash", "ø"),
314 ("otilde", "õ"),
315 ("otimes", "⊗"),
316 ("ouml", "ö"),
317 ("para", "¶"),
318 ("parallel", "∥"),
319 ("partial", "∂"),
320 ("permil", "‰"),
321 ("perp", "⊥"),
322 ("phi", "φ"),
323 ("pi", "π"),
324 ("piv", "ϖ"),
325 ("plus", "+"),
326 ("plusmn", "±"),
327 ("pm", "±"),
328 ("pound", "£"),
329 ("prec", "≺"),
330 ("preccurlyeq", "≼"),
331 ("preceq", "≼"),
332 ("prime", "′"),
333 ("prod", "∏"),
334 ("prop", "∝"),
335 ("propto", "∝"),
336 ("psi", "ψ"),
337 ("quot", """),
338 ("rArr", "⇒"),
339 ("radic", "√"),
340 ("rang", "⟩"),
341 ("rangle", "⟩"),
342 ("raquo", "»"),
343 ("rarr", "→"),
344 ("rceil", "⌉"),
345 ("rdquo", "”"),
346 ("real", "ℜ"),
347 ("reg", "®"),
348 ("rfloor", "⌋"),
349 ("rho", "ρ"),
350 ("rightarrow", "→"),
351 ("rlm", "‏"),
352 ("rsaquo", "›"),
353 ("rsquo", "’"),
354 ("sad", "☹"),
355 ("sbquo", "‚"),
356 ("scaron", "š"),
357 ("sdot", "⋅"),
358 ("sec", "sec"),
359 ("sect", "§"),
360 ("setminus", "∖"),
361 ("shy", "­"),
362 ("sigma", "σ"),
363 ("sigmaf", "ς"),
364 ("sim", "∼"),
365 ("simeq", "≅"),
366 ("sin", "sin"),
367 ("sinh", "sinh"),
368 ("slash", "/"),
369 ("smile", "⌣"),
370 ("smiley", "☺"),
371 ("spades", "♠"),
372 ("spadesuit", "♠"),
373 ("star", "*"),
374 ("sub", "⊂"),
375 ("sube", "⊆"),
376 ("subset", "⊂"),
377 ("succ", "≻"),
378 ("succcurlyeq", "≽"),
379 ("succeq", "≽"),
380 ("sum", "∑"),
381 ("sup", "⊃"),
382 ("sup1", "¹"),
383 ("sup2", "²"),
384 ("sup3", "³"),
385 ("supe", "⊇"),
386 ("supset", "⊃"),
387 ("szlig", "ß"),
388 ("tan", "tan"),
389 ("tanh", "tanh"),
390 ("tau", "τ"),
391 ("there4", "∴"),
392 ("therefore", "∴"),
393 ("theta", "θ"),
394 ("thetasym", "ϑ"),
395 ("thinsp", " "),
396 ("thorn", "þ"),
397 ("tilde", "~"),
398 ("times", "×"),
399 ("to", "→"),
400 ("trade", "™"),
401 ("triangleq", "≜"),
402 ("uArr", "⇑"),
403 ("uacute", "ú"),
404 ("uarr", "↑"),
405 ("ucirc", "û"),
406 ("ugrave", "ù"),
407 ("uml", "¨"),
408 ("under", "_"),
409 ("uparrow", "↑"),
410 ("upsih", "ϒ"),
411 ("upsilon", "υ"),
412 ("uuml", "ü"),
413 ("varepsilon", "ε"),
414 ("varphi", "ϕ"),
415 ("varpi", "ϖ"),
416 ("varsigma", "ς"),
417 ("vartheta", "ϑ"),
418 ("vbar", "|"),
419 ("vee", "∨"),
420 ("vert", "|"),
421 ("wedge", "∧"),
422 ("weierp", "℘"),
423 ("xi", "ξ"),
424 ("yacute", "ý"),
425 ("yen", "¥"),
426 ("yuml", "ÿ"),
427 ("zeta", "ζ"),
428 ("zwj", "‍"),
429 ("zwnj", "‌"),
430];
431
432/// The HTML for `\name`, if org knows it.
433pub fn lookup(name: &str) -> Option<&'static str> {
434 ENTITIES
435 .binary_search_by(|(n, _)| (*n).cmp(name))
436 .ok()
437 .map(|i| ENTITIES[i].1)
438}