generic text markup tools
Revisão | e71c5437fee0c1932c6edae26bc1b8c5baee8034 (tree) |
---|---|
Hora | 2017-12-21 03:22:53 |
Autor | hylom <hylom@hylo...> |
Commiter | hylom |
jarkup.json: add math related modes
@@ -92,11 +92,31 @@ | ||
92 | 92 | "langCode", |
93 | 93 | "table", |
94 | 94 | "unOrderdList", |
95 | + "orderdList", | |
95 | 96 | "note", |
96 | 97 | "comment", |
97 | - "codeList" | |
98 | + "codeList", | |
99 | + "mathBlock" | |
98 | 100 | ] |
99 | 101 | }, |
102 | + "orderdList": { | |
103 | + "rules": { | |
104 | + "listItem": { | |
105 | + "priority": 100, | |
106 | + "regexp": "^[0-9]+\\.\\s+(.*)$", | |
107 | + "replace": "<li>\\1</li>", | |
108 | + "apply": "inline" | |
109 | + } | |
110 | + }, | |
111 | + "begin": "^[0-9]+\\.\\s+", | |
112 | + "end": "^\\s*$", | |
113 | + "onStart": { | |
114 | + "insert": "<ol>\n" | |
115 | + }, | |
116 | + "onFinished": { | |
117 | + "insert": "</ol>\n" | |
118 | + } | |
119 | + }, | |
100 | 120 | "unOrderdList": { |
101 | 121 | "rules": { |
102 | 122 | "listItem": { |
@@ -253,8 +273,10 @@ | ||
253 | 273 | "langCode", |
254 | 274 | "table", |
255 | 275 | "unOrderdList", |
276 | + "orderdList", | |
256 | 277 | "comment", |
257 | - "codeList" | |
278 | + "codeList", | |
279 | + "mathBlock" | |
258 | 280 | ], |
259 | 281 | "begin": "^☆note\\s*(.*)$", |
260 | 282 | "end": "^☆note-end\\s*$", |
@@ -278,6 +300,30 @@ | ||
278 | 300 | } |
279 | 301 | } |
280 | 302 | }, |
303 | + "mathBlock": { | |
304 | + "rules": { | |
305 | + "mathSub1": { | |
306 | + "priority": 112, | |
307 | + "regexp": "_([ -~])", | |
308 | + "replace": "<sub>\\1</sub>" | |
309 | + }, | |
310 | + "mathSub2": { | |
311 | + "priority": 113, | |
312 | + "regexp": "_\\{([ -~]+)}", | |
313 | + "replace": "<sub>\\1</sub>" | |
314 | + } | |
315 | + }, | |
316 | + "begin": "^☆=---\\s*$", | |
317 | + "end": "^☆=---\\s*$", | |
318 | + "onStart": { | |
319 | + "insert": "<pre style='font-family: serif; font-style: italic;'>", | |
320 | + "replace": "" | |
321 | + }, | |
322 | + "onFinished": { | |
323 | + "insert": "</pre>", | |
324 | + "replace": "" | |
325 | + } | |
326 | + }, | |
281 | 327 | "inline": { |
282 | 328 | "includeRule": ["fontDecoration", "toEntity"], |
283 | 329 | "rules": { |
@@ -295,6 +341,26 @@ | ||
295 | 341 | "priority": 102, |
296 | 342 | "regexp": "\\*(図|表|リスト|実行例)([0-9A-Za-z、]+)", |
297 | 343 | "replace": "<strong>\\1\\2</strong>" |
344 | + }, | |
345 | + "math": { | |
346 | + "priority": 120, | |
347 | + "regexp": "=\\{([ -~]*)}", | |
348 | + "replace": "<span style='font-family: serif;'><i>\\1</i></span>" | |
349 | + }, | |
350 | + "boldmath": { | |
351 | + "priority": 121, | |
352 | + "regexp": "=b\\{([ -~]*)}", | |
353 | + "replace": "<span style='font-family: serif;'><strong><i>\\1</i></strong></span>" | |
354 | + }, | |
355 | + "mathSub1": { | |
356 | + "priority": 110, | |
357 | + "regexp": "<i>(.*?)_([ -~])(.*?)</i>", | |
358 | + "replace": "<i>\\1<sub>\\2</sub>\\3</i>" | |
359 | + }, | |
360 | + "mathSub2": { | |
361 | + "priority": 111, | |
362 | + "regexp": "<i>(.*?)_\\{([ -~]+?)}(.*?)</i>", | |
363 | + "replace": "<i>\\1<sub>\\2</sub>\\3</i>" | |
298 | 364 | } |
299 | 365 | } |
300 | 366 | } |