Sha256: a7353bb26ec27b5bc06914a4af449e607aeca4f942348611a2b07596a15d4460

Contents?: true

Size: 754 Bytes

Versions: 2

Compression:

Stored size: 754 Bytes

Contents

Zen::Plugin.add do |plugin|
  plugin.name       = 'Markup'
  plugin.author     = 'Yorick Peterse'
  plugin.about      = 'Plugin used for converting various markup formats to HTML.'
  plugin.identifier = 'com.zen.plugin.markup'
  plugin.actions    = {

    # Converts HTML to, well, HTML.
    :html => lambda do |markup|
      markup
    end,

    # Converts the given markup to plain text by escaping all HTML
    :plain => lambda do |markup|
      include Ramaze::Helper::CGI
      h(markup)
    end,

    # Comvert Markdown documents to HTML
    :markdown => lambda do |markup|
      RDiscount.new(markup).to_html
    end,

    # Convert Textile documents to HTML
    :textile => lambda do |markup|
      RedCloth.new(markup).to_html
    end

  } 
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
zen-0.2.4.1 lib/zen/plugin/markup.rb
zen-0.2.4 lib/zen/plugin/markup.rb