Class: Propolize::Propolizer

Inherits:
Object
  • Object
show all
Defined in:
lib/propolize.rb

Overview

Top-level class to provide the “propolize” method to be called by client code

Instance Method Summary collapse

Instance Method Details

#propolize(templateFileName, srcText, fileName, properties = {}) ⇒ Object

Main method to generated the HTML document from the provided source text



949
950
951
952
953
954
955
956
957
958
959
960
961
# File 'lib/propolize.rb', line 949

def propolize(templateFileName, srcText, fileName, properties = {})
  document = PropositionalDocument.new(properties)
  for chunk in DocumentChunks.new(srcText) do 
    #puts "#{chunk}"
    component = chunk.getDocumentComponent
    #puts " => #{component}"
    component.writeToDocument(document)
  end
  document.checkIsValid()
  #document.dump
  
  return document.generateHtml(templateFileName, File.basename(fileName))
end