File: rdoc.rb

package info (click to toggle)
ruby-tilt 2.7.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 632 kB
  • sloc: ruby: 4,975; makefile: 7
file content (33 lines) | stat: -rw-r--r-- 850 bytes parent folder | download
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
27
28
29
30
31
32
33
# frozen_string_literal: true

# = RDoc (<tt>rdoc</tt>)
#
# {RDoc}[http://rdoc.rubyforge.org] is the simple text markup system that comes with Ruby's standard
# library.
#
# === Example
#
#     = Hello RDoc Templates
#
#     Hello World. This is a paragraph.
#
# === Usage
#
# __NOTE:__ It's suggested that your program <tt>require 'rdoc'</tt>,
# <tt>require 'rdoc/markup'</tt>, and <tt>require 'rdoc/markup/to_html'</tt> at load time
# when using this template engine in a threaded environment.
#
# === See also
#
# * {RDoc}[http://rdoc.rubyforge.org]
# * {RDoc Github}[https://github.com/ruby/rdoc]

require_relative 'template'
require 'rdoc'
require 'rdoc/markup'
require 'rdoc/markup/to_html'
require 'rdoc/options'

Tilt::RDocTemplate = Tilt::StaticTemplate.subclass do
  RDoc::Markup::ToHtml.new(RDoc::Options.new, nil).convert(@data).to_s
end