File: rdoc.rb

package info (click to toggle)
ruby-github-markup 1.5.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 336 kB
  • ctags: 118
  • sloc: ruby: 373; python: 113; sh: 21; makefile: 15
file content (26 lines) | stat: -rw-r--r-- 487 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
require "github/markup/implementation"
require "rdoc"
require "rdoc/markup/to_html"

module GitHub
  module Markup
    class RDoc < Implementation
      def initialize
        super /rdoc/
      end

      def render(content)
        if ::RDoc::VERSION.to_i >= 4
          h = ::RDoc::Markup::ToHtml.new(::RDoc::Options.new)
        else
          h = ::RDoc::Markup::ToHtml.new
        end
        h.convert(content)
      end

      def name
        "rdoc"
      end
    end
  end
end