Syntax highlighting

Peter [verath]
12 years ago | edited 12 years ago

0

Just putting it here, one of those features that’s probably not very important to get right away, but I still feel like it would add a lot, especially to the level sub-forums. http://alexgorbatchev.com/SyntaxHighlighter/ works great from what I’ve seen. Got most of the languages you’ll ever need, it’s purely javascript based and supports cool stuff like line-highlighting.

Edit: here is some code to include it, set every code element to js and highlight them.
var baseURL = "http://verath.ibepeter.com/scripts/syntaxhighlighter_3.0.83/"; var styles = ["shCoreFadeToGrey.css", "shThemeFadeToGrey.css"]; $.each(styles, function(i, s){ $('head').append( $('<link rel="stylesheet" type="text/css">') .attr('href', baseURL + "styles/" + s) ); }); $('pre.bbcode_code_body').addClass('brush: js'); $.getScript(baseURL + "scripts/shCore.js", function(){ $.getScript(baseURL + "scripts/shBrushJScript.js", function(){ SyntaxHighlighter.defaults['toolbar'] = false; SyntaxHighlighter.defaults['class-name'] = 'bbcode_code_body'; SyntaxHighlighter.highlight(); }); });

1reply
2voices
123views
Luke [flabbyrabbit]
12 years ago

0

Suggestion accepted!

You must be logged in to reply to this discussion. Login
1 of 2

This site only uses cookies that are essential for the functionality of this website. Cookies are not used for tracking or marketing purposes.

By using our site, you acknowledge that you have read and understand our Privacy Policy, and Terms of Service.

Dismiss