generic text markup tools
Rev. | 18f5a22b3e7afc176d2ee7728b80e351060a9822 |
---|---|
Size | 7,604 bytes |
Time | 2013-09-01 22:26:08 |
Author | hylom |
Log Message | update jarkup.json: enable textlink in table
|
{
"globalIdentifier": "^☆([_A-Za-z0-9]+?):\\s*(.*)$",
"usePlugins": [
"imagetools"
],
"rules": {
"toEntity": {
"lt": {
"priority": 1000,
"regexp": "<",
"replace": "<"
},
"gt": {
"priority": 1001,
"regexp": ">",
"replace": ">"
},
"amp": {
"priority": 1010,
"regexp": "&",
"replace": "&"
}
},
"fontDecoration": {
"red1": {
"priority": 102,
"regexp": "\\*g\\[(.*?)]",
"replace": "<strong class=\"color-red\">\\1</strong>"
},
"bold2": {
"priority": 103,
"regexp": "\\*b\\{(.*?)}",
"replace": "<strong>\\1</strong>"
},
"red2": {
"priority": 104,
"regexp": "\\*g\\{(.*?)}",
"replace": "<strong class=\"color-red\">\\1</strong>"
},
"bold1": {
"priority": 105,
"regexp": "\\*b\\[(.*?)]",
"replace": "<strong>\\1</strong>"
}
},
"inline": {
"textLink": {
"priority": 100,
"regexp": "\\*\\[(https?:/[^ ]*?)\\s+(.*?)]",
"replace": "<a href=\"\\1\">\\2</a>"
},
"rawLink": {
"priority": 101,
"regexp": "\\*\\[(https?:/[^ ]*?)]",
"replace": "<a href=\"\\1\">\\1</a>"
},
"refference": {
"priority": 102,
"regexp": "\\*(図|表|リスト|実行例)([0-9A-Za-z、]+)",
"replace": "<strong>\\1\\2</strong>"
}
}
},
"modes": {
"global": {
"rules": {
"header2": {
"priority": 102,
"regexp": "^○(.*)$",
"replace": "<h4>\\1</h4>"
},
"header1": {
"priority": 101,
"regexp": "^●(.*)$",
"replace": "<h3>\\1</h3>"
},
"paragraph": {
"priority": 100,
"regexp": "^( .*)$",
"apply": "inline",
"replace": "<p>\\1</p>"
},
"horizontal": {
"priority": 99,
"regexp": "^☆----",
"replace": "<hr>"
}
},
"transitions": [
"figure",
"code",
"langCode",
"table",
"unOrderdList",
"note",
"comment",
"codeList"
]
},
"unOrderdList": {
"rules": {
"listItem": {
"priority": 100,
"regexp": "^・(.*)$",
"replace": "<li>\\1</li>",
"apply": "inline"
}
},
"begin": "^・",
"end": "^\\s*$",
"onStart": {
"insert": "<ul>\n"
},
"onFinished": {
"insert": "</ul>\n"
}
},
"table": {
"includeRule": ["inline", "fontDecoration", "toEntity" ],
"rules": {
"tableRow": {
"priority": 102,
"regexp": "^(.*)$",
"replace": "<tr>\n <td>\\1</td>\n</tr>"
},
"caption": {
"priority": 110,
"regexp": "^☆表([0-9]+)\\s+(.*)$",
"continue": false,
"store": [
"ref",
"caption"
],
"replace": "<div class=\"table\"><table>\n<caption>表\\1 \\2</caption>"
},
"tableHeaderRow": {
"priority": 104,
"regexp": "^〓(.*)$",
"set": [
"isHeader",
"yes"
],
"replace": "<tr>\n <th>\\1</th>\n</tr>"
},
"tableCell": {
"priority": 103,
"regexp": "\\t",
"switch": {
"isHeader": {
"yes": {
"unset": "isHeader",
"replace": "</th><th>"
}
}
},
"replace": "</td><td>"
}
},
"begin": "^☆表.*",
"end": "^\\s*$",
"onFinished": {
"insert": "</table></div>\n"
}
},
"code": {
"includeRule": ["fontDecoration", "toEntity"],
"begin": "^☆\\+---\\s*$",
"end": "^☆\\+---\\s*$",
"onStart": {
"insert": "<pre>",
"replace": ""
},
"onFinished": {
"insert": "</pre>",
"replace": ""
}
},
"langCode": {
"includeRule": ["fontDecoration", "toEntity"],
"begin": "^☆\\+---\\((.*)\\)\\s*$",
"end": "^☆\\+---\\s*$",
"onStart": {
"insert": "<pre>",
"replace": ""
},
"onFinished": {
"insert": "</pre>",
"replace": ""
}
},
"codeList": {
"includeRule": ["fontDecoration", "toEntity"],
"begin": "^☆リスト.*$",
"end": "^☆\\+---\\s*$",
"onFinished": {
"insert": "</pre></figure>",
"replace": ""
},
"rules": {
"caption": {
"priority": 100,
"regexp": "^☆リスト([0-9]+)\\s+(.*)$",
"continue": false,
"replace": "<figure class=\"list\"><figcaption>リスト\\1 \\2</figcaption>\n<pre>"
}
}
},
"figure": {
"rules": {
"imageFile": {
"priority": 101,
"regexp": "^<(.*)>$",
"continue": false,
"call": ["imagetools.getImageGeometry", "${image_dir}/$1"],
"replace": "<figure style=\"width:${width}px;\">\n<a href=\"${image_dir}/\\1\" target=\"_blank\"><img src=\"${image_dir}/\\1\" alt=\"図$ref $caption\" width=\"${width}\" height=\"${height}\"></a><figcaption>図$ref $caption</figcaption>"
},
"caption": {
"priority": 100,
"regexp": "^☆図([0-9]+)\\s+(.*)$",
"continue": false,
"store": [
"ref",
"caption"
],
"replace": ""
}
},
"begin": "^☆図.*$",
"end": "^\\s*$",
"onFinished": {
"insert": "</figure>\n"
}
},
"comment": {
"begin": "^☆comment\\s*$",
"end": "^☆comment-end\\s*$",
"rules": {
"caption": {
"priority": 100,
"regexp": "^.*$",
"replace": ""
}
},
"onFinished": {
"replace": ""
}
},
"note": {
"extends": "global",
"transitions": [
"figure",
"code",
"langCode",
"table",
"unOrderdList",
"comment",
"codeList"
],
"begin": "^☆note\\s*(.*)$",
"end": "^☆note-end\\s*$",
"onStart": {
"insert": "<div class=\"note\">\n"
},
"onFinished": {
"insert": "</div>",
"replace": ""
},
"rules": {
"title": {
"priority": 101,
"regexp": "^☆note\\s+(.*)$",
"replace": "<h5>\\1</h5>"
},
"noTitle": {
"priority": 100,
"regexp": "^☆note\\s*$",
"replace": ""
}
}
},
"inline": {
"includeRule": ["fontDecoration", "toEntity"],
"rules": {
"textLink": {
"priority": 100,
"regexp": "\\*\\[(https?:/[^ ]*?)\\s+(.*?)]",
"replace": "<a href=\"\\1\">\\2</a>"
},
"rawLink": {
"priority": 101,
"regexp": "\\*\\[(https?:/[^ ]*?)]",
"replace": "<a href=\"\\1\">\\1</a>"
},
"refference": {
"priority": 102,
"regexp": "\\*(図|表|リスト|実行例)([0-9A-Za-z、]+)",
"replace": "<strong>\\1\\2</strong>"
}
}
}
},
"blockDevider": "\n",
"globalVariables": [
"image_dir", ".",
"defaultFigureWidth", "480"
]
}