• R/O
  • HTTP
  • SSH
  • HTTPS

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

generic text markup tools


File Info

Rev. e71c5437fee0c1932c6edae26bc1b8c5baee8034
Tamanho 9,352 bytes
Hora 2017-12-21 03:22:53
Autor hylom
Mensagem de Log

jarkup.json: add math related modes

Content

{
  "globalIdentifier": "^☆([_A-Za-z0-9]+?):\\s*(.*)$", 
  "usePlugins": [
    "imagetools"
  ],
  "rules": {
    "toEntity": {
      "lt": {
        "priority": 1000,
        "regexp": "<",
        "replace": "&lt;"
      },
      "gt": {
        "priority": 1001,
        "regexp": ">",
        "replace": "&gt;"
      },
      "amp": {
        "priority": 1010,
        "regexp": "&",
        "replace": "&amp;"
      }        
    },
    "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",
        "orderdList",
        "note",
        "comment",
        "codeList",
        "mathBlock"
      ]
    }, 
    "orderdList": {
      "rules": {
        "listItem": {
          "priority": 100, 
          "regexp": "^[0-9]+\\.\\s+(.*)$",
          "replace": "<li>\\1</li>",
          "apply": "inline"
        }
      },
      "begin": "^[0-9]+\\.\\s+", 
      "end": "^\\s*$",
      "onStart": {
        "insert": "<ol>\n"
      },
      "onFinished": {
        "insert": "</ol>\n"
      }
    }, 
    "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",
        "orderdList",
        "comment",
        "codeList",
        "mathBlock"
      ],
      "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": ""
        }
      }
    },
    "mathBlock": {
      "rules": {
        "mathSub1": {
          "priority": 112,
          "regexp": "_([ -~])",
          "replace": "<sub>\\1</sub>"
        },
        "mathSub2": {
          "priority": 113,
          "regexp": "_\\{([ -~]+)}",
          "replace": "<sub>\\1</sub>"
        }
      },
      "begin": "^☆=---\\s*$", 
      "end": "^☆=---\\s*$", 
      "onStart": {
        "insert": "<pre style='font-family: serif; font-style: italic;'>",
        "replace": ""
      },
      "onFinished": {
        "insert": "</pre>",
        "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>"
        },
        "math": {
          "priority": 120,
          "regexp": "=\\{([ -~]*)}",
          "replace": "<span style='font-family: serif;'><i>\\1</i></span>"
        },
        "boldmath": {
          "priority": 121,
          "regexp": "=b\\{([ -~]*)}",
          "replace": "<span style='font-family: serif;'><strong><i>\\1</i></strong></span>"
        },
        "mathSub1": {
          "priority": 110,
          "regexp": "<i>(.*?)_([ -~])(.*?)</i>",
          "replace": "<i>\\1<sub>\\2</sub>\\3</i>"
        },
        "mathSub2": {
          "priority": 111,
          "regexp": "<i>(.*?)_\\{([ -~]+?)}(.*?)</i>",
          "replace": "<i>\\1<sub>\\2</sub>\\3</i>"
        }
      }
    }
  }, 
  "blockDevider": "\n", 
  "globalVariables": [
    "image_dir", ".",
    "defaultFigureWidth", "480"
  ]
}