Add highlight for lyric (#949)

* Add highlight for lyric files

* Add highlight theme nyx-bold

* Update the documents

* Add highlight for subtitle files
This commit is contained in:
SasakiSaki 2020-02-21 21:14:25 +08:00 committed by GitHub
parent a3223ebb66
commit 073e24659d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 2272 additions and 6 deletions

View file

@ -80,6 +80,7 @@ Here is a full list of supported languages and their short names:
- Lisp -> ["cl", "clisp", "el", "fasl", "l", "lisp", "lsp", "mud", "scm", "ss"]
- Literate Haskell -> ["lhs"]
- Lua -> ["lua"]
- Lyric -> ["lyric", "lrc"]
- Makefile -> ["GNUmakefile", "Makefile", "Makefile.am", "Makefile.in", "OCamlMakefile", "mak", "make", "makefile", "makefile.am", "makefile.in", "mk"]
- Markdown -> ["markdn", "markdown", "md", "mdown"]
- MATLAB -> ["matlab"]
@ -110,6 +111,7 @@ Here is a full list of supported languages and their short names:
- Scala -> ["sbt", "scala"]
- SQL -> ["ddl", "dml", "sql"]
- SQL (Rails) -> ["erbsql", "sql.erb"]
- Subtitle -> ["srt", "subrip"]
- SWI-Prolog -> ["pro"]
- Swift -> ["swift"]
- Tcl -> ["tcl"]

View file

@ -132,6 +132,9 @@ Zola currently has the following highlight themes available:
- [agola-dark](https://tmtheme-editor.herokuapp.com/#!/editor/theme/Agola%20Dark)
- [ascetic-white](https://tmtheme-editor.herokuapp.com/#!/editor/theme/Ascetic%20White)
- [axar](https://tmtheme-editor.herokuapp.com/#!/editor/theme/Axar)
- [ayu-dark](https://github.com/dempfi/ayu)
- [ayu-light](https://github.com/dempfi/ayu)
- [ayu-mirage](https://github.com/dempfi/ayu)
- [base16-ocean-dark](https://tmtheme-editor.herokuapp.com/#!/editor/theme/Base16%20Ocean%20Dark)
- [base16-ocean-light](https://tmtheme-editor.herokuapp.com/#!/editor/theme/Base16%20Ocean%20Light)
- [bbedit](https://tmtheme-editor.herokuapp.com/#!/editor/theme/BBEdit)
@ -152,16 +155,14 @@ Zola currently has the following highlight themes available:
- [material-dark](https://tmtheme-editor.herokuapp.com/#!/editor/theme/Material%20Dark)
- [material-light](https://github.com/morhetz/gruvbox)
- [monokai](https://tmtheme-editor.herokuapp.com/#!/editor/theme/Monokai)
- [nyx-bold](https://github.com/GalAster/vscode-theme-nyx)
- [one-dark](https://github.com/andresmichel/one-dark-theme)
- [solarized-dark](https://tmtheme-editor.herokuapp.com/#!/editor/theme/Solarized%20(dark))
- [solarized-light](https://tmtheme-editor.herokuapp.com/#!/editor/theme/Solarized%20(light))
- [subway-madrid](https://github.com/idleberg/Subway.tmTheme)
- [subway-moscow](https://github.com/idleberg/Subway.tmTheme)
- [visual-studio-dark](https://tmtheme-editor.herokuapp.com/#!/editor/theme/Visual%20Studio%20Dark)
- [ayu-light](https://github.com/dempfi/ayu)
- [ayu-dark](https://github.com/dempfi/ayu)
- [ayu-mirage](https://github.com/dempfi/ayu)
- [Tomorrow](https://tmtheme-editor.herokuapp.com/#!/editor/theme/Tomorrow)
- [one-dark](https://github.com/andresmichel/one-dark-theme)
- [visual-studio-dark](https://tmtheme-editor.herokuapp.com/#!/editor/theme/Visual%20Studio%20Dark)
- [zenburn](https://github.com/colinta/zenburn)
Zola uses the Sublime Text themes, making it very easy to add more.
@ -181,4 +182,4 @@ is space being replaced by `_` since a space is not valid in an anchor.
Note that if you are using a strategy other than the default, you will have to manually escape whitespace and Markdown
tokens to be able to link to your pages. For example an internal link to a file named `some space.md` will need to be
written like `some%20space.md` in your Markdown files.
written like `some%20space.md` in your Markdown files.

View file

@ -0,0 +1,27 @@
%YAML 1.2
---
# http://www.sublimetext.com/docs/3/syntax.html
scope: source.lyric
file_extensions:
- lrc
- lyric
contexts:
main:
- match: '\[([0-5][0-9]:[0-5][0-9]\.[0-9][0-9])\]'
captures:
1: constant.other.time.lyric
push:
- match: '(.*)[\n\r]+'
captures:
1: string.literal.lyric
pop: true
- match: '(\[)([a-zA-Z].*)(:)(.*)(\])'
captures:
1: punctuation.definition.meta.lyric
2: entity.name.function.lyric
3: punctuation.definition.split.lyric
4: meta.object-literal.key.lyric
5: punctuation.definition.meta.lyric
- match: (.*)
captures:
1: invalid.illegal.lyric

View file

@ -0,0 +1,35 @@
%YAML 1.2
---
# http://www.sublimetext.com/docs/3/syntax.html
scope: source.subrip
file_extensions:
- srt
- subrip
contexts:
main:
- match: "^([1-9][0-9]*)$"
scope: variable.other.readwrite.subrip
- match: '^(\d{2}:[0-5][0-9]:[0-5][0-9],\d{3}) (-->) (\d{2}:[0-5][0-9]:[0-5][0-9],\d{3})$'
captures:
1: constant.other.time.subrip
2: keyword.operator.assignment.subrip
3: constant.other.time.subrip
- match: .+
push:
- meta_scope: string.literal.subrip
- match: (\n\r|\n)
pop: true
- match: (\</?)((?i:b|i|u|font)\b)
captures:
1: punctuation.definition.tag.begin.html
2: entity.name.tag.inline.any.html
push:
- match: '((?: ?/)?\>)'
captures:
1: punctuation.definition.tag.end.html
pop: true
- match: (<b>)(.*)(<\/b>)
captures:
1: punctuation.definition.tag.begin.html
2: entity.name.tag.inline.any.html
3: punctuation.definition.tag.end.html

File diff suppressed because it is too large Load diff