updated to latest octopress, updated documentation for backtick codeblock

This commit is contained in:
Brandon Mathis 2011-09-07 23:31:08 -05:00
parent aa509ef364
commit 5fb5b6fa94
9 changed files with 61 additions and 52 deletions

View File

@ -5,7 +5,7 @@
<nav role=navigation>{% include navigation.html %}</nav> <nav role=navigation>{% include navigation.html %}</nav>
<div id="main"> <div id="main">
<div id="content"> <div id="content">
{{ content | expand_urls: root_url | backtick_codeblock | smart_quotes }} {{ content | expand_urls: root_url }}
</div> </div>
</div> </div>
<footer>{% include footer.html %}</footer> <footer>{% include footer.html %}</footer>

View File

@ -7,7 +7,7 @@ layout: default
{% if page.title %} {% if page.title %}
<header> <header>
<h1 class="entry-title">{{ page.title | titlecase }}</h1> <h1 class="entry-title">{{ page.title | titlecase }}</h1>
{% if page.date %}<p class="meta">{% include post/date.html %}</p>{% endif %} {% if page.date %}<p class="meta">{% include post/date.html %}{{ time }}</p>{% endif %}
</header> </header>
{% endif %} {% endif %}
{{ content }} {{ content }}

View File

@ -29,7 +29,7 @@ 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.
## Github Style Code Blocks ## Github Style Code Blocks
{% render_partial docs/plugins/github-style-codeblock/index.markdown %} {% render_partial docs/plugins/backtick-codeblock/index.markdown %}
## Gist Embedding ## Gist Embedding
{% render_partial docs/plugins/gist-tag/index.markdown %} {% render_partial docs/plugins/gist-tag/index.markdown %}

View File

@ -0,0 +1,49 @@
---
layout: page
title: "Backtick Code Blocks"
date: 2011-07-26 23:42
sidebar: false
footer: false
---
With the `backtick_codeblock` filter you can use Github's lovely back tick syntax highlighting blocks.
Simply start a line with three back ticks followed by a space and the language you're using.
#### Syntax
``` [language] [title] [url] [link text]
code snippet
```
#### Example (plain)
```
$ sudo make me a sandwich
```
```
$ sudo make me a sandwich
```
#### Example With Syntax Highlighting a Caption and Link
``` ruby Discover if a number is prime http://www.noulakaz.net/weblog/2007/03/18/a-regular-expression-to-check-for-prime-numbers/ Source Article
class Fixnum
def prime?
('1' * self) !~ /^1?$|^(11+?)\1+$/
end
end
```
``` ruby Discover if a number is prime http://www.noulakaz.net/weblog/2007/03/18/a-regular-expression-to-check-for-prime-numbers/ Source Article
class Fixnum
def prime?
('1' * self) !~ /^1?$|^(11+?)\1+$/
end
end
```
This is a nice, lightweight way to add a highlighted code snippet. For features like titles and links you'll want to look
at the [codeblock](/docs/plugins/codeblock/) or [include_code](/docs/plugins/include-code/) liquid tags.

View File

@ -11,6 +11,8 @@ With this plugin you can write blocks of code directly in your posts and optiona
#### Syntax #### Syntax
{{ "{% codeblock [title] [lang:language] [url] [link text]" }} %} {{ "{% codeblock [title] [lang:language] [url] [link text]" }} %}
code snippet
{{ "{% endcodeblock" }} %}
#### Example 1 #### Example 1

View File

