Class: RDoc::Generator::Texinfo

Inherits:
Object
  • Object
show all
Includes:
MarkUp
Defined in:
lib/rdoc/generator/texinfo.rb

Overview

This generates Texinfo files for viewing with GNU Info or Emacs from RDoc extracted from Ruby source files.

Constant Summary collapse

DEFAULT_INFO_FILENAME =

What should the .info file be named by default?

'rdoc.info'

Instance Method Summary collapse

Methods included from MarkUp

#cvs_url, #markup, #style_url

Constructor Details

#initialize(options) ⇒ Texinfo

Accept some options



19
20
21
22
23
24
# File 'lib/rdoc/generator/texinfo.rb', line 19

def initialize(options)
  @options = options
  @options.inline_source = true
  @options.op_name ||= 'rdoc.texinfo'
  @options.formatter = ::RDoc::Markup::ToTexInfo.new
end

Instance Method Details

#generate(toplevels) ⇒ Object

Generate the texinfo files



27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/rdoc/generator/texinfo.rb', line 27

def generate(toplevels)
  @toplevels = toplevels
  @files, @classes = ::RDoc::Generator::Context.build_indicies(@toplevels,
                                                               @options)

  (@files + @classes).each { |x| x.value_hash }

  open(@options.op_name, 'w') do |f|
    f.puts TexinfoTemplate.new('files' => @files,
                               'classes' => @classes,
                               'filename' => @options.op_name.gsub(/texinfo/, 'info'),
                               'title' => @options.title).render
  end
  # TODO: create info files and install?
end