Sha256: b3f3103950007555c03932a45d12b04c0613c8cf7253b5d70b0fdccdc9928a4a

Contents?: true

Size: 582 Bytes

Versions: 3

Compression:

Stored size: 582 Bytes

Contents

# -*- coding: utf-8 -*-
description  'Source code highlighting aspect'
dependencies 'utils/pygments'

Aspect.create(:highlight, priority: 2, layout: true, cacheable: true) do
  def accepts?(page); !page.content.empty? && Pygments.file_format(page.name); end
  def call(context, page); Pygments.pygmentize(page.content, Pygments.file_format(page.name)); end
end

__END__
@@ locale.yml
cs:
  aspect_highlight: 'Zvýrazněný zdroj'
de:
  aspect_highlight: 'Quellcode mit Syntaxhighlighting'
en:
  aspect_highlight: 'Highlighted Source'
fr:
  aspect_highlight: "Source mise en valeur"

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
olelo-0.9.12 plugins/aspects/highlight.rb
olelo-0.9.11 plugins/aspects/highlight.rb
olelo-0.9.10 plugins/aspects/highlight.rb