@ -1,44 +0,0 @@
---
layout: page
title: "Github Style Codeblock"
date: 2011-07-26 23:42
sidebar: false
footer: false
---
With the `backtick_codeblock` filter you can use Github's lovely back tick syntax highlighting blocks.
Simply start a line with three back ticks followed by a space and the language you're using. Tab in four spaces
for your code snippets, and then finish your code block with three more back ticks.
**Note: Back tick code blocks are only supported in HTML and Markdown. With the Textile markup language, use the [codeblocks](/docs/plugins/codeblock/) instead.**
#### Syntax
{% codeblock %}
``` language
code snippet
```
{% endcodeblock %}
#### Example
{% codeblock %}
``` ruby
class Fixnum
def prime?
('1' * self) !~ /^1?$|^(11+?)\1+$/
end
end
```
{% endcodeblock %}
``` ruby
class Fixnum
def prime?
('1' * self) !~ /^1?$|^(11+?)\1+$/
end
end
```
This is a nice, lightweight way to add a highlighted code snippet. For features like titles and links you'll want to look
at the [codeblock](/docs/plugins/codeblock/) or [include_code](/docs/plugins/include-code/) liquid tags.

View File

@ -10,14 +10,14 @@ footer: false
Octopress ships with the following plugins. Many have been written specially for Octopress, but some have been selected from the Jekyll community with various changes and improvements. Octopress ships with the following plugins. Many have been written specially for Octopress, but some have been selected from the Jekyll community with various changes and improvements.
- [HTML5 Video Tag](/docs/plugins/video-tag/) - *easily post images with class names and titles* - [HTML5 Video Tag](/docs/plugins/video-tag/) - *easily post images with class names and titles*
- [Github Style codeblock](/docs/plugins/github-style-codeblock/) - *for simple lightweight code sharing* - [Backtick Code Block](/docs/plugins/backtick-codeblock/) - *for simple lightweight code sharing*
- [Code Block](/docs/plugins/codeblock/) - *for sharing code with titles and links* - [Code Block](/docs/plugins/codeblock/) - *for sharing code with titles and links*
- [Include Code](/docs/plugins/include-code/) - *embed code from your filesystem with a download link* - [Include Code](/docs/plugins/include-code/) - *embed code from your filesystem with a download link*
- [Gist Tag](/docs/plugins/gist-tag/) - *automatically downloads and embeds Github gists* - [Gist Tag](/docs/plugins/gist-tag/) - *automatically downloads and embeds Github gists*
- [Image Tag](/docs/plugins/image-tag/) - *easily post images with class names and titles* - [Image Tag](/docs/plugins/image-tag/) - *easily post images with class names and titles*
- [Render Partial](/docs/plugins/render-partial/) - *insert any file into another post or page* - [Render Partial](/docs/plugins/render-partial/) - *insert any file into another post or page*
- [Blockquote](/docs/plugins/blockquote/) - *generate beautiful, semantic block quotes* - [Block Quote](/docs/plugins/blockquote/) - *generate beautiful, semantic block quotes*
- [Pullquote](/docs/plugins/pullquote/) - *generate CSS only pull quotes &mdash; no duplicate data, no javascript* - [Pull Quote](/docs/plugins/pullquote/) - *generate CSS only pull quotes &mdash; no duplicate data, no javascript*
- [Category Generator](/docs/plugins/category-generator/) - *generates archive pages for each blog category* - [Category Generator](/docs/plugins/category-generator/) - *generates archive pages for each blog category*
- [Include Array](/docs/plugins/include-array/) - *includes an array of partials specified in the _config.yml* - [Include Array](/docs/plugins/include-array/) - *includes an array of partials specified in the _config.yml*

View File

@ -6,7 +6,7 @@ footer: false
sidebar: false sidebar: false
--- ---
``` coffeescript ``` coffeescript Some Coffee Script for you http://google.com/
Tweets = 1 Tweets = 1
module.exports = Tweets module.exports = Tweets

View File

@ -7,11 +7,13 @@ sharing: true
footer: true footer: true
--- ---
<notextile>
``` coffeescript ``` coffeescript
_Tweets_ = 1 _Tweets_ = 1
module.exports = Tweets module.exports = Tweets
``` ```
</notextile>
``` coffeescript ``` coffeescript
Tweets = 1 Tweets = 1