aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRobin Haberkorn <robin.haberkorn@googlemail.com>2022-11-26 05:39:45 +0300
committerRobin Haberkorn <robin.haberkorn@googlemail.com>2022-11-27 19:12:54 +0300
commit85599c7e929237c61fb4b7857935475a6e57c8ec (patch)
tree0634800d38b848bff474d38ac78b9c214bb9799b
parent2a5dbe746e32df09c3913a68444fc13011a7f84e (diff)
downloadsciteco-85599c7e929237c61fb4b7857935475a6e57c8ec.tar.gz
added Markdown and YAML lexer configs
* For markdown.tes we should better introduce new predefined colors in the color scheme files since it doesn't map well to existing colors. For italic and bold, I am not using the predefined colors at all but only set the bold and italic style attributes -- this should still be portable across color schemes.
-rw-r--r--lib/Makefile.am4
-rw-r--r--lib/lexers/markdown.tes26
-rw-r--r--lib/lexers/yaml.tes24
3 files changed, 53 insertions, 1 deletions
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 6e13712..c528636 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -89,7 +89,9 @@ dist_lexer_DATA = lexers/verilog.tes \
lexers/rust.tes \
lexers/blitzbasic.tes \
lexers/caml.tes \
- lexers/python.tes
+ lexers/python.tes \
+ lexers/yaml.tes \
+ lexers/markdown.tes
# This lexer is responsible for styling
# womanpages and is thus useful even when omitting
diff --git a/lib/lexers/markdown.tes b/lib/lexers/markdown.tes
new file mode 100644
index 0000000..9129d5f
--- /dev/null
+++ b/lib/lexers/markdown.tes
@@ -0,0 +1,26 @@
+!* Markdown *!
+
+@[lexer.test.markdown]{
+ :EN*.mdQ*"S -1 '
+ :EN*.markdownQ*
+}
+
+@[lexer.set.markdown]{
+ ESSETILEXERmarkdown
+ 1,2ESSTYLESETBOLD
+ 1,3ESSTYLESETBOLD
+ 1,4ESSTYLESETITALIC
+ 1,5ESSTYLESETITALIC
+ !* FIXME: We probably need separate color codes *!
+ :M[color.preproc],6M[color.set]
+ 6U.i 5<:M[color.preproc2],%.iM[color.set]>
+ :M[color.keyword],13M[color.set]
+ :M[color.keyword],14M[color.set]
+ :M[color.comment],15M[color.set]
+ :M[color.deletion],16M[color.set]
+ :M[color.keyword],17M[color.set]
+ :M[color.variable],18M[color.set]
+ :M[color.string],19M[color.set]
+ :M[color.string],20M[color.set]
+ :M[color.string2],21M[color.set]
+}
diff --git a/lib/lexers/yaml.tes b/lib/lexers/yaml.tes
new file mode 100644
index 0000000..45104e7
--- /dev/null
+++ b/lib/lexers/yaml.tes
@@ -0,0 +1,24 @@
+!* YAML files *!
+
+@[lexer.test.yaml]{
+ :EN*.yamlQ*"S -1 '
+ :EN*.ymlQ*"S -1 '
+ :EN*.clang-formatQ*"S -1 '
+ :EN*.clang-tidyQ*"S -1 '
+ :EN*.mirQ*"S -1 '
+ :EN*.apinotesQ*"S -1 '
+ :EN*.ifsQ*
+}
+
+@[lexer.set.yaml]{
+ ESSETILEXERyaml
+ 0ESSETKEYWORDStrue false yes no
+ :M[color.comment],1M[color.set]
+ :M[color.target],2M[color.set]
+ :M[color.keyword],3M[color.set]
+ :M[color.number],4M[color.set]
+ :M[color.variable],5M[color.set]
+ :M[color.preproc],6M[color.set]
+ :M[color.error],8M[color.set]
+ :M[color.operator],9M[color.set]
+}