Merge pull request #77 from epwalsh/master

Add styling for code blocks with line numbers
This commit is contained in:
Dean Attali 2016-07-29 20:32:21 -07:00 committed by GitHub
commit 6d0a6ff97d
3 changed files with 35 additions and 8 deletions

View File

@ -39,3 +39,12 @@ var foo = function(x) {
}
foo(3)
```
And here is some more with line numbers
{% highlight python linenos %}
def bar(x):
return x * 2
print bar(2)
{% endhighlight %}

View File

@ -590,14 +590,32 @@ table tr td :last-child {
pre {
font-size: 16px;
line-height: 1.5em;
background: #FAFAFA;
background-image: linear-gradient(#FAFAFA 50%, #FDFDFD 50%);
background-position: 0px 10px;
background-repeat: repeat;
background-size: 3em 3em;
border-left: 7px solid #444;
}
pre code {
white-space: pre;
}
pre.highlight, .highlight > pre, td.code pre {
background: #FAFAFA;
background-image: linear-gradient(#F9F9F9 50%, #FDFDFD 50%);
background-repeat: repeat;
background-size: 3em 3em;
background-position: 0px 10px;
border-left: 7px solid #444;
}
code table, code table td, code table th, code table tbody, code table tr,
td.gutter pre {
padding: 0;
border: none;
}
.highlight > pre {
padding: 0;
}
td.code pre {
border-width: 0 0 0 2px;
border-style: solid;
border-color: #444;
border-radius: 0;
}
td.gutter {
padding-top: 3px;
}

View File

@ -1,5 +1,5 @@
/* .highlight { background: #ffffff; } Dean commented out */
.highlight pre { background-color: #fff; font-size: 16px }
/* .highlight pre { background-color: #fff; font-size: 16px } */
.highlight .c { color: #999988; font-style: italic } /* Comment */
.highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */
.highlight .k { font-weight: bold } /* Keyword */