pejuko / coderay_bash Goto Github PK
View Code? Open in Web Editor NEWSimple bash scanner for highlighting with coderay.
Home Page: coderay_bash
License: MIT License
Simple bash scanner for highlighting with coderay.
Home Page: coderay_bash
License: MIT License
github.com/rubychan/coderay/issues/19
korny is saying this file causes the scanner to break.
svn.rubychan.de/coderay-scanner-tests/trunk/bash/example.in.sh
This works correctly in pygments
blueberry=$(date -d "$(stat -c %z blueberry.exe)")
A workaround for coderay is to un-nest the commands
blueberry=$(stat -c %z blueberry.exe)
blueberry=$(date -d "$blueberry")
Maybe I am doing something wrong, but this is not working for me
$ gem list
*** LOCAL GEMS ***
coderay (1.0.5)
coderay_bash (1.0)
$ coderay -bash coderay.md
CodeRay::Scanners could not load plugin :bash; falling back to :text
When using instance instead of local variables for state and quote, it would be possible to re-use this scanner inside others (e.g. RHTML/ERB scanner with bash instead of html templates). If ERB is used within Bash quoted strings, the bash scanner continues in state :initial now after the ERB snippet instead of :quote.
This is supported in pygments. An example would be from this own repo
s.description = <<EOF
Bash highlighting for coderay. This gem was tested with coderay 1.0 and won't work with
coderay < 1.0.
EOF
github.com/pejuko/coderay_bash/blob/master/coderay_bash.gemspec
I have a dirty patch here
bash-scanner.diff
coderay_bash-1.0.3
cat $1 | while read json; do if [[ ${array2[0]} == 1 ]]; then
echo $json | ......
ActionView::Template::Error (
***ERROR in scanner.rb:200:in `rescue in tokenize': undefined method `index' for nil:NilClass (after 0 tokens)
tokens:
current line: 37 column: 48 pos: 612
matched: "${array2[0]}" state: "Error in CodeRay::Scanners::Bash#scan_tokens, initial state was: :initial"
bol? = false, eos? = false
surrounding code:
"ad json; do if [[ ${array2[0]}" ~~ " == 1 ]]; then\necho $json | aw"
#!/bin/sh
sudo qemu-kvm -m 768 \
-boot d \
-drive file=/bak/kvm/salix.qcow,cache=writeback \
-cdrom /ntfs-d/ISO/salix64-openbox-14.1.iso -vnc :3
output with coderay, I got:
#!/bin/sh
sudo qemu-kvm -m 768 \
-boot d \
-drive file=writeback \
-cdrom /ntfs-d/ISO/salix64-openbox-14.1.iso -vnc :3
I don't know why /bak/kvm/salix.qcow,cache=
entire is stripped.
Thanks.
Hi, could you clarify license for this gem? Thank you.
function pscr() {
[ "${allargs/-v/}" != "$allargs" ] && echo "$@" && return 0 || return 1
}
***ERROR in scanner.rb:200:in tokenize': undefined method
first' for nil:NilCl
ass (after 0 tokens)
tokens:
current line: 2 column: 16 pos: 27
matched: ")" state: "Error in CodeRay::Scanners::Bash#scan_tokens, initial stat
e was: :initial"
bol? = false, eos? = false
surrounding code:
"fi\n" ~~ " {\n [ "${allargs/-v/}" != "$a"
I get the following error when running bundle install
:
Bundler could not find compatible versions for gem "coderay":
In Gemfile:
coderay_bash depends on
coderay (< 1.0)
coderay (1.0.0)
Coderay v1.0 is installed already.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.