Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

REPL demo: add nanorctheme.template #761

Merged
merged 1 commit into from
Dec 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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*: