Merge pull request #41 from Keats/syntaxes

Add more sublime syntaxes
This commit is contained in:
Vincent Prouillet 2017-04-22 11:11:36 +09:00 committed by GitHub
commit f3d9bea3df
24 changed files with 5765 additions and 20 deletions

27
.gitmodules vendored Normal file
View file

@ -0,0 +1,27 @@
[submodule "sublime_syntaxes/Packages"]
path = sublime_syntaxes/Packages
url = https://github.com/sublimehq/Packages.git
[submodule "sublime_syntaxes/sublimeassembly"]
path = sublime_syntaxes/sublimeassembly
url = https://github.com/Nessphoro/sublimeassembly.git
[submodule "sublime_syntaxes/LESS-sublime"]
path = sublime_syntaxes/LESS-sublime
url = https://github.com/danro/LESS-sublime.git
[submodule "sublime_syntaxes/TypeScript-Sublime-Plugin"]
path = sublime_syntaxes/TypeScript-Sublime-Plugin
url = https://github.com/Microsoft/TypeScript-Sublime-Plugin.git
[submodule "sublime_syntaxes/Handlebars"]
path = sublime_syntaxes/Handlebars
url = https://github.com/daaain/Handlebars.git
[submodule "sublime_syntaxes/Julia-sublime"]
path = sublime_syntaxes/Julia-sublime
url = https://github.com/JuliaEditorSupport/Julia-sublime.git
[submodule "sublime_syntaxes/Elm.tmLanguage"]
path = sublime_syntaxes/Elm.tmLanguage
url = https://github.com/elm-community/Elm.tmLanguage.git
[submodule "sublime_syntaxes/sublime_toml_highlighting"]
path = sublime_syntaxes/sublime_toml_highlighting
url = https://github.com/Jayflux/sublime_toml_highlighting.git
[submodule "sublime_syntaxes/SublimeTextLinkerSyntax"]
path = sublime_syntaxes/SublimeTextLinkerSyntax
url = https://github.com/jbw3/SublimeTextLinkerSyntax.git

View file

