mirror of
https://github.com/tonydamage/nux-env.git
synced 2025-12-11 13:24:28 +01:00
43 lines
726 B
Text
Executable file
43 lines
726 B
Text
Executable file
#!/usr/bin/env nux-runner
|
|
|
|
nux.use nudsl
|
|
|
|
## highlight:: <language> <file>
|
|
|
|
task.highlight() {
|
|
nux.use nux/nuxsh
|
|
nux.dsl.process highlight nux.nuxsh.language.def "$2"
|
|
}
|
|
|
|
task.language.show() {
|
|
nudsl.language.cache lang.yanglike.def
|
|
}
|
|
|
|
task.plan() {
|
|
nuxr.run.subtask "$@"
|
|
}
|
|
|
|
task.plan.compile() {
|
|
nux.use nudsl/$1
|
|
nudsl.plan lang.$1.def "$2"
|
|
}
|
|
|
|
task.plan.preview() {
|
|
nux.use nux/nuxsh
|
|
nux.dsl.plan nux.nuxsh.language "$2"
|
|
plan="$(nudsl.plan.file "$1" "$2")"
|
|
if [ -e "$plan" ]; then
|
|
if [ -n "$(which pygmentize)" ]; then
|
|
pygmentize -l bash "$plan";
|
|
else
|
|
cat "$plan";
|
|
fi
|
|
else
|
|
echo "Plan not available"
|
|
fi
|
|
}
|
|
|
|
task.run() {
|
|
echo "$@"
|
|
nudsl.process "lang.yanglike.def" "$2"
|
|
}
|