Skip to content

Commit af6fd02

Browse files
committed
Make Jekyll Rouge syntax highlighting work.
Added assets/css/syntax.css that controls syntax highlighting colors. This file is simply the monokai Pygments theme with the background color replaced with the existing background color for <pre>. The colors are a decent starting point, but they certainly aren't perfect. Added some content to assets/css/screen.edited.css to style the syntax highlighted code correctly. There were several display issues to fix, especially when "lineno" is enabled. Added code to _layouts/default.html to include the syntax.css file. Adjusted the style test to include some syntax highlighting with line numbers.
1 parent 7ae2549 commit af6fd02

8 files changed

+102
-3
lines changed

_layouts/default.html

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
<!-- Styles'n'Scripts -->
1515
<link rel="stylesheet" type="text/css" href="{{ site.baseurl }}assets/built/screen.css" />
1616
<link rel="stylesheet" type="text/css" href="{{ site.baseurl }}assets/built/screen.edited.css" />
17+
<link rel="stylesheet" type="text/css" href="{{ site.baseurl }}assets/built/syntax.css" />
1718
<!-- highlight.js -->
1819
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/default.min.css">
1920
<style>.hljs { background: none; }</style>

_posts/2012-09-01-a-full-and-comprehensive-style-test.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ <h3 id="code">Code</h3>
149149
{% endhighlight %}
150150

151151

152-
{% highlight javascript %}
152+
{% highlight javascript linenos %}
153153
// javascript code sample
154154
$.ajax({
155155
type: 'POST',

assets/built/screen.edited.css

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/built/screen.edited.css.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/built/syntax.css

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)