-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathYandexWiki.sublime-syntax
127 lines (111 loc) · 3.22 KB
/
YandexWiki.sublime-syntax
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
%YAML 1.2
---
name: Yandex Wiki
file_extensions: [wiki, yawiki]
first_line_match: ^[=]{2,7}
scope: text.yawiki
variables:
login: '(\w)[-\w]*\w'
contexts:
main:
- include: heading
- include: inline-quote
- include: code
- include: horizontal-line
- include: inline
heading:
- match: \G(?:[=]{2,7}\s*)
captures:
1: punctuation.definition.heading.begin
push:
- meta_scope: markup.heading.1
- meta_content_scope: entity.name.section
- match: $
pop: true
- include: inline
inline:
- include: link
- include: autolink
- include: question
- include: bold
- include: italic
- include: strikethrough
- include: remark
- include: underline
- include: username
inline-quote:
- match: ^>[ ]?
push:
- meta_scope: markup.quote
- match: $
pop: true
username:
- match: '(@){{login}}'
captures:
1: markup.mention.at
scope: markup.mention
- match: '((кто|кого|укого|кому|кем|staff):){{login}}'
captures:
1: markup.mention.qualifer
scope: markup.mention
- match: '{{login}}@(?!(\w|@))'
captures:
1: markup.mention.at
scope: markup.mention
link:
- match: '\(\((.+?) (.+?)\)\)'
scope: markup.underline.link
captures:
1: markup.underline.link
2: markup.underline.text
autolink:
- match: (((https|http|ftp)://)|www\.)[\w-]+(\.[\w-]+)+
scope: markup.underline.link
push: # After a valid domain, zero or more non-space non-< characters may follow
- match: (?=[?!.,:*_~]*[\s<]) # Trailing punctuation (specifically, ?, !, ., ,, :, *, _, and ~) will not be considered part of the autolink, though they may be included in the interior of the link
pop: true
- match: (?=\)[?!.,:*_~]*[\s<])
pop: true
- match: '[^?!.,:*_~\s<&()]+|\S'
scope: markup.underline.link
question:
- match: '\?\?.*?(?<!\s)\?\?'
scope: markup.question
strikethrough:
- match: '--.*(?<!\s)--'
scope: markup.strikethrough
bold:
- match: '\*\*.*(?<!\s)\*\*'
scope: markup.bold
italic:
- match: '//.*(?<!\s)//'
scope: markup.italic
underline:
- match: '__.*(?<!\s)__'
scope: markup.underline
remark:
- match: '!!\((green|зел|зеленый)\).*?(?<!\s)!!'
scope: markup.remark markup.remark.green
- match: '!!\((blue|син|синий)\).*?(?<!\s)!!'
scope: markup.remark markup.remark.blue
- match: '!!\((gray|grey|сер|серый)\).*?(?<!\s)!!'
scope: markup.remark markup.remark.gray
- match: '!!\((yellow|жел)\).*?(?<!\s)!!'
scope: markup.remark markup.remark.yellow
- match: '!!(\((red|крас|красный)\))?.*?(?<!\s)!!'
scope: markup.remark markup.remark.red
code:
- match: '%%'
push:
- meta_scope: markup.raw.block
- meta_content_scope: markup.raw.block.content
- match: \(js\)
push: Packages/JavaScript/JavaScript.sublime-syntax
with_prototype:
- match: (?=^%%)
pop: true
- match: '%%'
pop: true
horizontal-line:
- match: '^\s?-{4,}$\n?'
scope: meta.separator