| 1 |
<?xml version="1.0" encoding="UTF-8"?> |
| 2 |
<!DOCTYPE language |
| 3 |
[ |
| 4 |
<!ENTITY listbullet "[\+\-]"> |
| 5 |
<!ENTITY checkbox "\[[ \-X]\](?=\s)"> |
| 6 |
<!-- links. --> |
| 7 |
<!ENTITY startlink "(?:(?:https?|ftp)\://|(?:file|docview|mailto|mhe|rmail|bbdb|irc|info)\:)"> |
| 8 |
<!ENTITY link "&startlink;[^">\s]+"> |
| 9 |
<!-- link in normal text. |
| 10 |
Using the implicitlink entity in markdown.xml for now. |
| 11 |
Actual doc: https://orgmode.org/guide/Hyperlinks.html --> |
| 12 |
<!ENTITY implicitlink "\b&startlink;[^">\s`\)]*[^\s!"'`\(\)\*,\.:;<>\?~\]\}\\](?=[[:punct:]]*(?:[\s\]]|$))"> |
| 13 |
<!-- org-emphasis-alist --> |
| 14 |
<!ENTITY contentregex_ast "(?:(?:[^\*\s\\]|\\.)(?:[^\\]|\\.)*)?(?:[^\*\s\\]|\\\S)"> |
| 15 |
<!ENTITY contentregex_und "(?:(?:[^_\s\\]|\\.)(?:[^\\]|\\.)*)?(?:[^_\s\\]|\\\S)"> |
| 16 |
<!ENTITY contentregex_itl "(?:(?:[^/\s\\]|\\.)(?:[^\\]|\\.)*)?(?:[^/\s\\]|\\\S)"> |
| 17 |
<!ENTITY contentregex_stk "(?:(?:[^+\s\\]|\\.)(?:[^\\]|\\.)*)?(?:[^+\s\\]|\\\S)"> |
| 18 |
<!ENTITY contentregex_cod "(?:(?:[^~\s\\]|\\.)(?:[^\\]|\\.)*)?(?:[^~\s\\]|\\\S)"> |
| 19 |
<!ENTITY contentregex_vbt "(?:(?:[^=\s\\]|\\.)(?:[^\\]|\\.)*)?(?:[^=\s\\]|\\\S)"> |
| 20 |
<!ENTITY contentregex_mco "(?:(?:[^\{\}\s\\]|\\.)(?:[^\\]|\\.)*)?(?:[^\{\}\s\\]|\\\S)"> |
| 21 |
<!ENTITY bold_regex "\*{1}(?:&contentregex_ast;\*{1})"> |
| 22 |
<!ENTITY underline_regex "\b_{1}(?:&contentregex_und;_{1})"> |
| 23 |
<!ENTITY italic_regex "[/]{1}(?:&contentregex_itl;[/]{1})"> |
| 24 |
<!ENTITY strike_regex "\+{1}(?:&contentregex_stk;\+{1})"> |
| 25 |
<!ENTITY inlinecode_regex "\~{1}(?:&contentregex_cod;\~{1})"> |
| 26 |
<!ENTITY verbatim_regex "\={1}(?:&contentregex_vbt;\={1})"> |
| 27 |
<!ENTITY macroreplacement_regex "\{{3}(?:&contentregex_mco;\}{3})"> |
| 28 |
<!-- [[plain-link]] --> |
| 29 |
<!ENTITY link_plain_regex "\[\[(?:[^\[\]]+)\]\]"> |
| 30 |
<!-- [[link][description]] --> |
| 31 |
<!ENTITY link_desc_regex "\[\[(?:[^\[\]]+)\]\[(?:[^\[\]]+)\]\]"> |
| 32 |
]> |
| 33 |
|
| 34 |
<!-- org syntax spec: https://orgmode.org/worg/dev/org-syntax.html --> |
| 35 |
<!-- syntax highlight: https://docs.kde.org/stable5/en/kate/katepart/highlight.html --> |
| 36 |
<language name="Org Mode" version="4" kateversion="5.79" section="Markup" extensions="*.org" priority="15" author="Gary Wang" license="MIT"> |
| 37 |
<highlighting> |
| 38 |
<list name="org-todo-keywords-todo"> |
| 39 |
<item>TODO</item> |
| 40 |
</list> |
| 41 |
<list name="org-todo-keywords-done"> |
| 42 |
<item>DONE</item> |
| 43 |
</list> |
| 44 |
<contexts> |
| 45 |
<context name="Normal Text" attribute="Normal Text" lineEndContext="#stay"> |
| 46 |
<DetectChar context="find-header" char="*" column="0" lookAhead="true"/> |
| 47 |
<RegExpr attribute="List" context="list" String="^(\s*)&listbullet;(\s+)" column="0"/> |
| 48 |
<RegExpr attribute="Number List" context="numlist" String="^(\s*)\d+(?:\.|\))(\s+)" column="0"/> |
| 49 |
<RegExpr attribute="Comment" String="^(\s*)# .*" column="0"/> |
| 50 |
<RegExpr attribute="Block" context="find-block" String="^#\+BEGIN(_\w+|:).*" beginRegion="RegionBlock" column="0"/> |
| 51 |
<RegExpr attribute="Babel" String="^(\s*)#\+[A-Z]+(?:\[[A-Z]+\])?:.*" column="0"/> |
| 52 |
<DetectChar context="find-bold-normal" char="*" lookAhead="true"/> |
| 53 |
<DetectChar context="find-underline-normal" char="_" lookAhead="true"/> |
| 54 |
<DetectChar context="find-italic-normal" char="/" lookAhead="true"/> |
| 55 |
<DetectChar context="find-strike-normal" char="+" lookAhead="true"/> |
| 56 |
<DetectChar context="find-inlinecode-normal" char="~" lookAhead="true"/> |
| 57 |
<DetectChar context="find-verbatim-normal" char="=" lookAhead="true"/> |
| 58 |
<DetectChar context="find-link-normal" char="[" lookAhead="true"/> |
| 59 |
<StringDetect context="find-macro-replacement" String="{{{" lookAhead="true"/> |
| 60 |
<RegExpr attribute="Normal Text: Link" String="&implicitlink;"/> |
| 61 |
</context> |
| 62 |
<context name="find-header" attribute="Normal Text" lineEndContext="#pop"> |
| 63 |
<RegExpr context="parse-header" String="^(?:\*){1,}\s+(?:([A-Z]+)\s+){0,1}(?:(\[#(?:[A-Z\d]+)\])\s+){0,1}(.*)\s*(\[[\d/%]+\]){0,1}\s*$" column="0" lookAhead="true"/> |
| 64 |
</context> |
| 65 |
<context name="parse-header" attribute="Heading" lineEndContext="#pop"> |
| 66 |
<RegExpr attribute="Heading" String="(?:\*){1,}\s+" lookAhead="false"/> |
| 67 |
<keyword String="org-todo-keywords-todo" attribute="Keyword Todo" context="#stay" /> |
| 68 |
<keyword String="org-todo-keywords-done" attribute="Keyword Done" context="#stay" /> |
| 69 |
<RegExpr attribute="Cookie: Priority" String="\[#(?:[A-Z\d]+)\]" lookAhead="false"/> |
| 70 |
<RegExpr attribute="Cookie: Statistics" String="\[[\d/%]+\]" lookAhead="false"/> |
| 71 |
</context> |
| 72 |
<context name="list" attribute="List: Normal Text" lineEndContext="#stay"> |
| 73 |
<RegExpr context="#pop" String="^\s*\S" column="0" lookAhead="true"/> |
| 74 |
<RegExpr attribute="List: Checkbox" String="\s*&checkbox;"/> |
| 75 |
</context> |
| 76 |
<context name="numlist" attribute="List: Normal Text" lineEndContext="#stay"> |
| 77 |
<RegExpr context="#pop" String="^\s*\S" column="0" lookAhead="true"/> |
| 78 |
<RegExpr attribute="List: Checkbox" String="\s*&checkbox;"/> |
| 79 |
</context> |
| 80 |
<context name="find-block" attribute="Block" lineEndContext="#stay"> |
| 81 |
<StringDetect context="#pop" attribute="Block" String="#+END%1" dynamic="true" endRegion="RegionBlock" column="0"/> |
| 82 |
</context> |
| 83 |
<context name="find-bold-normal" attribute="Normal Text" lineEndContext="#pop"> |
| 84 |
<RegExpr attribute="Bold Text" context="#pop" minimal="true" String="&bold_regex;"/> |
| 85 |
<DetectChar attribute="Normal Text" context="#pop" char="*"/> |
| 86 |
</context> |
| 87 |
<context name="find-underline-normal" attribute="Normal Text" lineEndContext="#pop"> |
| 88 |
<RegExpr attribute="Underline Text" context="#pop" minimal="true" String="&underline_regex;"/> |
| 89 |
<DetectChar attribute="Normal Text" context="#pop" char="_"/> |
| 90 |
</context> |
| 91 |
<context name="find-italic-normal" attribute="Normal Text" lineEndContext="#pop"> |
| 92 |
<RegExpr attribute="Italic Text" context="#pop" minimal="true" String="&italic_regex;"/> |
| 93 |
<DetectChar attribute="Normal Text" context="#pop" char="/"/> |
| 94 |
</context> |
| 95 |
<context name="find-strike-normal" attribute="Normal Text" lineEndContext="#pop"> |
| 96 |
<RegExpr attribute="Strikethrough Text" context="#pop" minimal="true" String="&strike_regex;"/> |
| 97 |
<DetectChar attribute="Normal Text" context="#pop" char="+"/> |
| 98 |
</context> |
| 99 |
<context name="find-verbatim-normal" attribute="Normal Text" lineEndContext="#pop"> |
| 100 |
<RegExpr attribute="Verbatim" context="#pop" minimal="true" String="&verbatim_regex;"/> |
| 101 |
<DetectChar attribute="Normal Text" context="#pop" char="~"/> |
| 102 |
</context> |
| 103 |
<context name="find-link-normal" attribute="Link" lineEndContext="#pop"> |
| 104 |
<RegExpr attribute="Plain Link" context="#pop" minimal="true" String="&link_plain_regex;"/> |
| 105 |
<!-- FIXME: currently, link and description are using the same style --> |
| 106 |
<RegExpr attribute="Link" context="#pop" minimal="true" String="&link_desc_regex;"/> |
| 107 |
<DetectChar attribute="Normal Text" context="#pop" char="]"/> |
| 108 |
</context> |
| 109 |
<context name="find-macro-replacement" attribute="Normal Text" lineEndContext="#pop"> |
| 110 |
<RegExpr attribute="Macro" context="#pop" minimal="true" String="¯oreplacement_regex;"/> |
| 111 |
<DetectChar attribute="Normal Text" context="#pop" char="}"/> |
| 112 |
</context> |
| 113 |
<context name="find-inlinecode-normal" attribute="Normal Text" lineEndContext="#pop"> |
| 114 |
<RegExpr attribute="Code" context="#pop" minimal="true" String="&inlinecode_regex;"/> |
| 115 |
<DetectChar attribute="Normal Text" context="#pop" char="~"/> |
| 116 |
</context> |
| 117 |
</contexts> |
| 118 |
<itemDatas> |
| 119 |
<itemData name="Normal Text" defStyleNum="dsNormal"/> |
| 120 |
<itemData name="Normal Text: Link" defStyleNum="dsNormal" underline="true" spellChecking="false"/> |
| 121 |
<itemData name="Bold Text" defStyleNum="dsNormal" bold="true"/> |
| 122 |
<itemData name="Underline Text" defStyleNum="dsNormal" underline="true"/> |
| 123 |
<itemData name="Italic Text" defStyleNum="dsNormal" italic="true"/> |
| 124 |
<itemData name="Strikethrough Text" defStyleNum="dsNormal" strikeOut="true"/> |
| 125 |
<itemData name="Keyword Done" defStyleNum="dsInformation" spellChecking="false"/> |
| 126 |
<itemData name="Keyword Todo" defStyleNum="dsAlert" spellChecking="false"/> |
| 127 |
<itemData name="Cookie: Priority" defStyleNum="dsInformation" spellChecking="false"/> |
| 128 |
<itemData name="Cookie: Statistics" defStyleNum="dsInformation" spellChecking="false"/> |
| 129 |
<itemData name="Heading" defStyleNum="dsFunction"/> |
| 130 |
<itemData name="List" defStyleNum="dsSpecialString" bold="1" spellChecking="false"/> |
| 131 |
<itemData name="List: Normal Text" defStyleNum="dsNormal"/> |
| 132 |
<itemData name="List: Checkbox" defStyleNum="dsVariable" spellChecking="false"/> |
| 133 |
<itemData name="Number List" defStyleNum="dsSpecialString" spellChecking="false"/> |
| 134 |
<itemData name="Plain Link" defStyleNum="dsOthers" underline="true" spellChecking="false"/> |
| 135 |
<itemData name="Link" defStyleNum="dsOthers" underline="true" spellChecking="false"/> |
| 136 |
<itemData name="Comment" defStyleNum="dsComment"/> |
| 137 |
<itemData name="Macro" defStyleNum="dsPreprocessor"/> |
| 138 |
<itemData name="Babel" defStyleNum="dsPreprocessor"/> |
| 139 |
<itemData name="Verbatim" defStyleNum="dsExtension" spellChecking="false"/> |
| 140 |
<itemData name="Code" defStyleNum="dsInformation" spellChecking="false"/> |
| 141 |
<itemData name="Block" defStyleNum="dsInformation"/> |
| 142 |
</itemDatas> |
| 143 |
</highlighting> |
| 144 |
<general> |
| 145 |
<comments> |
| 146 |
<!-- Kate will add a space after the char so it's just a "#" here --> |
| 147 |
<comment name="singleLine" start="#"/> |
| 148 |
</comments> |
| 149 |
</general> |
| 150 |
</language> |
| 151 |
<!-- kate: replace-tabs on; indent-width 2; tab-width 2; --> |