Created
October 7, 2010 17:55
-
-
Save cowboy/615538 to your computer and use it in GitHub Desktop.
TextMate + Zen Coding + SyntaxHighlighter + this = yay
This file contains hidden or 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
{ name = 'source.css.embedded.html.syntaxhighlighter'; | |
begin = '(?:^\s+)?(<)((?i:pre))\b(?=[^>]*class=([''"])[^>]*?\bbrush\s*:\s*css\b[^>]*?\3)(?![^>]*/>)'; | |
end = '(?<=</(pre|PRE))(>)(?:\s*\n)?'; | |
beginCaptures = { | |
1 = { name = 'punctuation.definition.tag.html'; }; | |
2 = { name = 'entity.name.tag.style.html'; }; | |
}; | |
endCaptures = { 2 = { name = 'punctuation.definition.tag.html'; }; }; | |
patterns = ( | |
{ include = '#tag-stuff'; }, | |
{ begin = '(>)'; | |
end = '(?=</(?i:pre))'; | |
beginCaptures = { 1 = { name = 'punctuation.definition.tag.html'; }; }; | |
patterns = ( | |
{ include = '#embedded-code'; }, | |
{ include = 'source.css'; }, | |
); | |
}, | |
); | |
}, | |
{ name = 'source.js.jquery.embedded.html.syntaxhighlighter'; | |
begin = '(?:^\s+)?(<)((?i:pre))\b(?=[^>]*class=([''"])[^>]*?\bbrush\s*:\s*js\b[^>]*?\3)(?![^>]*/>)'; | |
end = '(?<=</(pre|PRE))(>)(?:\s*\n)?'; | |
beginCaptures = { | |
1 = { name = 'punctuation.definition.tag.html'; }; | |
2 = { name = 'entity.name.tag.script.html'; }; | |
}; | |
endCaptures = { 2 = { name = 'punctuation.definition.tag.html'; }; }; | |
patterns = ( | |
{ include = '#tag-stuff'; }, | |
{ begin = '(?<!</(?:pre|PRE))(>)'; | |
end = '(</)((?i:pre))'; | |
captures = { | |
1 = { name = 'punctuation.definition.tag.html'; }; | |
2 = { name = 'entity.name.tag.script.html'; }; | |
}; | |
patterns = ( | |
{ name = 'comment.line.double-slash.js'; | |
match = '(//).*?((?=</script)|$\n?)'; | |
captures = { 1 = { name = 'punctuation.definition.comment.js'; }; }; | |
}, | |
{ name = 'comment.block.js'; | |
begin = '/\*'; | |
end = '\*/|(?=</script)'; | |
captures = { 0 = { name = 'punctuation.definition.comment.js'; }; }; | |
}, | |
{ include = '#php'; }, | |
{ include = 'source.js'; }, | |
); | |
}, | |
); | |
}, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
TextMate grammar snippet for parsing SyntaxHighlighter
<pre class="brush:js">
or<pre class="brush:css">
blocks - I manually added this into the Zen Coding HTML Zen language grammar like so:http://benalman.com/grab/e997a1.png
This is a really quick hack, please fork it and make it more awesome!