Class: TracWiki::Exporter

Inherits:
Object
  • Object
show all
Defined in:
lib/trac-export-wiki.rb

Constant Summary collapse

ELEMENTS_TO_REMOVE =

common HTML elements to remove (expressed with css selectors)

["html > head > link",
"html > head > style",
"html > head > script",
"html > body > script",
"div#banner",
"div#header",
"div#search",
"div#ctxtnav",
"div#metanav",
"div#mainnav",
"div.buttons",
"div#altlinks",
"div#footer",
"h3#tkt-changes-hdr",
"ul.tkt-chg-list"]

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config = DefaultConfiguration) ⇒ Exporter

Returns a new instance of Exporter.



97
98
99
# File 'lib/trac-export-wiki.rb', line 97

def initialize(config = DefaultConfiguration)
  self.config = config
end

Instance Attribute Details

#configObject

Returns the value of attribute config.



95
96
97
# File 'lib/trac-export-wiki.rb', line 95

def config
  @config
end

Instance Method Details

#exportObject



101
102
103
104
# File 'lib/trac-export-wiki.rb', line 101

def export
  write_pages unless config.only_index
  generate_index unless config.no_index
end