Created
July 6, 2019 03:49
-
-
Save tamizhvendan/7218386b956e83c0233bdfc4b6367513 to your computer and use it in GitHub Desktop.
PrismJs Rainbow Parentheses Extension
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var level = 0 | |
Prism.hooks.add('wrap', function (env) { | |
if (env.language == "clojure" && env.type == "punctuation") { | |
if (env.content == "(" || env.content == "[" || env.content == "{") { | |
level++; | |
env.classes.push("rbl" + level); | |
} | |
if (env.content == ")" || env.content == "]" || env.content == "}") { | |
env.classes.push("rbl" + level); | |
level--; | |
} | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.rbl1 { | |
color: #ccc !important; | |
} | |
.rbl2 { | |
color: #0098e6 !important; | |
} | |
.rbl3 { | |
color: #e16d6d !important; | |
} | |
.rbl4 { | |
color: #3fa455 !important; | |
} | |
.rbl5 { | |
color: #c968e6 !important; | |
} | |
.rbl6 { | |
color: #999 !important; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Sample output from my Clojure blog posts