Sha256: f417c3f20c9cc98a0bc1379b3ab6d980f1e2d9179bbe6c66db087b0b59f671a1

Contents?: true

Size: 338 Bytes

Versions: 5

Compression:

Stored size: 338 Bytes

Contents

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

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
olelo-0.9.8 plugins/aspects/highlight.rb
olelo-0.9.7 plugins/aspects/highlight.rb
olelo-0.9.6 plugins/aspects/highlight.rb
olelo-0.9.5 plugins/aspects/highlight.rb
olelo-0.9.4 plugins/aspects/highlight.rb