Sha256: 7400dec404f6152980f59b342b11c98a5de95289da28c804dc37d483e9360772

Contents?: true

Size: 1.94 KB

Versions: 21

Compression:

Stored size: 1.94 KB

Contents

class Typo
  class Textfilter
    class Markdown < TextFilterPlugin::Markup
      plugin_display_name "Markdown"
      plugin_description 'Markdown markup language from <a href="http://daringfireball.com/">Daring Fireball</a>'

      def self.help_text
        %{
[Markdown](http://daringfireball.net/projects/markdown/) is a simple text-to-HTML converter that
turns common text idioms into HTML.  The [full syntax](http://daringfireball.net/projects/markdown/syntax)
is available from the author's site, but here's a short summary:

* **Paragraphs**: Start a new paragraph by skipping a line.
* **Italics**: Put text in *italics* by enclosing it in either \* or \_: `*italics*` turns into *italics*.
* **Bold**: Put text in **bold** by enclosing it in two \*s: `**bold**` turns into **bold**.
* **Pre-formatted text**: Enclosing a short block of text in backquotes (&#96;) displays it in a monospaced font
  and converts HTML metacharacters so they display correctly.  Example: &#96;`<img src="foo"/>`&#96; displays as `<img src="foo"/>`.
  Also, any paragraph indented 4 or more spaces is treated as pre-formatted text.
* **Block quotes**: Any paragraph (or line) that starts with a `>` is treated as a blockquote.
* **Hyperlinks**: You can create links like this: `[amazon's web site](http://www.amazon.com)`.  That produces
  "[amazon's web site](http://www.amazon.com)".
* **Lists**: You can create numbered or bulleted lists by ending a paragraph with a colon (:), skipping a line, and then using
  asterisks (*, for bullets) or numbers (for numbered lists).  See the
  [Markdown syntax page](http://daringfireball.net/projects/markdown/syntax) for examples.
* **Raw HTML**: Markdown will pass raw HTML through unchanged, so you can use HTML's syntax whenever Markdown doesn't provide
  a reasonable alternative.

        }
      end

      def self.filtertext(blog,content,text,params)
        BlueCloth.new(text.gsub(%r{</?notextile>}, '')).to_html
      end
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
typo-5.5 vendor/plugins/typo_textfilter_markdown/lib/typo_textfilter_markdown.rb
typo-5.4.4 vendor/plugins/typo_textfilter_markdown/lib/typo_textfilter_markdown.rb
typo-5.4.3 vendor/plugins/typo_textfilter_markdown/lib/typo_textfilter_markdown.rb
typo-5.4.2 vendor/plugins/typo_textfilter_markdown/lib/typo_textfilter_markdown.rb
typo-5.4.1 vendor/plugins/typo_textfilter_markdown/lib/typo_textfilter_markdown.rb
typo-5.4 vendor/plugins/typo_textfilter_markdown/lib/typo_textfilter_markdown.rb
typo-4.1.1 vendor/plugins/typo_textfilter_markdown/lib/typo_textfilter_markdown.rb
typo-4.1 vendor/plugins/typo_textfilter_markdown/lib/typo_textfilter_markdown.rb
typo-5.0.1 vendor/plugins/typo_textfilter_markdown/lib/typo_textfilter_markdown.rb
typo-5.0.2 vendor/plugins/typo_textfilter_markdown/lib/typo_textfilter_markdown.rb
typo-5.0.3.98.1 vendor/plugins/typo_textfilter_markdown/lib/typo_textfilter_markdown.rb
typo-5.0.3.98 vendor/plugins/typo_textfilter_markdown/lib/typo_textfilter_markdown.rb
typo-5.0 vendor/plugins/typo_textfilter_markdown/lib/typo_textfilter_markdown.rb
typo-5.1.1 vendor/plugins/typo_textfilter_markdown/lib/typo_textfilter_markdown.rb
typo-5.1.2 vendor/plugins/typo_textfilter_markdown/lib/typo_textfilter_markdown.rb
typo-5.1.3 vendor/plugins/typo_textfilter_markdown/lib/typo_textfilter_markdown.rb
typo-5.1.98 vendor/plugins/typo_textfilter_markdown/lib/typo_textfilter_markdown.rb
typo-5.1 vendor/plugins/typo_textfilter_markdown/lib/typo_textfilter_markdown.rb
typo-5.2.98 vendor/plugins/typo_textfilter_markdown/lib/typo_textfilter_markdown.rb
typo-5.2 vendor/plugins/typo_textfilter_markdown/lib/typo_textfilter_markdown.rb