I followed this in an attempt to enable perl syntax highlighting based on a few additional file extensions...
https://confluence.atlassian.com/display/STASHKB/Configuring+syntax+highlighting+for+file+extensions
So I've added this to the bottom of the stash-config.properties file and restarted stash...
syntax.highlighter.perl.executables=perlsyntax.highlighter.perl.extensions=au_irules,tmpl
But files ending in au_irules and tmpl are not showing any syntax highlighting. Note these files are actually tcl syntax, but I figured it was closest to perl.
As mentioned on the knowledge base article this is only available in Stash 2.7 and above. Stash 2.7 has not been released yet but will be within the coming days.
Doh!
Thanks, looks like I'm all set for when it's released then.
I'm trying to get this working for Java syntax highlighting but to no avail. Can you please provide an example stash-config.properties file?
Mine looks like this, but as you can probably see I'm just guessing at settings:
$ cat ../stash-home/stash-config.properties syntax.highlighter.perl.executables=perl syntax.highlighter.perl.extensions=au_irules,tmpl syntax.highlighter.java.executables=java syntax.highlighter.java.extensions=java syntax.highlighter.javascript.executables=java syntax.highlighter.javascript.extensions=js
Logs don't show any relevant information. I'm using Stash 2.8.2 on Linux.
@Chris - there's a link to http://highlightjs.org/static/test.html on the Configuring syntax highlighting for file extensions page. There you can see java and js should be already included. How are you verifying that this doesn't work? Some pages don't support syntax highlighting.
You've added my perl extensions, which unless you have perl files ending with au_irules and tmpl extensions isn't going to help you much.
To be honest, I don't fully understand what the syntax.highlighter.<language>.executables option does. Since I wanted to add more files to the perl syntax highlighting, I just copied the perl example and added my file extensions to the extensions option.
Hi Kelly,
The version of highlight.js that we ship at the moment is 7.3. We ship the entire packed highlight file which you should be able to find here:
atlassian-stash/static/lib/highlight/highlight.pack.js
Our default configuration is a little harder to locate, it's stored in the stash-platform.jar:
atlassian-stash/WEB-INF/lib/stash-platformat-$VERSION.jar$stash-default.properties
It looks like Clojure is missing from our default list. I'll add it now to our next release (2.11), but feel free to add it to your own stash-config.properties file for now and it should start working straight away.
syntax.highlighter.clojure.extensions=clj
Cheers,
Charles
Thanks! I made the change already, and I'll schedule a restart of Stash during planned maintenance later this week.
Hi!
Any ETA as to when Stash will upgrade to version 8.0 of highlight.js? If not, could the upgrade be done on a local Stash server manually?
Thanks!
We're experimenting with libraries other than highlight.js and there's a good chance we'll be moving away from that in the future. So there's no upgrade planned on our end.
You could theoretically do it on your local server by overwriting the highlight.pack.js file (and idea.css) but it's possible things will break. We wouldn't be able to help you with it in Support.
It looks like you're new here. Sign in or register to get started.