Sha256: 57a3beca7c4b3842287aa6c6b3a4d3b6fb568d7cf2bea6224309fedbf69bf320

Contents?: true

Size: 560 Bytes

Versions: 18

Compression:

Stored size: 560 Bytes

Contents

require 'rdoc/generators/html_generator'
require 'ostruct'

module GitHub
  module Markup
    class RDoc
      def initialize(content)
        @content = content
      end

      def to_html
        simple_markup = SM::SimpleMarkup.new
        generator = Generators::HyperlinkHtml.new(nil, OpenStruct.new)
        simple_markup.add_special(/((link:|https?:|mailto:|ftp:|www\.)\S+\w)/, :HYPERLINK)
        simple_markup.add_special(/(((\{.*?\})|\b\S+?)\[\S+?\.\S+?\])/, :TIDYLINK)
        simple_markup.convert(@content, generator)
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 2 rubygems

Version Path
github-markup-0.5.0 lib/github/markup/rdoc.rb
github-markup-0.4.0 lib/github/markup/rdoc.rb
github-markup-0.3.3 lib/github/markup/rdoc.rb
github-markup-0.3.2 lib/github/markup/rdoc.rb
github-markup-0.3.1 lib/github/markup/rdoc.rb
github-markup-0.3.0 lib/github/markup/rdoc.rb
github-markup-0.2.2 lib/github/markup/rdoc.rb
github-markup-0.2.1 lib/github/markup/rdoc.rb
github-markup-0.2.0 lib/github/markup/rdoc.rb
github-markup-0.1.7 lib/github/markup/rdoc.rb
github-markup-0.1.6 lib/github/markup/rdoc.rb
github-markup-0.1.5 lib/github/markup/rdoc.rb
github-markup-0.1.4 lib/github/markup/rdoc.rb
github-markup-0.1.3 lib/github/markup/rdoc.rb
github-markup-0.1.2 lib/github/markup/rdoc.rb
github-markup-0.1.1 lib/github/markup/rdoc.rb
github_markup-0.1.1 lib/github/markup/rdoc.rb
github_markup-0.1.0 lib/github/markup/rdoc.rb