fixed indentation on code blocks, updated include_code example

This commit is contained in:
Brandon Mathis 2012-06-03 00:23:34 -05:00
parent e4cd278e0c
commit 020ec2f773
4 changed files with 47 additions and 48 deletions

View File

@ -17,14 +17,6 @@ Octopress makes it way better. Here's how.
- Insert code snippets from your filesystem with a download link. - Insert code snippets from your filesystem with a download link.
- Easy inline code blocks with `<figure>` and `<figcaption>` and optional download links. - Easy inline code blocks with `<figure>` and `<figcaption>` and optional download links.
- Pygments caching - a [Jekyll community plugin](https://github.com/rsim/blog.rayapps.com/blob/master/_plugins/pygments_cache_patch.rb). - Pygments caching - a [Jekyll community plugin](https://github.com/rsim/blog.rayapps.com/blob/master/_plugins/pygments_cache_patch.rb).
- Table based line numbers added with javascript.
## Solarized Highlighting
[Solarized](http://ethanschoonover.com/solarized) has a beautiful syntax highlighting color scheme, but reproducing it requires a highly sophisticated highlighting engine.
[Pygments](http://pygments.org) (the highlighter Jekyll uses) processes code snippets into styleable HTML, but it isn't nearly as powerful as the highlighting engine in Vim for example.
In order to port Solarized theme to octopress, I processed its [test files](https://github.com/altercation/solarized/tree/master/utils/tests) with Pygments and styled the output with Sass while comparing
them to the Vim rendered versions.
Check out the [test page](/docs/blogging/code/test) to see the results. Check out the [test page](/docs/blogging/code/test) to see the results.
@ -40,6 +32,13 @@ Check out the [test page](/docs/blogging/code/test) to see the results.
## Inline Code Blocks ## Inline Code Blocks
{% render_partial docs/plugins/codeblock/index.markdown %} {% render_partial docs/plugins/codeblock/index.markdown %}
## Solarized Highlighting
[Solarized](http://ethanschoonover.com/solarized) has a beautiful syntax highlighting color scheme, but reproducing it requires a highly sophisticated highlighting engine.
[Pygments](http://pygments.org) (the highlighter Jekyll uses) processes code snippets into styleable HTML, but it isn't nearly as powerful as the highlighting engine in Vim for example.
In order to port Solarized theme to octopress, I processed its [test files](https://github.com/altercation/solarized/tree/master/utils/tests) with Pygments and styled the output with Sass while comparing
them to the Vim rendered versions.
### Spaces vs. Tabs ### Spaces vs. Tabs
If you use tabs, there is an issue where the first level indentation is shorter than the rest. The cause is currently unknown since lots of text processors are involved. To fix, use spaces. You'll be happier anyway. If you use tabs, there is an issue where the first level indentation is shorter than the rest. The cause is currently unknown since lots of text processors are involved. To fix, use spaces. You'll be happier anyway.

View File

@ -5,7 +5,7 @@ footer: false
sidebar: false sidebar: false
--- ---
{% include_code test.js range:5,10 %} {% include_code test.js range:5-10 %}
``` html ``` html
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

View File

@ -62,7 +62,7 @@ Easily embed gists in your posts or pages.
## Include Code ## Include Code
Import files on your filesystem into any blog post as embedded code snippets with syntax highlighting and a download link. Import files on your filesystem into any blog post as embedded code snippets with syntax highlighting and a download link.
{% include_code Testing include_code test.js %} {% include_code test.js Testing include_code %}
[Examples & documentation &raquo;](/docs/plugins/include-code/) [Examples & documentation &raquo;](/docs/plugins/include-code/)