Syntax highlighting.

This commit is contained in:
Barry Clark 2014-02-18 20:26:49 -05:00
parent b1838427fc
commit d1cd52c7be
5 changed files with 221 additions and 161 deletions

View file

@ -23,11 +23,12 @@ google_analytics:
# Links used for your social icons # Links used for your social icons
links: links:
github: https://github.com/YOUR-USERNAME github: your-username
twitter: https://twitter.com/YOUR-USERNAME twitter: your-username
#linkedin: https://linkedin.com/in/YOUR-USERNAME
markdown: rdiscount markdown: rdiscount
pygments: true
permalink: /:title
# Exclude these files from your production _site # Exclude these files from your production _site
exclude: exclude:

View file

@ -37,10 +37,8 @@
<footer class="footer"> <footer class="footer">
<ul> <ul>
<li><a href="http://github.com/{{ site.github }}">@{{ site.github }} on GitHub</a></li> <li><a href="http://github.com/{{ site.links.github }}">{{ site.links.github }} on GitHub</a></li>
<li><a href="http://twitter.com/{{ site.twitter }}">@{{ site.twitter }} on Twitter</a></li> <li><a href="http://twitter.com/{{ site.links.twitter }}">{{ site.links.twitter }} on Twitter</a></li>
<li><a href="http://instagram.com/{{ site.instagram }}">@{{ site.instagram }} on Instagram</a></li>
<li><a href="http://dribbble.com/{{ site.dribbble }}">@{{ site.dribbble }} on Dribbble</a></li>
</ul> </ul>
</footer> </footer>

View file

@ -36,20 +36,21 @@ Inline markup styles:
> Blockquote > Blockquote
>> Nested Blockquote >> Nested Blockquote
Code: Syntax highlighting can be used by wrapping your code in a liquid tag like so:
// Code is just text indented a bit {{ "{% highlight javascript " }}%}
which(is_easy) to_remember(); /* Some pointless Javascript */
var rawr = ["r", "a", "w", "r"];
{{ "{% endhighlight " }}%}
~~~ creates...
// Markdown extra adds un-indented code blocks too {% highlight javascript %}
if (this_is_more_code == true && !indented) { /* Some pointless Javascript */
// tild wrapped code blocks, also not indented var rawr = ["r", "a", "w", "r"];
}
~~~ {% endhighlight %}
Use two trailing spaces Use two trailing spaces
on the right on the right

View file

