Sha256: ab435eaa8e3e3e5f2c6f06d760d2aa1dc4f92866a81c282b33340fab99392452

Contents?: true

Size: 1.53 KB

Versions: 11

Compression:

Stored size: 1.53 KB

Contents

---
title: Webgen::Tag::Coderay
used_options:
  - tag.coderay.lang
  - tag.coderay.process_body
  - tag.coderay.wrap
  - tag.coderay.line_numbers
  - tag.coderay.line_number_start
  - tag.coderay.bold_every
  - tag.coderay.tab_width
---
## Description

This tag applies syntax highlighting to its body by using the [coderay][1] library which can be used
to highlight many different languages (see `tag.coderay.lang` documentation). The body of the tag
specifies what should be highlighted.

> It is easy to include and highlight an entire file by combining this tag with the `include_file` tag:
>
>     \{coderay:: ruby}{include_file: test.rb}{coderay}
{.information}

> This extension is only available if you have installed the [coderay][1] library. The preferred
> way to do this is via Rubygems:
>
>     gem install coderay
{.exclamation}

[1]: http://coderay.rubychan.de/ "The Coderay homepage"

## Examples

<table class="examples">
<tr>
  <th>Usage</th><th>Output</th>
</tr>
<tr>
  <td>\{coderay:: {lang: ruby, bold_every: 2}}{include_file: lib/webgen/version.rb}{coderay}</td>
  <% if File.exists?(File.join(context.website.directory, 'lib/webgen/version.rb')) %>
  <td>{coderay:: {lang: ruby, bold_every: 2}}{include_file: lib/webgen/version.rb}{coderay}</td>
  <% else %>
  <td>{coderay:: {lang: ruby, bold_every: 2}}{include_file: ../lib/webgen/version.rb}{coderay}</td>
  <% end %>
</tr>
<tr>
  <td>\{coderay:: {lang: ruby, wrap: span}}puts 5+5{coderay}</td>
  <td><code>{coderay:: {lang: ruby, wrap: span}}puts 5+5{coderay}</code></td>
</tr>
</table>

Version data entries

11 entries across 11 versions & 2 rubygems

Version Path
gettalong-webgen-0.5.4.20080929 doc/tag/coderay.page
gettalong-webgen-0.5.5.20081001 doc/tag/coderay.page
gettalong-webgen-0.5.5.20081010 doc/tag/coderay.page
gettalong-webgen-0.5.5.20081012 doc/tag/coderay.page
gettalong-webgen-0.5.6.20081020 doc/tag/coderay.page
webgen-0.5.3 doc/tag/coderay.page
webgen-0.5.2 doc/tag/coderay.page
webgen-0.5.1 doc/tag/coderay.page
webgen-0.5.4 doc/tag/coderay.page
webgen-0.5.6 doc/tag/coderay.page
webgen-0.5.5 doc/tag/coderay.page