From 8bf5b8a25cfb089844d8915c223f084bc2a73208 Mon Sep 17 00:00:00 2001 From: Brandon Mathis Date: Sun, 27 May 2012 02:04:45 -0500 Subject: [PATCH] updated docs with description of new code start, end and range options --- source/docs/blogging/code/test/index.markdown | 44 +++++++++---------- .../plugins/backtick-codeblock/index.markdown | 20 ++++++++- source/docs/plugins/codeblock/index.markdown | 29 +++++++++--- .../docs/plugins/include-code/index.markdown | 31 ++++++++++--- 4 files changed, 91 insertions(+), 33 deletions(-) diff --git a/source/docs/blogging/code/test/index.markdown b/source/docs/blogging/code/test/index.markdown index c685870..4986755 100644 --- a/source/docs/blogging/code/test/index.markdown +++ b/source/docs/blogging/code/test/index.markdown @@ -5,34 +5,34 @@ footer: false sidebar: false --- -{% include_code javascripts/test.js %} +{% include_code test.js range:5,10 %} ``` html - - - A Tiny Page - - - -

abc

-

def

-

Testing page

- + + +A Tiny Page + + + +

abc

+

def

+

Testing page

+ ``` {% gist 996818 %} -{% codeblock Testing PHP (syntax_test.php) %} +{% codeblock Testing PHP (syntax_test.php) lang:php %} ` will be the filename, but you can add a title before the filepath if you like. {{ "{% include_code Add to_fraction for floats ruby/test.rb" }} %} @@ -31,7 +31,27 @@ This includes a file from `source/downloads/code/ruby/test.rb`. {% include_code Add to_fraction for floats ruby/test.rb %} -#### Example 3 (Force Highlighting) +### Include part of a file + +Start on line a specific line. + + {% raw %}{% include_code test.js start:10 %}{% endraw %} + +{% include_code test.js start:10 %} + +End on line a specific line. + + {% raw %}{% include_code test.js end:10 %}{% endraw %} + +{% include_code test.js end:10 %} + +Choose a custom range of lines to include. + + {% raw %}{% include_code test.js range:10,15 %}{% endraw %} + +{% include_code test.js range:10,15 %} + +### Force highlighting Pygments supports many languages, but doesn't recognize some file extensions. Add `lang:your_language` to force highlighting if the filename doesn't work. @@ -39,3 +59,4 @@ Add `lang:your_language` to force highlighting if the filename doesn't work. {{ "{% include_code test.coffee lang:coffeescript" }} %} {% include_code test.coffee lang:coffeescript %} +