@ -148,9 +148,6 @@ built-in:
- solarized-dark
- solarized-light
A gallery containing lots of themes at https://tmtheme-editor.herokuapp.com/#!/editor/theme/Agola%20Dark.
More themes can be easily added to gutenberg, just make a PR with the wanted theme.
### Internal links
You can have internal links in your markdown that will be replaced with the full URL when rendering.
To do so, use the normal markdown link syntax, start the link with `./` and point to the `.md` file you want
@ -207,3 +204,47 @@ In case of shortcodes with a body, the body will be passed as the `body` variabl
## Example sites
- [vincent.is](https://vincent.is): https://gitlab.com/Keats/vincent.is
## Adding syntax highlighting languages and themes
### Adding a syntax
Syntax highlighting depends on submodules so ensure you load them first:
```bash
$ git submodule update --init
```
Gutenberg only works with syntaxes in the `.sublime-syntax` format. If your syntax
is in `.tmLanguage` format, open it in Sublime Text and convert it to `sublime-syntax` by clicking on
Tools > Developer > New Syntax from ... and put it at the root of `sublime_syntaxes`.
You can also add a submodule to the repository of the wanted syntax:
```bash
$ cd sublime_syntaxes
$ git submodule add https://github.com/elm-community/Elm.tmLanguage.git
```
Note that you can also only copy manually the updated syntax definition file but this means
Gutenberg won't be able to automatically update it.
You can check for any updates to the current packages by running:
```bash
$ git submodule update --remote --merge
```
And finally from the root of the repository run the following command:
```bash
$ cargo run --example generate_sublime synpack sublime_syntaxes sublime_syntaxes/newlines.packdump sublime_syntaxes/nonewlines.packdump
```
### Adding a theme
A gallery containing lots of themes at https://tmtheme-editor.herokuapp.com/#!/editor/theme/Agola%20Dark.
More themes can be easily added to gutenberg, just make a PR with the wanted theme added in the `sublime_themes` directory
and run the following command from the repository root:
```bash
$ cargo run --example generate_sublime themepack sublime_themes sublime_themes/all.themedump
```
You should see the list of themes being added.

View file

@ -9,19 +9,18 @@ use syntect::dumps::*;
use std::env;
fn usage_and_exit() -> ! {
println!("USAGE: gendata synpack source-dir newlines.packdump nonewlines.packdump\n
gendata themepack source-dir themepack.themedump");
println!("USAGE: cargo run --example generate_sublime synpack source-dir newlines.packdump nonewlines.packdump\n
cargo run --example generate_sublime themepack source-dir themepack.themedump");
::std::process::exit(2);
}
// Not an example of Gutenberg but is used to generate the theme and syntax dump
// used for syntax highlighting.
// Check README for more details
fn main() {
let mut a = env::args().skip(1);
match (a.next(), a.next(), a.next(), a.next()) {
(Some(ref cmd),
Some(ref package_dir),
Some(ref packpath_newlines),
Some(ref packpath_nonewlines)) if cmd == "synpack" => {
let mut args = env::args().skip(1);
match (args.next(), args.next(), args.next(), args.next()) {
(Some(ref cmd), Some(ref package_dir), Some(ref packpath_newlines), Some(ref packpath_nonewlines)) if cmd == "synpack" => {
let mut ps = SyntaxSet::new();
ps.load_plain_text_syntax();
ps.load_syntaxes(package_dir, true).unwrap();
@ -32,8 +31,11 @@ fn main() {
ps.load_syntaxes(package_dir, false).unwrap();
dump_to_file(&ps, packpath_nonewlines).unwrap();
}
(Some(ref s), Some(ref theme_dir), Some(ref packpath), None) if s == "themepack" => {
for s in ps.syntaxes() {
println!("Add {} -> {:?}", s.name, s.file_extensions);
}
},
(Some(ref cmd), Some(ref theme_dir), Some(ref packpath), None) if cmd == "themepack" => {
let ts = ThemeSet::load_from_folder(theme_dir).unwrap();
for path in ts.themes.keys() {
println!("{:?}", path);

View file

@ -18,7 +18,7 @@ use errors::{Result, ResultExt};
// We need to put those in a struct to impl Send and sync
pub struct Setup {
syntax_set: SyntaxSet,
pub syntax_set: SyntaxSet,
pub theme_set: ThemeSet,
}
@ -28,7 +28,11 @@ unsafe impl Sync for Setup {}
lazy_static!{
static ref SHORTCODE_RE: Regex = Regex::new(r#"\{(?:%|\{)\s+([[:alnum:]]+?)\(([[:alnum:]]+?="?.+?"?)\)\s+(?:%|\})\}"#).unwrap();
pub static ref SETUP: Setup = Setup {
syntax_set: SyntaxSet::load_defaults_newlines(),
syntax_set: {
let mut ps: SyntaxSet = from_binary(include_bytes!("../sublime_syntaxes/newlines.packdump"));
ps.link_syntaxes();
ps
},
theme_set: from_binary(include_bytes!("../sublime_themes/all.themedump"))
};
}

View file

@ -70,6 +70,7 @@ pub struct Site {
static_path: PathBuf,
pub tags: HashMap<String, Vec<PathBuf>>,
pub categories: HashMap<String, Vec<PathBuf>>,
pub permalinks: HashMap<String, String>,
}
impl Site {
@ -96,6 +97,7 @@ impl Site {
static_path: path.join("static"),
tags: HashMap::new(),
categories: HashMap::new(),
permalinks: HashMap::new(),
};
Ok(site)
@ -146,6 +148,7 @@ impl Site {
page.render_markdown(&permalinks, &self.tera, &self.config)?;
}
self.permalinks = permalinks;
self.populate_sections();
self.populate_tags_and_categories();
@ -166,6 +169,14 @@ impl Site {
Ok(())
}
/// Called in serve, add a page again updating permalinks and its content
fn add_page_and_render(&mut self, path: &Path) -> Result<()> {
self.add_page(path)?;
let mut page = self.pages.get_mut(path).unwrap();
self.permalinks.insert(page.relative_path.clone(), page.permalink.clone());
page.render_markdown(&self.permalinks, &self.tera, &self.config)
}
/// Find out the direct subsections of each subsection if there are some
/// as well as the pages for each section
fn populate_sections(&mut self) {
@ -272,15 +283,17 @@ impl Site {
self.add_section(path)?;
} else {
// probably just an update so just re-parse that page
self.add_page(path)?;
self.add_page_and_render(path)?;
}
} else {
// new file?
self.add_page(path)?;
self.add_page_and_render(path)?;
}
} else {
// File doesn't exist -> a deletion so we remove it from
// File doesn't exist -> a deletion so we remove it from everything
let relative_path = self.pages[path].relative_path.clone();
self.pages.remove(path);
self.permalinks.remove(&relative_path);
}
self.populate_sections();
self.populate_tags_and_categories();

View file

@ -0,0 +1,68 @@
%YAML 1.2
---
# http://www.sublimetext.com/docs/3/syntax.html
name: Assembly x86 (NASM)
file_extensions:
- asm
- inc
- nasm
scope: source.assembly
contexts:
main:
- match: \b(?i)(v)?(aaa|aad|aam|aas|adc|add|addpd|addps|addsd|addss|addsubpd|addsubps|aesdec|aesdeclast|aesenc|aesenclast|aesimc|aeskeygenassist|and|andpd|andps|andnpd|andnps|arpl|blendpd|bmi|blendps|blendvpd|blendvps|bound|bsf|bsr|bswap|bt|btc|btr|bts|cbw|cwde|cdqe|clc|cld|cflush|clts|cmc|cmov(n?e|ge?|ae?|le?|be?|n?o|n?z)|cmp|cmppd|cmpps|cmps|cnpsb|cmpsw|cmpsd|cmpsq|cmpss|cmpxchg|cmpxchg8b|cmpxchg16b|comisd|comiss|cpuid|crc32|cvtdq2pd|cvtdq2ps|cvtpd2dq|cvtpd2pi|cvtpd2ps|cvtpi2pd|cvtpi2ps|cvtps2dq|cvtps2pd|cvtps2pi|cvtsd2si|cvtsd2ss|cvts2sd|cvtsi2ss|cvtss2sd|cvtss2si|cvttpd2dq|cvtpd2pi|cvttps2dq|cvttps2pi|cvttps2dq|cvttps2pi|cvttsd2si|cvttss2si|cwd|cdq|cqo|daa|das|dec|div|divpd|divps|divsd|divss|dppd|dpps|emms|enter|extractps|f2xm1|fabs|fadd|faddp|fiadd|fbld|fbstp|fchs|fclex|fnclex|fcmov(n?e|ge?|ae?|le?|be?|n?o|n?z)|fcom|fcmop|fcompp|fcomi|fcomip|fucomi|fucomip|fcos|fdecstp|fdiv|fdivp|fidiv|fdivr|fdivrp|fidivr|ffree|ficom|ficomp|fild|fincstp|finit|fnint|fist|fistp|fisttp|fld|fld1|fldl2t|fldl2e|fldpi|fldlg2|fldln2|fldz|fldcw|fldenv|fmul|fmulp|fimul|fnop|fpatan|fprem|fprem1|fptan|frndint|frstor|fsave|fnsave|fscale|fsin|fsincos|fsqrt|fst|fstp|fstcw|fnstcw|fstenv|fnstenv|fsts(w?)|fnstsw|fsub|fsubp|fisub|fsubr|fsubrp|fisubr|ftst|fucom|fucomp|fucompp|fxam|fxch|fxrstor|fxsave|fxtract|fyl2x|fyl2xp1|haddpd|haddps|husbpd|hsubps|idiv|imul|in|inc|ins|insb|insw|insd|insertps|int|into|invd|invlpg|invpcid|iret|iretd|iretq|lahf|lar|lddqu|ldmxcsr|lds|les|lfs|lgs|lss|lea|leave|lfence|lgdt|lidt|llgdt|lmsw|lock|lods|lodsb|lodsw|lodsd|lodsq|lsl|ltr|maskmovdqu|maskmovq|maxpd|maxps|maxsd|maxss|mfence|minpd|minps|minsd|minss|monitor|mov|movapd|movaps|movbe|movd|movq|movddup|movdqa|movdqu|movq2q|movhlps|movhpd|movhps|movlhps|movlpd|movlps|movmskpd|movmskps|movntdqa|movntdq|movnti|movntpd|movntps|movntq|movq|movq2dq|movs|movsb|movsw|movsd|movsq|movsd|movshdup|movsldup|movss|movsx|movsxd|movupd|movups|movzx|mpsadbw|mul|mulpd|mulps|mulsd|mulss|mwait|neg|not|or|orpd|orps|out|outs|outsb|outsw|outsd|pabsb|pabsw|pabsd|packsswb|packssdw|packusdw|packuswb|paddb|paddw|paddd|paddq|paddsb|paddsw|paddusb|paddusw|palignr|pand|pandn|pause|pavgb|pavgw|pblendvb|pblendw|pclmulqdq|pcmpeqb|pcmpeqw|pcmpeqd|pcmpeqq|pcmpestri|pcmpestrm|pcmptb|pcmptgw|pcmpgtd|pcmpgtq|pcmpistri|pcmpisrm|pdep|pext|pextrb|pextrd|pextrq|pextrw|phaddw|phaddd|phaddsw|phinposuw|phsubw|phsubd|phsubsw|pinsrb|pinsrd|pinsrq|pinsrw|pmaddubsw|pmadddwd|pmaxsb|pmaxsd|pmaxsw|pmaxsw|pmaxub|pmaxud|pmaxuw|pminsb|pminsd|pminsw|pminub|pminud|pminuw|pmovmskb|pmovsx|pmovzx|pmuldq|pmulhrsw|pmulhuw|pmulhw|pmulld|pmullw|pmuludw|pop|popa|popad|popcnt|popf|popfd|popfq|por|prefetch|psadbw|pshufb|pshufd|pshufhw|pshuflw|pshufw|psignb|psignw|psignd|pslldq|psllw|pslld|psllq|psraw|psrad|psrldq|psrlw|psrld|psrlq|psubb|psubw|psubd|psubq|psubsb|psubsw|psubusb|psubusw|test|ptest|punpckhbw|punpckhwd|punpckhdq|punpckhddq|punpcklbw|punpcklwd|punpckldq|punpckldqd|push|pusha|pushad|pushf|pushfd|pxor|prcl|rcr|rol|ror|rcpps|rcpss|rdfsbase|rdgsbase|rdmsr|rdpmc|rdrand|rdtsc|rdtscp|rep|repe|repz|repne|repnz|roundpd|roundps|roundsd|roundss|rsm|rsqrps|rsqrtss|sahf|sal|sar|shl|shr|sbb|scas|scasb|scasw|scasd|set(n?e|ge?|ae?|le?|be?|n?o|n?z)|sfence|sgdt|shld|shrd|shufpd|shufps|sidt|sldt|smsw|sqrtpd|sqrtps|sqrtsd|sqrtss|stc|std|stmxcsr|stos|stosb|stosw|stosd|stosq|str|sub|subpd|subps|subsd|subss|swapgs|syscall|sysenter|sysexit|sysret|teset|ucomisd|ucomiss|ud2|unpckhpd|unpckhps|unpcklpd|unpcklps|vbroadcast|vcvtph2ps|vcvtp2sph|verr|verw|vextractf128|vinsertf128|vmaskmov|vpermilpd|vpermilps|vperm2f128|vtestpd|vzeroall|vzeroupper|wait|fwait|wbinvd|wrfsbase|wrgsbase|wrmsr|xadd|xchg|xgetbv|xlat|xlatb|xor|xorpd|xorps|xrstor|xsave|xsaveopt|xsetbv|lzcnt|extrq|insertq|movntsd|movntss|vfmaddpd|vfmaddps|vfmaddsd|vfmaddss|vfmaddsubbpd|vfmaddsubps|vfmsubaddpd|vfmsubaddps|vfmsubpd|vfmsubps|vfmsubsd|vfnmaddpd|vfnmaddps|vfnmaddsd|vfnmaddss|vfnmsubpd|vfnmusbps|vfnmusbsd|vfnmusbss|vbroadcastss|vbroadcastsd|vbroadcastf128|vmaskmovps|vmaskmovpd|cvt|xor|cli|sti|hlt|nop|lock|wait|enter|leave|ret|loop(n?e|n?z)?|call|j(mp|n?e|n?ge?|n?ae?|le?|be?|n?o|n?z|n?c|n?p|n?b))\b
scope: keyword.control.assembly
- match: '\b(?i)(RBP|EBP|BP|CS|DS|ES|FS|GS|SS|RAX|EAX|RBX|EBX|RCX|ECX|RDX|EDX|RIP|EIP|IP|RSP|ESP|SP|RSI|ESI|SI|RDI|EDI|DI|RFLAGS|EFLAGS|FLAGS|R(8|9|10|11|12|13|14|15)(d|w|b)?|(Y|X)MM([0-9]|10|11|12|13|14|15)|(A|B|C|D)(X|H|L)|CR[0-4]|DR[0-7]|TR6|TR7|EFER)\b'
scope: variable.parameter.register.assembly
- match: '\b[0-9]+\b'
scope: constant.character.decimal.assembly
- match: '\b(0x)(?i)[A-F0-9]+\b'
scope: constant.character.hexadecimal.assembly
- match: '\b(?i)[A-F0-9]+h\b'
scope: constant.character.hexadecimal.assembly
- match: \b(?i)(0|1)+b\b
scope: constant.character.binary.assembly
- match: ("|').*?("|')
scope: string.assembly
- match: '^\['
push:
- meta_scope: support.function.directive.assembly
- match: '\]'
pop: true
- match: "(^struc) ([_a-zA-Z][_a-zA-Z0-9]*)"
scope: support.function.directive.assembly
captures:
2: entity.name.function.assembly
- match: ^endstruc
scope: support.function.directive.assembly
- match: "^%macro ([_a-zA-Z][_a-zA-Z0-9]*) ([0-9]+)"
scope: support.function.directive.assembly
captures:
1: entity.name.function.assembly
2: constant.character.assembly
- match: ^%endmacro
scope: support.function.directive.assembly
- match: ^%comment
push:
- meta_scope: comment.assembly
- match: ^%endcomment
pop: true
- match: '\s*(?i)(%define|%ifndef|%xdefine|%idefine|%undef|%assign|%defstr|%strcat|%strlen|%substr|%00|%0|%rotate|%rep|%endrep|%include|\$\$|\$|%unmacro|%if|%elif|%else|%endif|%(el)?ifdef|%(el)?ifmacro|%(el)?ifctx|%(el)?ifidn|%(el)?ifidni|%(el)?ifid|%(el)?ifnum|%(el)?ifstr|%(el)?iftoken|%(el)?ifempty|%(el)?ifenv|%pathsearch|%depend|%use|%push|%pop|%repl|%arg|%stacksize|%local|%error|%warning|%fatal|%line|%!|%comment|%endcomment|__NASM_VERSION_ID__|__NASM_VER__|__FILE__|__LINE__|__BITS__|__OUTPUT_FORMAT__|__DATE__|__TIME__|__DATE_NUM__|_TIME__NUM__|__UTC_DATE__|__UTC_TIME__|__UTC_DATE_NUM__|__UTC_TIME_NUM__|__POSIX_TIME__|__PASS__|ISTRUC|AT|IEND|BITS 16|BITS 32|BITS 64|USE16|USE32|__SECT__|ABSOLUTE|EXTERN|GLOBAL|COMMON|CPU|FLOAT)\b ?([_a-zA-Z][_a-zA-Z0-9]*)?'
captures:
1: support.function.directive.assembly
13: entity.name.function.assembly
- match: \b(?i)(d(b|w|d|q|t|o|y)|res(b|w|d|q|t|o)|equ|times|align|alignb|sectalign|section|ptr|byte|word|dword|qword|incbin|)\b
scope: support.function.directive.assembly
- match: (\s)*;.*$
scope: comment.assembly
- match: '(,|\[|\]|\+|\-|\*)'
scope: source.assembly
- match: '^\s*%%(.-[;])+?:$'
scope: entity.name.function.assembly
- match: '^\s*%\$(.-[;])+?:$'
scope: entity.name.function.assembly
- match: '^\.?(.-[;])+?:$'
scope: entity.name.function.assembly
- match: '^\.?(.-[;])+?\b'
scope: entity.name.function.assembly
- match: .+?
scope: entity.name.function.assembly

View file

@ -0,0 +1,200 @@
%YAML 1.2
---
# http://www.sublimetext.com/docs/3/syntax.html
name: Elm
file_extensions:
- elm
scope: source.elm
contexts:
main:
- match: "(`)[a-zA-Z_']*?(`)"
scope: keyword.operator.function.infix.elm
captures:
1: punctuation.definition.entity.elm
2: punctuation.definition.entity.elm
- match: \(\)
scope: constant.language.unit.elm
- match: ^\b((effect|port)\s+)?(module)\s+
captures:
1: keyword.other.elm
3: keyword.other.elm
push:
- meta_scope: meta.declaration.module.elm
- match: $|;
captures:
1: keyword.other.elm
pop: true
- include: module_name
- match: '(where)\s*\{'
captures:
1: keyword.other.elm
push:
- match: '\}'
pop: true
- include: type_signature
- match: (exposing)
scope: keyword.other.elm
- include: module_exports
- match: (where)
scope: keyword.other.elm
- match: "[a-z]+"
scope: invalid
- match: ^\b(import)\s+((open)\s+)?
captures:
1: keyword.other.elm
3: invalid
push:
- meta_scope: meta.import.elm
- match: ($|;)
pop: true
- match: (as|exposing)
scope: keyword.import.elm
- include: module_name
- include: module_exports
- match: '(\[)(glsl)(\|)'
captures:
1: keyword.other.elm
2: support.function.prelude.elm
3: keyword.other.elm
push:
- meta_scope: entity.glsl.elm
- match: '(\|\])'
captures:
1: keyword.other.elm
pop: true
- include: scope:source.glsl
- match: \b(type alias|type|case|of|let|in|as)\s+
scope: keyword.other.elm
- match: \b(if|then|else)\s+
scope: keyword.control.elm
- match: '\b([0-9]+\.[0-9]+([eE][+-]?[0-9]+)?|[0-9]+[eE][+-]?[0-9]+)\b'
comment: Floats are always decimal
scope: constant.numeric.float.elm
- match: '\b([0-9]+)\b'
scope: constant.numeric.elm
- match: '"""'
captures:
0: punctuation.definition.string.begin.elm
push:
- meta_scope: string.quoted.double.elm
- match: '"""'
captures:
0: punctuation.definition.string.end.elm
pop: true
- match: '\\(NUL|SOH|STX|ETX|EOT|ENQ|ACK|BEL|BS|HT|LF|VT|FF|CR|SO|SI|DLE|DC1|DC2|DC3|DC4|NAK|SYN|ETB|CAN|EM|SUB|ESC|FS|GS|RS|US|SP|DEL|[abfnrtv\\''\&])'
scope: constant.character.escape.elm
- match: '\^[A-Z@\[\]\\\^_]'
scope: constant.character.escape.control.elm
- match: '"'
captures:
0: punctuation.definition.string.begin.elm
push:
- meta_scope: string.quoted.double.elm
- match: '"'
captures:
0: punctuation.definition.string.end.elm
pop: true
- match: '\\(NUL|SOH|STX|ETX|EOT|ENQ|ACK|BEL|BS|HT|LF|VT|FF|CR|SO|SI|DLE|DC1|DC2|DC3|DC4|NAK|SYN|ETB|CAN|EM|SUB|ESC|FS|GS|RS|US|SP|DEL|[abfnrtv\\\"''\&])'
scope: constant.character.escape.elm
- match: '\^[A-Z@\[\]\\\^_]'
scope: constant.character.escape.control.elm
- match: |-
(?x)
(')
(?:
[\ -\[\]-~] # Basic Char
| (\\(?:NUL|SOH|STX|ETX|EOT|ENQ|ACK|BEL|BS|HT|LF|VT|FF|CR|SO|SI|DLE
|DC1|DC2|DC3|DC4|NAK|SYN|ETB|CAN|EM|SUB|ESC|FS|GS|RS
|US|SP|DEL|[abfnrtv\\\"'\&])) # Escapes
| (\^[A-Z@\[\]\\\^_]) # Control Chars
)
(')
scope: string.quoted.single.elm
captures:
1: punctuation.definition.string.begin.elm
2: constant.character.escape.elm
3: punctuation.definition.string.end.elm
- match: '^(port\s+)?([a-z_][a-zA-Z0-9_'']*|\([|!%$+\-.,=</>]+\))\s*((:)([:]+)?)'
captures:
1: keyword.other.port.elm
2: entity.name.function.elm
4: keyword.other.colon.elm
5: invalid
push:
- meta_scope: meta.function.type-declaration.elm
- match: $\n?
pop: true
- include: type_signature
- match: \bport\s+
scope: keyword.other.port.elm
- match: '\b[A-Z]\w*\b'
scope: constant.other.elm
- include: comments
- match: '^[a-z][A-Za-z0-9_'']*\s+'
scope: entity.name.function.elm
- include: infix_op
- match: '[|!%$?~+:\-.=</>&\\*^]+'
scope: keyword.operator.elm
- match: '([\[\]\{\},])'
scope: constant.language.delimiter.elm
captures:
1: support.function.delimiter.elm
- match: '([\(\)])'
scope: keyword.other.parenthesis.elm
block_comment:
- match: '\{-(?!#)'
captures:
0: punctuation.definition.comment.elm
push:
- meta_scope: comment.block.elm
- include: block_comment
- match: '-\}'
captures:
0: punctuation.definition.comment.elm
pop: true
comments:
- match: (--).*$\n?
scope: comment.line.double-dash.elm
captures:
1: punctuation.definition.comment.elm
- include: block_comment
infix_op:
- match: '(\([|!%$+:\-.=</>]+\)|\(,+\))'
scope: entity.name.function.infix.elm
module_exports:
- match: \(
push:
- meta_scope: meta.declaration.exports.elm
- match: \)
pop: true
- match: '\b[a-z][a-zA-Z_''0-9]*'
scope: entity.name.function.elm
- match: '\b[A-Z][A-Za-z_''0-9]*'
scope: storage.type.elm
- match: ","
scope: punctuation.separator.comma.elm
- include: infix_op
- match: \(.*?\)
comment: So named because I don't know what to call this.
scope: meta.other.unknown.elm
module_name:
- match: "[A-Z][A-Za-z._']*"
scope: support.other.module.elm
type_signature:
- match: '\(\s*([A-Z][A-Za-z]*)\s+([a-z][A-Za-z_'']*)\)\s*(=>)'
scope: meta.class-constraint.elm
captures:
1: entity.other.inherited-class.elm
2: variable.other.generic-type.elm
3: keyword.other.big-arrow.elm
- match: "->"
scope: keyword.other.arrow.elm
- match: "=>"
scope: keyword.other.big-arrow.elm
- match: '\b[a-z][a-zA-Z0-9_'']*\b'
scope: variable.other.generic-type.elm
- match: '\b[A-Z][a-zA-Z0-9_'']*\b'
scope: storage.type.elm
- match: \(\)
scope: support.constant.unit.elm
- include: comments

@ -0,0 +1 @@
Subproject commit 195e71c6a70beadea428f684a073aec425a65a81

@ -0,0 +1 @@
Subproject commit 63c28f7aa9360681451779164f40d80f2e70a9cc

View file

@ -0,0 +1,473 @@
%YAML 1.2
---
# http://www.sublimetext.com/docs/3/syntax.html
name: Handlebars
file_extensions:
- handlebars
- handlebars.html
- hbr
- hbrs
- hbs
- hdbs
- hjs
- mu
- mustache
- rac
- stache
- template
- tmpl
scope: text.html.handlebars
contexts:
main:
- include: yfm
- include: extends
- include: block_comments
- include: comments
- include: block_helper
- include: end_block
- include: else_token
- include: partial_and_var
- include: inline_script
- include: html_tags
- include: scope:text.html.basic
block_comments:
- match: '\{\{!--'
push:
- meta_scope: comment.block.handlebars
- match: '--\}\}'
pop: true
- match: '@\w*'
scope: keyword.annotation.handlebars
- include: comments
- match: <!--
captures:
0: punctuation.definition.comment.html
push:
- meta_scope: comment.block.html
- match: '-{2,3}\s*>'
captures:
0: punctuation.definition.comment.html
pop: true
- match: "--"
scope: invalid.illegal.bad-comments-or-CDATA.html
block_helper:
- match: '(\{\{~?\#)([-a-zA-Z0-9_\./>]+)\s?(@?[-a-zA-Z0-9_\./]+)*\s?(@?[-a-zA-Z0-9_\./]+)*\s?(@?[-a-zA-Z0-9_\./]+)*'
captures:
1: support.constant.handlebars
2: support.constant.handlebars
3: variable.parameter.handlebars
4: support.constant.handlebars
5: variable.parameter.handlebars
6: support.constant.handlebars
push:
- meta_scope: meta.function.block.start.handlebars
- match: '(~?\}\})'
captures:
1: support.constant.handlebars
pop: true
- include: string
- include: handlebars_attribute
comments:
- match: '\{\{!'
push:
- meta_scope: comment.block.handlebars
- match: '\}\}'
pop: true
- match: '@\w*'
scope: keyword.annotation.handlebars
- include: comments
- match: <!--
captures:
0: punctuation.definition.comment.html
push:
- meta_scope: comment.block.html
- match: '-{2,3}\s*>'
captures:
0: punctuation.definition.comment.html
pop: true
- match: "--"
scope: invalid.illegal.bad-comments-or-CDATA.html
else_token:
- match: '(\{\{~?else)(@?\s(if)\s([-a-zA-Z0-9_\./]+))?'
captures:
1: support.constant.handlebars
3: support.constant.handlebars
4: variable.parameter.handlebars
push:
- meta_scope: meta.function.inline.else.handlebars
- match: '(~?\}\}\}*)'
captures:
1: support.constant.handlebars
pop: true
end_block:
- match: '(\{\{~?/)([a-zA-Z0-9/_\.-]+)\s*'
captures:
1: support.constant.handlebars
2: support.constant.handlebars
push:
- meta_scope: meta.function.block.end.handlebars
- match: '(~?\}\})'
captures:
1: support.constant.handlebars
pop: true
entities:
- match: "(&)([a-zA-Z0-9]+|#[0-9]+|#x[0-9a-fA-F]+)(;)"
scope: constant.character.entity.html
captures:
1: punctuation.definition.entity.html
3: punctuation.definition.entity.html
- match: "&"
scope: invalid.illegal.bad-ampersand.html
escaped-double-quote:
- match: \\"
scope: constant.character.escape.js
escaped-single-quote:
- match: \\'
scope: constant.character.escape.js
extends:
- match: '(\{\{!<)\s([-a-zA-Z0-9_\./]+)'
captures:
1: support.function.handlebars
2: support.class.handlebars
push:
- meta_scope: meta.preprocessor.handlebars
- match: '(\}\})'
captures:
1: support.function.handlebars
pop: true
handlebars_attribute:
- include: handlebars_attribute_name
- include: handlebars_attribute_value
handlebars_attribute_name:
- match: '\b([-a-zA-Z0-9_\.]+)\b='
captures:
1: variable.parameter.handlebars
push:
- meta_scope: entity.other.attribute-name.handlebars
- match: (?='|"|)
captures:
1: variable.parameter.handlebars
pop: true
handlebars_attribute_value:
- match: '([-a-zA-Z0-9_\./]+)\b'
captures:
1: variable.parameter.handlebars
push:
- meta_scope: entity.other.attribute-value.handlebars
- match: ('|"|)
captures:
1: variable.parameter.handlebars
pop: true
- include: string
html_tags:
- match: '(<)([a-zA-Z0-9:-]+)(?=[^>]*></\2>)'
captures:
1: punctuation.definition.tag.html
2: entity.name.tag.html
push:
- meta_scope: meta.tag.any.html
- match: (>(<)/)(\2)(>)
captures:
1: punctuation.definition.tag.html
2: meta.scope.between-tag-pair.html
3: entity.name.tag.html
4: punctuation.definition.tag.html
pop: true
- include: tag-stuff
- match: (<\?)(xml)
captures:
1: punctuation.definition.tag.html
2: entity.name.tag.xml.html
push:
- meta_scope: meta.tag.preprocessor.xml.html
- match: (\?>)
captures:
1: punctuation.definition.tag.html
2: entity.name.tag.xml.html
pop: true
- include: tag_generic_attribute
- include: string
- match: <!--
captures:
0: punctuation.definition.comment.html
push:
- meta_scope: comment.block.html
- match: '--\s*>'
captures:
0: punctuation.definition.comment.html
pop: true
- match: "--"
scope: invalid.illegal.bad-comments-or-CDATA.html
- match: <!
captures:
0: punctuation.definition.tag.html
push:
- meta_scope: meta.tag.sgml.html
- match: ">"
captures:
0: punctuation.definition.tag.html
pop: true
- match: (DOCTYPE|doctype)
captures:
1: entity.name.tag.doctype.html
push:
- meta_scope: meta.tag.sgml.doctype.html
- match: (?=>)
captures:
1: entity.name.tag.doctype.html
pop: true
- match: '"[^">]*"'
scope: string.quoted.double.doctype.identifiers-and-DTDs.html
- match: '\[CDATA\['
push:
- meta_scope: constant.other.inline-data.html
- match: "]](?=>)"
pop: true
- match: (\s*)(?!--|>)\S(\s*)
scope: invalid.illegal.bad-comments-or-CDATA.html
- match: '(?:^\s+)?(<)((?i:style))\b(?![^>]*/>)'
captures:
1: punctuation.definition.tag.html
2: entity.name.tag.style.html
3: punctuation.definition.tag.html
push:
- meta_scope: source.css.embedded.html
- match: (</)((?i:style))(>)(?:\s*\n)?
captures:
1: punctuation.definition.tag.html
2: entity.name.tag.style.html
3: punctuation.definition.tag.html
pop: true
- include: tag-stuff
- match: (>)
captures:
1: punctuation.definition.tag.html
push:
- match: (?=</(?i:style))
pop: true
- include: scope:source.css
- match: '(?:^\s+)?(<)((?i:script))\b(?![^>]*/>)'
captures:
1: punctuation.definition.tag.html
2: entity.name.tag.script.html
push:
- meta_scope: source.js.embedded.html
- match: (?<=</(script|SCRIPT))(>)(?:\s*\n)?
captures:
2: punctuation.definition.tag.html
pop: true
- include: tag-stuff
- match: (?<!</(?:script|SCRIPT))(>)
captures:
1: punctuation.definition.tag.html
2: entity.name.tag.script.html
push:
- match: (</)((?i:script))
captures:
1: punctuation.definition.tag.html
2: entity.name.tag.script.html
pop: true
- match: (//).*?((?=</script)|$\n?)
scope: comment.line.double-slash.js
captures:
1: punctuation.definition.comment.js
- match: /\*
captures:
0: punctuation.definition.comment.js
push:
- meta_scope: comment.block.js
- match: \*/|(?=</script)
captures:
0: punctuation.definition.comment.js
pop: true
- include: scope:source.js
- match: (</?)((?i:body|head|html)\b)
captures:
1: punctuation.definition.tag.html
2: entity.name.tag.structure.any.html
push:
- meta_scope: meta.tag.structure.any.html
- match: (>)
captures:
1: punctuation.definition.tag.html
2: entity.name.tag.structure.any.html
pop: true
- include: tag-stuff
- match: (</?)((?i:address|blockquote|dd|div|header|section|footer|aside|nav|dl|dt|fieldset|form|frame|frameset|h1|h2|h3|h4|h5|h6|iframe|noframes|object|ol|p|ul|applet|center|dir|hr|menu|pre)\b)
captures:
1: punctuation.definition.tag.html
2: entity.name.tag.block.any.html
push:
- meta_scope: meta.tag.block.any.html
- match: (>)
captures:
1: punctuation.definition.tag.html
2: entity.name.tag.block.any.html
pop: true
- include: tag-stuff
- match: (</?)((?i:a|abbr|acronym|area|b|base|basefont|bdo|big|br|button|caption|cite|code|col|colgroup|del|dfn|em|font|head|html|i|img|input|ins|isindex|kbd|label|legend|li|link|map|meta|noscript|optgroup|option|param|q|s|samp|script|select|small|span|strike|strong|style|sub|sup|table|tbody|td|textarea|tfoot|th|thead|title|tr|tt|u|var)\b)
captures:
1: punctuation.definition.tag.html
2: entity.name.tag.inline.any.html
push:
- meta_scope: meta.tag.inline.any.html
- match: "((?: ?/)?>)"
captures:
1: punctuation.definition.tag.html
2: entity.name.tag.inline.any.html
pop: true
- include: tag-stuff
- match: "(</?)([a-zA-Z0-9:-]+)"
captures:
1: punctuation.definition.tag.html
2: entity.name.tag.other.html
push:
- meta_scope: meta.tag.other.html
- match: (>)
captures:
1: punctuation.definition.tag.html
2: entity.name.tag.other.html
pop: true
- include: tag-stuff
- match: "(</?)([a-zA-Z0-9{}:-]+)"
captures:
1: punctuation.definition.tag.html
2: entity.name.tag.tokenised.html
push:
- meta_scope: meta.tag.tokenised.html
- match: (>)
captures:
1: punctuation.definition.tag.html
2: entity.name.tag.tokenised.html
pop: true
- include: tag-stuff
- include: entities
- match: <>
scope: invalid.illegal.incomplete.html
- match: <
scope: invalid.illegal.bad-angle-bracket.html
inline_script:
- match: '(?:^\s+)?(<)((?i:script))\b(?:.*(type)=(["''](?:text/x-handlebars-template|text/x-handlebars|text/template|x-tmpl-handlebars)["'']))(?![^>]*/>)'
captures:
1: punctuation.definition.tag.html
2: entity.name.tag.script.html
3: entity.other.attribute-name.html
4: string.quoted.double.html
push:
- meta_scope: source.handlebars.embedded.html
- match: (?<=</(script|SCRIPT))(>)(?:\s*\n)?
captures:
2: punctuation.definition.tag.html
pop: true
- include: tag-stuff
- match: (?<!</(?:script|SCRIPT))(>)
captures:
1: punctuation.definition.tag.html
2: entity.name.tag.script.html
push:
- match: (</)((?i:script))
captures:
1: punctuation.definition.tag.html
2: entity.name.tag.script.html
pop: true
- include: block_comments
- include: comments
- include: block_helper
- include: end_block
- include: else_token
- include: partial_and_var
- include: html_tags
- include: scope:text.html.basic
partial_and_var:
- match: '(\{\{~?\{*(>|!<)*)\s*(@?[-a-zA-Z0-9$_\./]+)*'
captures:
1: support.constant.handlebars
3: variable.parameter.handlebars
push:
- meta_scope: meta.function.inline.other.handlebars
- match: '(~?\}\}\}*)'
captures:
1: support.constant.handlebars
pop: true
- include: string
- include: handlebars_attribute
string:
- include: string-single-quoted
- include: string-double-quoted
string-double-quoted:
- match: '"'
captures:
0: punctuation.definition.string.begin.html
push:
- meta_scope: string.quoted.double.handlebars
- match: '"'
captures:
0: punctuation.definition.string.end.html
pop: true
- include: escaped-double-quote
- include: block_comments
- include: comments
- include: block_helper
- include: else_token
- include: end_block
- include: partial_and_var
string-single-quoted:
- match: "'"
captures:
0: punctuation.definition.string.begin.html
push:
- meta_scope: string.quoted.single.handlebars
- match: "'"
captures:
0: punctuation.definition.string.end.html
pop: true
- include: escaped-single-quote
- include: block_comments
- include: comments
- include: block_helper
- include: else_token
- include: end_block
- include: partial_and_var
tag-stuff:
- include: tag_id_attribute
- include: tag_generic_attribute
- include: string
- include: block_comments
- include: comments
- include: block_helper
- include: end_block
- include: else_token
- include: partial_and_var
tag_generic_attribute:
- match: '\b([a-zA-Z0-9_-]+)\b\s*(=)'
captures:
1: entity.other.attribute-name.generic.html
2: punctuation.separator.key-value.html
push:
- meta_scope: entity.other.attribute-name.html
- match: (?<='|"|)
captures:
1: entity.other.attribute-name.generic.html
2: punctuation.separator.key-value.html
pop: true
- include: string
tag_id_attribute:
- match: \b(id)\b\s*(=)
captures:
1: entity.other.attribute-name.id.html
2: punctuation.separator.key-value.html
push:
- meta_scope: meta.attribute-with-value.id.html
- match: (?<='|"|)
captures:
1: entity.other.attribute-name.id.html
2: punctuation.separator.key-value.html
pop: true
- include: string
yfm:
- match: (?<!\s)---\n$
push:
- meta_scope: markup.raw.yaml.front-matter
- match: ^---\s
pop: true
- include: scope:source.yaml

@ -0,0 +1 @@
Subproject commit 206a35b4697afd2545dec6f1f6747c4dc2201fbf

@ -0,0 +1 @@
Subproject commit ebd4a2f049fb61686664a68c8d0f34d83292e07e

View file

@ -0,0 +1,326 @@
%YAML 1.2
---
# http://www.sublimetext.com/docs/3/syntax.html
name: LESS
comment: LESS
file_extensions:
- less
scope: source.less
contexts:
main:
- include: comment-block
- include: comment-line
- include: less-at-rules
- include: less-declarations
- include: less-variables
- include: less-functions
- include: string-double
- include: string-single
- include: selector
- include: rule-list
- include: less-operators
- include: less-parameters
- include: numeric-values
color-values:
- match: \b(aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow)\b
comment: http://www.w3.org/TR/CSS21/syndata.html#value-def-color
scope: support.constant.color.w3c-standard-color-name.css
- match: \b(aliceblue|antiquewhite|aquamarine|azure|beige|bisque|blanchedalmond|blueviolet|brown|burlywood|cadetblue|chartreuse|chocolate|coral|cornflowerblue|cornsilk|crimson|cyan|darkblue|darkcyan|darkgoldenrod|darkgray|darkgreen|darkgrey|darkkhaki|darkmagenta|darkolivegreen|darkorange|darkorchid|darkred|darksalmon|darkseagreen|darkslateblue|darkslategray|darkslategrey|darkturquoise|darkviolet|deeppink|deepskyblue|dimgray|dimgrey|dodgerblue|firebrick|floralwhite|forestgreen|gainsboro|ghostwhite|gold|goldenrod|greenyellow|grey|honeydew|hotpink|indianred|indigo|ivory|khaki|lavender|lavenderblush|lawngreen|lemonchiffon|lightblue|lightcoral|lightcyan|lightgoldenrodyellow|lightgray|lightgreen|lightgrey|lightpink|lightsalmon|lightseagreen|lightskyblue|lightslategray|lightslategrey|lightsteelblue|lightyellow|limegreen|linen|magenta|mediumaquamarine|mediumblue|mediumorchid|mediumpurple|mediumseagreen|mediumslateblue|mediumspringgreen|mediumturquoise|mediumvioletred|midnightblue|mintcream|mistyrose|moccasin|navajowhite|oldlace|olivedrab|orangered|orchid|palegoldenrod|palegreen|paleturquoise|palevioletred|papayawhip|peachpuff|peru|pink|plum|powderblue|rosybrown|royalblue|saddlebrown|salmon|sandybrown|seagreen|seashell|sienna|skyblue|slateblue|slategray|slategrey|snow|springgreen|steelblue|tan|thistle|tomato|turquoise|violet|wheat|whitesmoke|yellowgreen)\b
comment: "These colours are mostly recognised but will not validate. ref: http://www.w3schools.com/css/css_colornames.asp"
scope: support.constant.color.non-standard
- match: (hsla?|rgba?)\s*(\()
captures:
1: support.function.misc.css
2: punctuation.section.function.css
push:
- match: (\))
captures:
1: punctuation.section.function.css
pop: true
- match: '(?x)\b(0*((1?[0-9]{1,2})|(2([0-4][0-9]|5[0-5])))\s*,\s*){2}(0*((1?[0-9]{1,2})|(2([0-4][0-9]|5[0-5])))\b)(\s*,\s*((0?\.[0-9]+)|[0-1]))?'
scope: constant.other.color.rgb-value.css
- match: '\b([0-9]{1,2}|100)\s*%,\s*([0-9]{1,2}|100)\s*%,\s*([0-9]{1,2}|100)\s*%'
scope: constant.other.color.rgb-percentage.css
- include: numeric-values
comment-block:
- match: /\*
captures:
0: punctuation.definition.comment.css
push:
- meta_scope: comment.block.css
- match: \*/
captures:
0: punctuation.definition.comment.css
pop: true
comment-line:
- match: //
captures:
0: punctuation.definition.comment.css
push:
- meta_scope: comment.line.double-slash.less
- match: $\n?
captures:
0: punctuation.definition.comment.css
pop: true
less-at-rules:
- match: ^\s*((@)(?:-(?:webkit|moz|o)-)?(charset|import|namespace|media|page|font-face|keyframes|supports|document)\b)
scope: meta.at-rule.css
captures:
1: keyword.control.at-rule.css
2: punctuation.definition.keyword.css
less-data-uri:
- match: (url)(\()(data:)
captures:
1: support.function.misc.css
2: punctuation.section.function.css
3: parameter.less.data-uri comment markup.raw
push:
- meta_content_scope: parameter.less.data-uri comment markup.raw
- match: (\))
captures:
1: punctuation.section.function.css
pop: true
- match: (url)(\()("data:)
captures:
1: support.function.misc.css
2: punctuation.section.function.css
3: parameter.less.data-uri comment markup.raw
push:
- meta_content_scope: parameter.less.data-uri comment markup.raw
- match: (?<=")(\))
captures:
1: punctuation.section.function.css
pop: true
- match: (url)(\()('data:)
captures:
1: support.function.misc.css
2: punctuation.section.function.css
3: parameter.less.data-uri comment markup.raw
push:
- meta_content_scope: parameter.less.data-uri comment markup.raw
- match: (?<=\')(\))
captures:
1: punctuation.section.function.css
pop: true
less-declarations:
- match: '(?>@[a-zA-Z0-9_-][\w-]*+)(?!:)'
scope: variable.other.less
- match: '@[a-zA-Z0-9_-][\w-]*'
scope: variable.declaration.less
less-functions:
- match: '([%a-zA-Z\-\_\d]*)(?=\()'
scope: support.function.less
- match: '([\.#](?![0-9])[a-zA-Z0-9_-]+(?=\())'
captures:
1: entity.other.attribute-name.class.css entity.other.less.mixin
less-operators:
- match: /|!important|$|%|&|\*|\-\-|\-|\+\+|\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|(?<!\()/=|%=|\+=|\-=|&=|when\b|and\b|not\b
scope: keyword.operator.less
less-parameters:
- match: '\(|(}\s*,)'
push:
- meta_scope: parameter.less
- match: '\)|{'
pop: true
- include: color-values
- include: less-parameters
- include: less-functions
- include: numeric-values
- include: string-double
- include: string-single
- include: less-variables
- match: '(?:\:/)?[\/\.a-zA-Z0-9_\-]*'
scope: variable.parameter.misc.css
- include: less-operators
less-variables:
- match: '@[a-zA-Z0-9_-][\w-]*'
scope: variable.other.less
- match: '@{[a-zA-Z0-9_-][\w-]*}'
scope: variable.interpolation.less
- match: "`"
push:
- meta_scope: comment markup.raw
- match: "`"
pop: true
- match: (~)`
captures:
1: keyword.operator.less
push:
- meta_scope: comment markup.raw
- match: "`"
pop: true
- match: (~)"
captures:
1: keyword.operator.less
push:
- meta_scope: string.quoted.double.css comment markup.raw
- match: '"'
pop: true
- match: (~)'
captures:
1: keyword.operator.less
push:
- meta_scope: string.quoted.single.css comment markup.raw
- match: "'"
pop: true
numeric-values:
- match: '(#)([0-9a-fA-F]{3}|[0-9a-fA-F]{6})\b'
scope: constant.other.color.rgb-value.css
captures:
1: punctuation.definition.constant.css
- match: '(?x)(?:-|\+)?(?:(?:[0-9]+(?:\.[0-9]+)?)|(?:\.[0-9]+))((?:px|pt|ch|cm|mm|in|r?em|ex|pc|deg|g?rad|dpi|dpcm|ms|s)\b|%)?'
scope: constant.numeric.css
captures:
1: keyword.other.unit.css
property-names:
- match: "(?<![-a-z])(?=[-a-z])"
push:
- meta_scope: support.type.property-name.css
- match: "$|(?![-a-z])"
pop: true
- match: \b(word)\b
scope: support.type.property-name.css
property-values:
- include: less-variables
- include: less-data-uri
- include: less-functions
- include: less-operators
- include: color-values
- include: numeric-values
- include: less-parameters
- match: \b(absolute|all(-scroll)?|always|subpixel-antialiased|antialiased|armenian|auto|avoid|baseline|below|bidi-override|block|bold|bolder|border-box|both|bottom|break-all|break-word|capitalize|center|char|circle|cjk-ideographic|content-box|col-resize|collapse|crosshair|dashed|decimal-leading-zero|decimal|default|disabled|disc|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ellipsis|fixed|geometricPrecision|georgian|groove|hand|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|inactive|inherit|inline-block|inline|inset|inside|inter-ideograph|inter-word|italic|justify|katakana-iroha|katakana|keep-all|left|lighter|line-edge|line-through|line|list-item|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|medium|middle|move|n-resize|ne-resize|newspaper|no-drop|no-repeat|nw-resize|none|normal|not-allowed|nowrap|oblique|optimize(Legibility|Quality|Speed)|outset|outside|overline|pointer|pre(-(wrap|line))?|progress|relative|repeat-x|repeat-y|repeat|right|ridge|row-resize|rtl|s-resize|scroll|se-resize|separate|small-caps|solid|square|static|strict|sub|super|sw-resize|table-caption|table-cell|table-column-group|table-column|table-footer-group|table-header-group|table-row-group|table|tb-rl|text-bottom|text-top|textfield|text|thick|thin|top|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|vertical(-(ideographic|text))?|visible(Painted|Fill|Stroke)?|w-resize|wait|whitespace|zero|smaller|larger|((xx?-)?(small|large))|painted|fill|stroke)\b
scope: support.constant.property-value.css
- include: selector
- match: (\b(?i:arial|century|comic|courier|garamond|georgia|helvetica|impact|lucida|symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|serif|monospace)\b)
scope: support.constant.font-name.css
- include: string-double
- include: string-single
- match: (rect)\s*(\()
captures:
1: support.function.misc.css
2: punctuation.section.function.css
push:
- match: (\))
captures:
1: punctuation.section.function.css
pop: true
- include: numeric-values
- match: (format|local|url|attr|counter|counters)\s*(\()
captures:
1: support.function.misc.css
2: punctuation.section.function.css
push:
- match: (\))
captures:
1: punctuation.section.function.css
pop: true
- include: string-single
- include: string-double
- match: '[^''") \t]+'
scope: variable.parameter.misc.css
- match: \!\s*important
scope: keyword.other.important.css
rule-list:
- include: comment-block
- include: comment-line
- include: selector
- include: property-names
- match: (:)\s*
captures:
1: punctuation.separator.key-value.css
push:
- meta_scope: meta.property-value.css
- match: '\s*(;|(?=[{}]))'
captures:
1: punctuation.terminator.rule.css
pop: true
- include: property-values
selector:
- match: '\b(a|abbr|acronym|address|area|article|aside|audio|b|base|big|blockquote|body|br|button|canvas|caption|cite|code|col|colgroup|datalist|dd|del|details|dfn|dialog|div|dl|dt|em|eventsource|fieldset|figure|figcaption|footer|form|frame|frameset|(h[1-6])|head|header|hgroup|hr|html|i|iframe|img|input|ins|kbd|label|legend|li|link|map|mark|menu|meta|meter|nav|noframes|noscript|object|ol|optgroup|option|output|p|param|pre|progress|q|samp|script|section|select|small|span|strike|strong|style|sub|summary|sup|svg|table|tbody|td|textarea|tfoot|th|thead|time|title|tr|tt|ul|var|video)\b'
scope: entity.name.tag.css, keyword.control.html.elements
- match: '(\.)-?[a-zA-Z_][a-zA-Z0-9_-]*'
scope: entity.other.attribute-name.class.css
captures:
1: punctuation.definition.entity.css
- match: "(#)-?[a-zA-Z_][a-zA-Z0-9_-]*"
scope: entity.other.attribute-name.id.css
captures:
1: punctuation.definition.entity.css
- match: \*
scope: entity.name.tag.wildcard.css
- match: (:+)((first|last|only)-child|(first|last|only)-of-type|empty|root|target|first-letter|first-line|first|left|right|lang)\b
scope: entity.other.attribute-name.pseudo-class.css
captures:
1: punctuation.definition.entity.css
- match: (:)(extend)\b
scope: entity.other.attribute-name.pseudo-class.less
captures:
1: punctuation.definition.entity.css
- match: (:)(checked|enabled|default|disabled|indeterminate|invalid|optional|required|valid)\b
scope: entity.other.attribute-name.pseudo-class.ui-state.css
captures:
1: punctuation.definition.entity.css
- match: ((:)not)(\()
captures:
1: entity.other.attribute-name.pseudo-class.css
2: punctuation.definition.entity.css
3: punctuation.section.function.css
push:
- match: \)
captures:
0: punctuation.section.function.css
pop: true
- include: selector
- match: ((:)nth-(?:(?:last-)?child|(?:last-)?of-type))(\()
captures:
1: entity.other.attribute-name.pseudo-class.css
2: punctuation.definition.entity.css
3: punctuation.section.function.css
push:
- meta_content_scope: constant.numeric.css
- match: (\))
captures:
1: punctuation.section.function.css
pop: true
- match: (:+)(?:-(?:webkit|moz|o)-)?(after|before|selection|scrollbar|placeholder|input-placeholder)\b
scope: entity.other.attribute-name.pseudo-element.css
captures:
1: punctuation.definition.entity.css
- match: (:+)(?:-(?:webkit|moz|o)-)?(active|hover|link|visited|focus-inner|focus)\b
scope: entity.other.attribute-name.pseudo-class.css
captures:
1: punctuation.definition.entity.css
- match: '(?i)(\[)\s*(-?[_a-z\\[[:^ascii:]]][_a-z0-9\-\\[[:^ascii:]]]*)(?:\s*([~|^$*]?=)\s*(?:(-?[_a-z\\[[:^ascii:]]][_a-z0-9\-\\[[:^ascii:]]]*)|((?>([''"])(?:[^\\]|\\.)*?(\6)))))?\s*(\])'
scope: meta.attribute-selector.css
captures:
1: punctuation.definition.entity.css
2: entity.other.attribute-name.attribute.css
3: punctuation.separator.operator.css
4: string.unquoted.attribute-value.css
5: string.quoted.double.attribute-value.css
6: punctuation.definition.string.begin.css
7: punctuation.definition.string.end.css
string-double:
- match: '"'
captures:
0: punctuation.definition.string.begin.css
push:
- meta_scope: string.quoted.double.css
- match: '"'
captures:
0: punctuation.definition.string.end.css
pop: true
- match: \\.
scope: constant.character.escape.css
string-single:
- match: "'"
captures:
0: punctuation.definition.string.begin.css
push:
- meta_scope: string.quoted.single.css
- match: "'"
captures:
0: punctuation.definition.string.end.css
pop: true
- match: \\.
scope: constant.character.escape.css

@ -0,0 +1 @@
Subproject commit 31d287243975662ec95c346c6adacef2e63c10ef

@ -0,0 +1 @@
Subproject commit 2f7bc1777207de5b5ceb308419687419e8338742

View file

@ -0,0 +1,153 @@
%YAML 1.2
---
# http://www.sublimetext.com/docs/3/syntax.html
name: TOML
file_extensions:
- toml
- tml
scope: source.toml
contexts:
main:
- include: comments
- include: tables
- include: keys
- include: illegal
array:
- match: '(?<!\w)(\[)\s*'
comment: Array
captures:
1: punctuation.definition.array.toml
push:
- match: '\s*(\])(?!\w)'
captures:
1: punctuation.definition.array.toml
pop: true
- include: comments
- include: dataTypes
boolean:
- match: (?<!\w)(true|false)(?!\w)
comment: Boolean
captures:
1: constant.other.boolean.toml
comments:
- match: \s*((#).*)$
comment: Comments
captures:
1: comment.line.number-sign.toml
2: punctuation.definition.comment.toml
dataTypes:
- include: inlinetable
- include: array
- include: string
- include: dateTime
- include: float
- include: integer
- include: boolean
dateTime:
- match: '(?<!\w)(\d{4}\-\d{2}\-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[\+\-]\d{2}:\d{2}))(?!\w)'
comment: DateTime
captures:
1: constant.other.datetime.toml
float:
- match: '(?<!\w)([\+\-]?(?:[1-9][0-9]*|0)(?:(?:\.[0-9]*)?[eE][\+\-]?[1-9][0-9]*|(?:\.[0-9]*)))(?!\w)'
comment: Float, decimal and exponential representation
captures:
1: constant.numeric.float.toml
illegal:
- match: (.*)
comment: Invalid things -> everything unmatched
captures:
1: invalid.illegal.toml
inlinetable:
- match: '(?<!\w)(\{)\s*'
captures:
1: punctuation.definition.inlinetable.toml
push:
- match: '\s*(\})(?!\w)'
captures:
1: punctuation.definition.inlinetable.toml
pop: true
- include: keys
- include: dataTypes
integer:
- match: '(?<!\w)((?:[\+\-]?[1-9][0-9]*|0))(?!\w)'
comment: Integer (with and without + and - prefixes)
captures:
1: constant.numeric.integer.toml
keys:
- match: (\s*=.*)$
comment: Assignments without key are invalid
scope: invalid.illegal.noKeyDefined.toml
- match: '(\s*[A-Za-z_\-][A-Za-z0-9_\-]*\s*=)(?=\s*$)'
comment: Assignments without value are unusual
scope: invalid.deprecated.noValueGiven.toml
- match: '\s*([A-Za-z_-][A-Za-z0-9_-]*|".+"|''.+''|[0-9]+)\s*(=)\s*'
captures:
1: keyword.key.toml
2: punctuation.definition.keyValuePair.toml
push:
- match: '($|(?==)|\,|\s*(?=\}))'
pop: true
- include: comments
- include: dataTypes
- include: illegal
string:
- match: "'''"
comment: literal string block (no escape sequences)
push:
- meta_scope: string.quoted.triple.literal.block.toml
- match: "'''"
pop: true
- match: "'.*?'"
comment: literal string line (no escape sequences)
scope: string.quoted.single.literal.line.toml
- match: '"""'
comment: basic string block
push:
- meta_scope: string.quoted.triple.basic.block.toml
- match: '"""'
pop: true
- match: '[^"\\]*(?:\\.?[^"\\]*)*'
scope: string.quoted.triple.basic.block.toml
- match: '"[^"\\]*(?:\\.[^"\\]*)*"'
comment: basic string line
scope: string.quoted.single.basic.line.toml
tables:
- match: '^\s*(\[\[\]\]|\[\[\..*\]\]|\[\[.*\.\]\]|\[\[.*\.\..*\]\]|\[\[.*[\[\]#].*\]\]|\[\[.*\]\].+\n)'
comment: non-empty etc. like tables, see below!
push:
- meta_scope: invalid.illegal.table.array.toml
- match: '(?=^\s*\[?\[.*\]\]?)'
pop: true
- match: '^\s*(\[\[)([A-Za-z_\-][A-Za-z0-9_\-\.]*)(\]\])\s*'
comment: A named TOML-Table-Array
captures:
1: punctuation.definition.table.array.toml
2: entity.other.attribute-name.table.array.toml
3: punctuation.definition.table.array.toml
push:
- meta_scope: meta.tag.table.array.toml
- match: '(?=^\s*\[?\[[A-Za-z_\-][A-Za-z0-9_\-\.]*\]\]?)'
pop: true
- include: comments
- include: keys
- include: illegal
- match: '^\s*(\[\]|\[\..*\]|\[.*\.\]|\[.*\.\..*\]|\[.*[\[\]#].*\]|\[.*\].+\n)'
comment: 'Each table name segment must be non-empty, must not contain the characters ''['', '']'' or ''#'' and is delimited by a ''.''. Tables "appear in square brackets *on a line by themselves*"'
push:
- meta_scope: invalid.illegal.table.toml
- match: '(?=^\s*\[?\[.*\]\]?)'
pop: true
- match: '^\s*(\[)([A-Za-z_\-][A-Za-z0-9_\-\.]*)(\])\s*'
comment: A named TOML-Table
captures:
1: punctuation.definition.table.toml
2: entity.other.attribute-name.table.toml
3: punctuation.definition.table.toml
push:
- meta_scope: meta.tag.table.toml
- match: '(?=^\s*\[?\[[A-Za-z_\-][A-Za-z0-9_\-\.]*\]\]?)'
pop: true
- include: comments
- include: keys
- include: illegal

@ -0,0 +1 @@
Subproject commit eb57cebd62d0c2ea2c17d222c8c1c3cefa40f31b

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

Binary file not shown.

Binary file not shown.

@ -0,0 +1 @@
Subproject commit 1deb0745d7cfd069bdd5652878e321019b1ed229

@ -0,0 +1 @@
Subproject commit 150352f4d89d7fde48b18cc4b046385a6e926c96

View file

@ -7,7 +7,7 @@
<meta name="description" content="{{ config.description }}">
<meta name="author" content="{{ config.extra.author.name }}">
<link href="https://fonts.googleapis.com/css?family=Fira+Mono|Fira+Sans|Merriweather" rel="stylesheet">
<link href="site.css" rel="stylesheet">
<link href="{{ config.base_url }}/site.css" rel="stylesheet">
<title>{{ config.title }}</title>
</head>