Class: ClWikiConvertor

Inherits:
BaseConvertor
  • Object
show all
Defined in:
lib/cl_wiki/tools/rublog/clWiki.rb

Instance Method Summary collapse

Instance Method Details

#convert_html(file_entry, f, all_entries) ⇒ Object



46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# File 'lib/cl_wiki/tools/rublog/clWiki.rb', line 46

def convert_html(file_entry, f, all_entries)
  ClWikiConfiguration.load_xml(File.join(CLWIKI_PATH, $defaultConfFile))
  $wiki_conf.cgifn = CLWIKI_URL
  page_name = file_entry.file_name.sub($wiki_path, '')
  page_name.sub!($wikiPageExt, '')
  page = ClWikiPage.new(page_name)
  page.read_content(false)
  title = page_name.split('/')[-1]
  title.gsub!(/([^A-Z])([A-Z])/, '\1 \2')
  title.gsub!(/([^0-9])([0-9])/, '\1 \2')
  title.gsub!(/_/, ' ')
  title = "<a href='#{$wiki_conf.cgifn}?page=#{page_name}'>#{title}</a>"
  body  = page.content
  HTMLEntry.new(title, body, self)
end