Sha256: efb81f35372c124ceac768fa9d1bc870a55ad0d4ceba3819332ead7b747a9ff4

Contents?: true

Size: 1.74 KB

Versions: 6

Compression:

Stored size: 1.74 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
  - tag.coderay.css
---
## 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.

By using the configuration option `tag.coderay.css` you can specify whether you want to have inline
styles, the default external stylesheet file or your own stylesheet file.

> 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
{:.warning}

[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, css: class}}puts 5+5{coderay}</td>
  <td><code>{coderay:: {lang: ruby, wrap: span, css: class}}puts 5+5{coderay}</code></td>
</tr>
</table>

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
webgen-0.5.17 doc/tag/coderay.page
webgen-0.5.15 doc/tag/coderay.page
webgen-0.5.14 doc/tag/coderay.page
webgen-0.5.13 doc/tag/coderay.page
webgen-0.5.12 doc/tag/coderay.page
webgen-0.5.11 doc/tag/coderay.page