Skip to content

Commit

Permalink
REPL demo: add nanorctheme.template (#761)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattirn authored Dec 20, 2021
1 parent 233a6cc commit aa11f6e
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 0 deletions.
1 change: 1 addition & 0 deletions demo/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@
<includes>
<include>init.jline</include>
<include>data.json</include>
<include>apply-colors.sh</include>
</includes>
</resource>
</resources>
Expand Down
22 changes: 22 additions & 0 deletions demo/src/main/scripts/apply-colors.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env bash

theme=${PROFILE_NAME,,}
theme=${theme// /-}'.nanorctheme'
cp nanorctheme.template ${theme}
sed -i "s/%COLOR_01/${COLOR_01}/g" ${theme}
sed -i "s/%COLOR_02/${COLOR_02}/g" ${theme}
sed -i "s/%COLOR_03/${COLOR_03}/g" ${theme}
sed -i "s/%COLOR_04/${COLOR_04}/g" ${theme}
sed -i "s/%COLOR_05/${COLOR_05}/g" ${theme}
sed -i "s/%COLOR_06/${COLOR_06}/g" ${theme}
sed -i "s/%COLOR_07/${COLOR_07}/g" ${theme}
sed -i "s/%COLOR_08/${COLOR_08}/g" ${theme}
sed -i "s/%COLOR_09/${COLOR_09}/g" ${theme}
sed -i "s/%COLOR_10/${COLOR_10}/g" ${theme}
sed -i "s/%COLOR_11/${COLOR_11}/g" ${theme}
sed -i "s/%COLOR_12/${COLOR_12}/g" ${theme}
sed -i "s/%COLOR_13/${COLOR_13}/g" ${theme}
sed -i "s/%COLOR_14/${COLOR_14}/g" ${theme}
sed -i "s/%COLOR_15/${COLOR_15}/g" ${theme}
sed -i "s/%COLOR_16/${COLOR_16}/g" ${theme}
exit
60 changes: 60 additions & 0 deletions demo/src/main/scripts/nanorc/nanorctheme.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#
# This file describes a default scheme template for nanorc syntax highlighting for terminals with dark background
#
# Actual nanorc themes can be generated using the themes available on https://mayccoll.github.io/Gogh/themes.
#
# Linux:
# \> cd git/jline3
# \> ./build rebuild
# \> cd git/jline3/demo/target/nanorc
# \> bash -c "$(wget -qO- https://git.io/vQgMr)"
# ...
#

PLAIN %COLOR_08
FUNCTION %COLOR_11
STRING %COLOR_15
COMMENT %COLOR_07
DOC_COMMENT %COLOR_15
TYPE %COLOR_13
BOOLEAN %COLOR_16
NULL %COLOR_07
NUMBER %COLOR_05
VARIABLE %COLOR_12
PACKAGE %COLOR_03
CLASS %COLOR_03
CONSTANT %COLOR_04
OPERATOR %COLOR_04
COMMAND %COLOR_11
OPTION %COLOR_04
KEYWORD %COLOR_16
JUMP %COLOR_15
SECTION %COLOR_11
ATTRIBUTE %COLOR_03
PATH %COLOR_13
EXECUTABLE %COLOR_03
LINK %COLOR_07
TITLE %COLOR_13
ESCAPE %COLOR_01,%COLOR_07
DEBUG %COLOR_14
ERROR %COLOR_02
TODO %COLOR_16,%COLOR_07
WARNING ,%COLOR_02
WHITESPACE ,%COLOR_03
HEADER bold,%COLOR_13,~grey7,underline
ROW_NUMBER bold,%COLOR_13,~grey7
ROW_STYLE ,~grey15
LIST_BACKGROUND ,~grey42
LIST_GROUP %COLOR_04
#
# mixin
#
+FUNCTION FUNCTION: "[A-Za-z_][A-Za-z0-9_]*[[:space:]]*[(]" \n PLAIN: "[(]"
+LINT WHITESPACE: "[[:space:]]+$" \n WARNING: "\t*"
+LONG_LINE_WARNING WARNING: "^.{81,}$"
#
# parser
#
$LINE_COMMENT COMMENT \n TODO: "FIXME|TODO|XXX"
$BLOCK_COMMENT COMMENT \n DOC_COMMENT: startWith=/** \n TODO: "FIXME|TODO|XXX"
$BALANCED_DELIMITERS STRING \n VARIABLE: continueAs=\s*:

0 comments on commit aa11f6e

Please sign in to comment.