@ -1,60 +1,87 @@
.highlight { background: #ffffff; } .highlight {
.highlight .c { color: #999988; font-style: italic } /* Comment */ background-color: $darkerGray;
.highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */ padding: 5px 10px;
.highlight .k { font-weight: bold } /* Keyword */ margin: 20px 0;
.highlight .o { font-weight: bold } /* Operator */ }
.highlight .cm { color: #999988; font-style: italic } /* Comment.Multiline */
.highlight .cp { color: #999999; font-weight: bold } /* Comment.Preproc */ .highlight pre {
.highlight .c1 { color: #999988; font-style: italic } /* Comment.Single */ // overflow: scroll; // Prefer no word wrap? Uncomment this line and comment out the 2 lines below.
.highlight .cs { color: #999999; font-weight: bold; font-style: italic } /* Comment.Special */ word-break: break-all;
.highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */ word-wrap: break-word;
.highlight .gd .x { color: #000000; background-color: #ffaaaa } /* Generic.Deleted.Specific */ }
.highlight .ge { font-style: italic } /* Generic.Emph */
.highlight .gr { color: #aa0000 } /* Generic.Error */ code {
.highlight .gh { color: #999999 } /* Generic.Heading */ font-family: 'Courier', monospace;
.highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */ font-size: 14px;
.highlight .gi .x { color: #000000; background-color: #aaffaa } /* Generic.Inserted.Specific */ }
.highlight .go { color: #888888 } /* Generic.Output */
.highlight .gp { color: #555555 } /* Generic.Prompt */ // Solarized Light Pygments
.highlight .gs { font-weight: bold } /* Generic.Strong */ // Thanks https://gist.github.com/edwardhotchkiss/2005058
.highlight .gu { color: #aaaaaa } /* Generic.Subheading */ .highlight .c, .highlight .c1 { color: #586E75 } /* Comment */
.highlight .gt { color: #aa0000 } /* Generic.Traceback */ .highlight .err { color: #93A1A1 } /* Error */
.highlight .kc { font-weight: bold } /* Keyword.Constant */ .highlight .g { color: #93A1A1 } /* Generic */
.highlight .kd { font-weight: bold } /* Keyword.Declaration */ .highlight .k { color: #859900 } /* Keyword */
.highlight .kp { font-weight: bold } /* Keyword.Pseudo */ .highlight .l { color: #93A1A1 } /* Literal */
.highlight .kr { font-weight: bold } /* Keyword.Reserved */ .highlight .n { color: #93A1A1 } /* Name */
.highlight .kt { color: #445588; font-weight: bold } /* Keyword.Type */ .highlight .o { color: #859900 } /* Operator */
.highlight .m { color: #009999 } /* Literal.Number */ .highlight .x { color: #CB4B16 } /* Other */
.highlight .s { color: #d14 } /* Literal.String */ .highlight .p { color: #93A1A1 } /* Punctuation */
.highlight .na { color: #008080 } /* Name.Attribute */ .highlight .cm { color: #586E75 } /* Comment.Multiline */
.highlight .nb { color: #0086B3 } /* Name.Builtin */ .highlight .cp { color: #859900 } /* Comment.Preproc */
.highlight .nc { color: #445588; font-weight: bold } /* Name.Class */ .highlight .c1 { color: #586E75 } /* Comment.Single */
.highlight .no { color: #008080 } /* Name.Constant */ .highlight .cs { color: #859900 } /* Comment.Special */
.highlight .ni { color: #800080 } /* Name.Entity */ .highlight .gd { color: #2AA198 } /* Generic.Deleted */
.highlight .ne { color: #990000; font-weight: bold } /* Name.Exception */ .highlight .ge { color: #93A1A1; font-style: italic } /* Generic.Emph */
.highlight .nf { color: #990000; font-weight: bold } /* Name.Function */ .highlight .gr { color: #DC322F } /* Generic.Error */
.highlight .nn { color: #555555 } /* Name.Namespace */ .highlight .gh { color: #CB4B16 } /* Generic.Heading */
.highlight .nt { color: #000080 } /* Name.Tag */ .highlight .gi { color: #859900 } /* Generic.Inserted */
.highlight .nv { color: #008080 } /* Name.Variable */ .highlight .go { color: #93A1A1 } /* Generic.Output */
.highlight .ow { font-weight: bold } /* Operator.Word */ .highlight .gp { color: #93A1A1 } /* Generic.Prompt */
.highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .gs { color: #93A1A1; font-weight: bold } /* Generic.Strong */
.highlight .mf { color: #009999 } /* Literal.Number.Float */ .highlight .gu { color: #CB4B16 } /* Generic.Subheading */
.highlight .mh { color: #009999 } /* Literal.Number.Hex */ .highlight .gt { color: #93A1A1 } /* Generic.Traceback */
.highlight .mi { color: #009999 } /* Literal.Number.Integer */ .highlight .kc { color: #CB4B16 } /* Keyword.Constant */
.highlight .mo { color: #009999 } /* Literal.Number.Oct */ .highlight .kd { color: #268BD2 } /* Keyword.Declaration */
.highlight .sb { color: #d14 } /* Literal.String.Backtick */ .highlight .kn { color: #859900 } /* Keyword.Namespace */
.highlight .sc { color: #d14 } /* Literal.String.Char */ .highlight .kp { color: #859900 } /* Keyword.Pseudo */
.highlight .sd { color: #d14 } /* Literal.String.Doc */ .highlight .kr { color: #268BD2 } /* Keyword.Reserved */
.highlight .s2 { color: #d14 } /* Literal.String.Double */ .highlight .kt { color: #DC322F } /* Keyword.Type */
.highlight .se { color: #d14 } /* Literal.String.Escape */ .highlight .ld { color: #93A1A1 } /* Literal.Date */
.highlight .sh { color: #d14 } /* Literal.String.Heredoc */ .highlight .m { color: #2AA198 } /* Literal.Number */
.highlight .si { color: #d14 } /* Literal.String.Interpol */ .highlight .s { color: #2AA198 } /* Literal.String */
.highlight .sx { color: #d14 } /* Literal.String.Other */ .highlight .na { color: #93A1A1 } /* Name.Attribute */
.highlight .sr { color: #009926 } /* Literal.String.Regex */ .highlight .nb { color: #B58900 } /* Name.Builtin */
.highlight .s1 { color: #d14 } /* Literal.String.Single */ .highlight .nc { color: #268BD2 } /* Name.Class */
.highlight .ss { color: #990073 } /* Literal.String.Symbol */ .highlight .no { color: #CB4B16 } /* Name.Constant */
.highlight .bp { color: #999999 } /* Name.Builtin.Pseudo */ .highlight .nd { color: #268BD2 } /* Name.Decorator */
.highlight .vc { color: #008080 } /* Name.Variable.Class */ .highlight .ni { color: #CB4B16 } /* Name.Entity */
.highlight .vg { color: #008080 } /* Name.Variable.Global */ .highlight .ne { color: #CB4B16 } /* Name.Exception */
.highlight .vi { color: #008080 } /* Name.Variable.Instance */ .highlight .nf { color: #268BD2 } /* Name.Function */
.highlight .il { color: #009999 } /* Literal.Number.Integer.Long */ .highlight .nl { color: #93A1A1 } /* Name.Label */
.highlight .nn { color: #93A1A1 } /* Name.Namespace */
.highlight .nx { color: #555 } /* Name.Other */
.highlight .py { color: #93A1A1 } /* Name.Property */
.highlight .nt { color: #268BD2 } /* Name.Tag */
.highlight .nv { color: #268BD2 } /* Name.Variable */
.highlight .ow { color: #859900 } /* Operator.Word */
.highlight .w { color: #93A1A1 } /* Text.Whitespace */
.highlight .mf { color: #2AA198 } /* Literal.Number.Float */
.highlight .mh { color: #2AA198 } /* Literal.Number.Hex */
.highlight .mi { color: #2AA198 } /* Literal.Number.Integer */
.highlight .mo { color: #2AA198 } /* Literal.Number.Oct */
.highlight .sb { color: #586E75 } /* Literal.String.Backtick */
.highlight .sc { color: #2AA198 } /* Literal.String.Char */
.highlight .sd { color: #93A1A1 } /* Literal.String.Doc */
.highlight .s2 { color: #2AA198 } /* Literal.String.Double */
.highlight .se { color: #CB4B16 } /* Literal.String.Escape */
.highlight .sh { color: #93A1A1 } /* Literal.String.Heredoc */
.highlight .si { color: #2AA198 } /* Literal.String.Interpol */
.highlight .sx { color: #2AA198 } /* Literal.String.Other */
.highlight .sr { color: #DC322F } /* Literal.String.Regex */
.highlight .s1 { color: #2AA198 } /* Literal.String.Single */
.highlight .ss { color: #2AA198 } /* Literal.String.Symbol */
.highlight .bp { color: #268BD2 } /* Name.Builtin.Pseudo */
.highlight .vc { color: #268BD2 } /* Name.Variable.Class */
.highlight .vg { color: #268BD2 } /* Name.Variable.Global */
.highlight .vi { color: #268BD2 } /* Name.Variable.Instance */
.highlight .il { color: #2AA198 } /* Literal.Number.Integer.Long */

193
style.css
View file

@ -28,257 +28,290 @@ table {
border-spacing: 0; } border-spacing: 0; }
.highlight { .highlight {
background: white; } background-color: #222222;
padding: 5px 10px;
margin: 20px 0; }
.highlight .c { .highlight pre {
color: #999988; word-break: break-all;
font-style: italic; } word-wrap: break-word; }
code {
font-family: 'Courier', monospace;
font-size: 14px; }
.highlight .c, .highlight .c1 {
color: #586e75; }
/* Comment */ /* Comment */
.highlight .err { .highlight .err {
color: #a61717; color: #93a1a1; }
background-color: #e3d2d2; }
/* Error */ /* Error */
.highlight .g {
color: #93a1a1; }
/* Generic */
.highlight .k { .highlight .k {
font-weight: bold; } color: #859900; }
/* Keyword */ /* Keyword */
.highlight .l {
color: #93a1a1; }
/* Literal */
.highlight .n {
color: #93a1a1; }
/* Name */
.highlight .o { .highlight .o {
font-weight: bold; } color: #859900; }
/* Operator */ /* Operator */
.highlight .x {
color: #cb4b16; }
/* Other */
.highlight .p {
color: #93a1a1; }
/* Punctuation */
.highlight .cm { .highlight .cm {
color: #999988; color: #586e75; }
font-style: italic; }
/* Comment.Multiline */ /* Comment.Multiline */
.highlight .cp { .highlight .cp {
color: #999999; color: #859900; }
font-weight: bold; }
/* Comment.Preproc */ /* Comment.Preproc */
.highlight .c1 { .highlight .c1 {
color: #999988; color: #586e75; }
font-style: italic; }
/* Comment.Single */ /* Comment.Single */
.highlight .cs { .highlight .cs {
color: #999999; color: #859900; }
font-weight: bold;
font-style: italic; }
/* Comment.Special */ /* Comment.Special */
.highlight .gd { .highlight .gd {
color: black; color: #2aa198; }
background-color: #ffdddd; }
/* Generic.Deleted */ /* Generic.Deleted */
.highlight .gd .x {
color: black;
background-color: #ffaaaa; }
/* Generic.Deleted.Specific */
.highlight .ge { .highlight .ge {
color: #93a1a1;
font-style: italic; } font-style: italic; }
/* Generic.Emph */ /* Generic.Emph */
.highlight .gr { .highlight .gr {
color: #aa0000; } color: #dc322f; }
/* Generic.Error */ /* Generic.Error */
.highlight .gh { .highlight .gh {
color: #999999; } color: #cb4b16; }
/* Generic.Heading */ /* Generic.Heading */
.highlight .gi { .highlight .gi {
color: black; color: #859900; }
background-color: #ddffdd; }
/* Generic.Inserted */ /* Generic.Inserted */
.highlight .gi .x {
color: black;
background-color: #aaffaa; }
/* Generic.Inserted.Specific */
.highlight .go { .highlight .go {
color: #888888; } color: #93a1a1; }
/* Generic.Output */ /* Generic.Output */
.highlight .gp { .highlight .gp {
color: #555555; } color: #93a1a1; }
/* Generic.Prompt */ /* Generic.Prompt */
.highlight .gs { .highlight .gs {
color: #93a1a1;
font-weight: bold; } font-weight: bold; }
/* Generic.Strong */ /* Generic.Strong */
.highlight .gu { .highlight .gu {
color: #aaaaaa; } color: #cb4b16; }
/* Generic.Subheading */ /* Generic.Subheading */
.highlight .gt { .highlight .gt {
color: #aa0000; } color: #93a1a1; }
/* Generic.Traceback */ /* Generic.Traceback */
.highlight .kc { .highlight .kc {
font-weight: bold; } color: #cb4b16; }
/* Keyword.Constant */ /* Keyword.Constant */
.highlight .kd { .highlight .kd {
font-weight: bold; } color: #268bd2; }
/* Keyword.Declaration */ /* Keyword.Declaration */
.highlight .kn {
color: #859900; }
/* Keyword.Namespace */
.highlight .kp { .highlight .kp {
font-weight: bold; } color: #859900; }
/* Keyword.Pseudo */ /* Keyword.Pseudo */
.highlight .kr { .highlight .kr {
font-weight: bold; } color: #268bd2; }
/* Keyword.Reserved */ /* Keyword.Reserved */
.highlight .kt { .highlight .kt {
color: #445588; color: #dc322f; }
font-weight: bold; }
/* Keyword.Type */ /* Keyword.Type */
.highlight .ld {
color: #93a1a1; }
/* Literal.Date */
.highlight .m { .highlight .m {
color: #009999; } color: #2aa198; }
/* Literal.Number */ /* Literal.Number */
.highlight .s { .highlight .s {
color: #dd1144; } color: #2aa198; }
/* Literal.String */ /* Literal.String */
.highlight .na { .highlight .na {
color: teal; } color: #93a1a1; }
/* Name.Attribute */ /* Name.Attribute */
.highlight .nb { .highlight .nb {
color: #0086b3; } color: #b58900; }
/* Name.Builtin */ /* Name.Builtin */
.highlight .nc { .highlight .nc {
color: #445588; color: #268bd2; }
font-weight: bold; }
/* Name.Class */ /* Name.Class */
.highlight .no { .highlight .no {
color: teal; } color: #cb4b16; }
/* Name.Constant */ /* Name.Constant */
.highlight .nd {
color: #268bd2; }
/* Name.Decorator */
.highlight .ni { .highlight .ni {
color: purple; } color: #cb4b16; }
/* Name.Entity */ /* Name.Entity */
.highlight .ne { .highlight .ne {
color: #990000; color: #cb4b16; }
font-weight: bold; }
/* Name.Exception */ /* Name.Exception */
.highlight .nf { .highlight .nf {
color: #990000; color: #268bd2; }
font-weight: bold; }
/* Name.Function */ /* Name.Function */
.highlight .nl {
color: #93a1a1; }
/* Name.Label */
.highlight .nn { .highlight .nn {
color: #555555; } color: #93a1a1; }
/* Name.Namespace */ /* Name.Namespace */
.highlight .nx {
color: #555555; }
/* Name.Other */
.highlight .py {
color: #93a1a1; }
/* Name.Property */
.highlight .nt { .highlight .nt {
color: navy; } color: #268bd2; }
/* Name.Tag */ /* Name.Tag */
.highlight .nv { .highlight .nv {
color: teal; } color: #268bd2; }
/* Name.Variable */ /* Name.Variable */
.highlight .ow { .highlight .ow {
font-weight: bold; } color: #859900; }
/* Operator.Word */ /* Operator.Word */
.highlight .w { .highlight .w {
color: #bbbbbb; } color: #93a1a1; }
/* Text.Whitespace */ /* Text.Whitespace */
.highlight .mf { .highlight .mf {
color: #009999; } color: #2aa198; }
/* Literal.Number.Float */ /* Literal.Number.Float */
.highlight .mh { .highlight .mh {
color: #009999; } color: #2aa198; }
/* Literal.Number.Hex */ /* Literal.Number.Hex */
.highlight .mi { .highlight .mi {
color: #009999; } color: #2aa198; }
/* Literal.Number.Integer */ /* Literal.Number.Integer */
.highlight .mo { .highlight .mo {
color: #009999; } color: #2aa198; }
/* Literal.Number.Oct */ /* Literal.Number.Oct */
.highlight .sb { .highlight .sb {
color: #dd1144; } color: #586e75; }
/* Literal.String.Backtick */ /* Literal.String.Backtick */
.highlight .sc { .highlight .sc {
color: #dd1144; } color: #2aa198; }
/* Literal.String.Char */ /* Literal.String.Char */
.highlight .sd { .highlight .sd {
color: #dd1144; } color: #93a1a1; }
/* Literal.String.Doc */ /* Literal.String.Doc */
.highlight .s2 { .highlight .s2 {
color: #dd1144; } color: #2aa198; }
/* Literal.String.Double */ /* Literal.String.Double */
.highlight .se { .highlight .se {
color: #dd1144; } color: #cb4b16; }
/* Literal.String.Escape */ /* Literal.String.Escape */
.highlight .sh { .highlight .sh {
color: #dd1144; } color: #93a1a1; }
/* Literal.String.Heredoc */ /* Literal.String.Heredoc */
.highlight .si { .highlight .si {
color: #dd1144; } color: #2aa198; }
/* Literal.String.Interpol */ /* Literal.String.Interpol */
.highlight .sx { .highlight .sx {
color: #dd1144; } color: #2aa198; }
/* Literal.String.Other */ /* Literal.String.Other */
.highlight .sr { .highlight .sr {
color: #009926; } color: #dc322f; }
/* Literal.String.Regex */ /* Literal.String.Regex */
.highlight .s1 { .highlight .s1 {
color: #dd1144; } color: #2aa198; }
/* Literal.String.Single */ /* Literal.String.Single */
.highlight .ss { .highlight .ss {
color: #990073; } color: #2aa198; }
/* Literal.String.Symbol */ /* Literal.String.Symbol */
.highlight .bp { .highlight .bp {
color: #999999; } color: #268bd2; }
/* Name.Builtin.Pseudo */ /* Name.Builtin.Pseudo */
.highlight .vc { .highlight .vc {
color: teal; } color: #268bd2; }
/* Name.Variable.Class */ /* Name.Variable.Class */
.highlight .vg { .highlight .vg {
color: teal; } color: #268bd2; }
/* Name.Variable.Global */ /* Name.Variable.Global */
.highlight .vi { .highlight .vi {
color: teal; } color: #268bd2; }
/* Name.Variable.Instance */ /* Name.Variable.Instance */
.highlight .il { .highlight .il {
color: #009999; } color: #2aa198; }
/* Literal.Number.Integer.Long */ /* Literal.Number.Integer.Long */
html { html {