28 Oct, 2008

Published at 02:39PM

Tagged with github, ruby, and syntax

This post has 1 comment

GitHub theme for syntax gem

I briefly mentioned how the new syntax highlighting resembles that of GitHub’s when I announced the redo of this site. Well, if you’re using the syntax gem and want the look and feel of GitHub, paste this somewhere in your CSS.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
.ruby .keyword    { font-weight: bold;  }
.ruby .class      { color:#445588; 
                    font-weight: bold;  }
.ruby .method     { color:#990000; 
                    font-weight:bold;   }
.ruby .constant   { color: #177F80;     }
.ruby .global     { color: #177F80;     }
.ruby .punct      { color: #333;        }
.ruby .attribute  { color: #0086B3;     }
.ruby .comment    { color: #999988; 
                    font-style: italic; }
.ruby .regex      { color: #159828;     }
.ruby .string     { color:#D81745;      }
.ruby .expr       { color:#D81745;      }
.ruby .number     { color: #1C9898;     }
.ruby .symbol     { color: #960B73;     }
.ruby .pre-strong { font-weight: bold;  }
.ruby .escape     {                     }
.ruby .ident      {                     }

Also, improvements are welcome!

Comments

Anthony Carapetis Monday, 16 Nov, 2009 Posted at 10:13PM

Hey, I love github’s syntax highlighting theme, too – I ported it to gvim if anyone’s interested: see here

Thanks to Ryan for laying out some of the colours here, saved me lots of time :)

Do you have something to say about this post?
Retype the image to the right Spam Hint: Are You Human? Textile Formatting Tips

or

Ryan Heath | Site Management A Ruby on Rails production.

This site is a Formed Function. Formed Function LLC | @formedfunction | Get in Touch