Created
August 22, 2012 23:32
-
-
Save markbrown4/3430542 to your computer and use it in GitHub Desktop.
Prism Rails theme HTML, CSS, Javascript, Ruby, Coffeescript, Haml
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
// borrowed from https://github.com/samflores | |
Prism.languages.ruby = { | |
'comment': /#[^\r\n]*(\r?\n|$)/g, | |
'string': /("|')(\\?.)*?\1/g, | |
'regex': { | |
pattern: /(^|[^/])\/(?!\/)(\[.+?]|\\.|[^/\r\n])+\/[gim]{0,3}(?=\s*($|[\r\n,.;})]))/g, | |
lookbehind: true | |
}, | |
'keyword': /\b(alias|and|BEGIN|begin|break|case|class|def|define_method|defined|do|each|else|elsif|END|end|ensure|false|for|if|in|module|new|next|nil|not|or|raise|redo|rescue|retry|return|self|super|then|throw|true|undef|unless|until|when|while|yield)\b/g, | |
'builtin': /\b(Array|Bignum|Binding|Class|Continuation|Dir|Exception|FalseClass|File|Stat|File|Fixnum|Fload|Hash|Integer|IO|MatchData|Method|Module|NilClass|Numeric|Object|Proc|Range|Regexp|String|Struct|TMS|Symbol|ThreadGroup|Thread|Time|TrueClass)\b/, | |
'boolean': /\b(true|false)\b/g, | |
'number': /\b-?(0x)?\d*\.?\d+\b/g, | |
'operator': /[-+]{1,2}|!|=?<|=?>|={1,2}|(&){1,2}|\|?\||\?|\*|\//g, | |
'inst-var': /[@&]\b[a-zA-Z_][a-zA-Z_0-9]*[?!]?\b/g, | |
'namespace': /::\b[a-zA-Z_][a-zA-Z_0-9]*[?!]?\b/g, | |
'symbol': /:\b[a-zA-Z_][a-zA-Z_0-9]*[?!]?\b/g, | |
'const': /\b[A-Z][a-zA-Z_0-9]*[?!]?\b/g, | |
'ignore': /&(lt|gt|amp);/gi, | |
'punctuation': /[{}[\];(),.:]/g | |
}; | |
Prism.languages.coffee = { | |
'string': /("|')(\\?.)*?\1/g, | |
'comment': /#[^\r\n]*(\r?\n|$)/g, | |
'regex': { | |
pattern: /(^|[^/])\/(?!\/)(\[.+?]|\\.|[^/\r\n])+\/[gim]{0,3}(?=\s*($|[\r\n,.;})]))/g, | |
lookbehind: true | |
}, | |
'boolean': /\b(true|false)\b/g, | |
'number': /\b-?(0x)?\d*\.?\d+\b/g, | |
'arrow': /(-|=)>/g, | |
'operator': /[-+]{1,2}|!|={1,2}|(&){1,2}|\|?\||\?|\*|\//g, | |
'var': /[@&]\b[a-zA-Z_][a-zA-Z_0-9]*[?!]?\b/g, | |
'class': /\b[A-Z][a-zA-Z_0-9]*[?!]?\b/g, | |
'ignore': /&(lt|gt|amp);/gi, | |
'punctuation': /[{}[\];(),.:]/g | |
}; | |
Prism.languages.haml = { | |
'string': /("|')(\\?.)*?\1/g, | |
'comment': /\/[^\r\n]*(\r?\n|$)/g, | |
'boolean': /\b(true|false)\b/g, | |
'number': /\b-?(0x)?\d*\.?\d+\b/g, | |
'tag': /%[a-zA-Z_0-9]*\b/g, | |
'var': /[@&]\b[a-zA-Z_0-9]*[?!]?\b/g, | |
'operator': /[-+]{1,2}|!|={1,2}|(&){1,2}|\|?\||\?|\*|\//g, | |
'rails': /(form_tag|do|end|link_to|image_tag|content_for)/g, | |
'ignore': /&(lt|gt|amp);/gi | |
}; | |
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
pre { | |
margin-bottom: 30px; | |
border-radius: 3px; | |
overflow: auto; | |
font: 13px/1.3 Monaco, monospace; | |
text-shadow: 0 1px 1px rgba(#000, .7); | |
background: #333; | |
color: #fff; | |
padding: 20px; | |
.comment { color: #aeaeae } | |
} | |
.language-html { | |
.attr-value { color: #a0ffe1 } | |
.punctuation, .doctype, .tag { color: #a0cbff } | |
} | |
.language-css { | |
color: #a0ffe1; | |
.punctuation, .selector { color: #fff } | |
.property { color: #a0cbff } | |
} | |
.language-javascript, .language-coffee { | |
.string, .number { color: #a0ffe1 } | |
.keyword, .type, .class, .var { color: #a0cbff } | |
} | |
.language-ruby { | |
.string, .symbol { color: #a0ffe1 } | |
.namespace, .const { color: #a0cbff } | |
} | |
.language-haml { | |
.string, .symbol { color: #a0ffe1 } | |
.tag, .rails, .var { color: #a0cbff } | |
} | |
.language-shell { | |
background: #191919; | |
color: #84ff95; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment