Class: PlmatToHTML_Converter
- Inherits:
-
Object
- Object
- PlmatToHTML_Converter
- Defined in:
- lib/placemat/PlmatToHTML_Converter.rb
Overview
The Class used for parsing and converstion of .plmat to .html
Instance Method Summary collapse
-
#compile(plmat) ⇒ Object
Gets contents of a .plmat file, calls methods to parse and reformat into valid html5, and saves out the new content into a .html file.
Instance Method Details
#compile(plmat) ⇒ Object
Gets contents of a .plmat file, calls methods to parse and reformat into valid html5, and saves out the new content into a .html file
Example:
>> PlmatToHTML_Converter.complile(filename.plmat)
=> filename.html
Arguments:
* plmat: (File)
Returns:
* (.html File)
19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/placemat/PlmatToHTML_Converter.rb', line 19 def compile(plmat) generator = FileHandler.new plmat_string = generator.content(plmat) plmat_string = strip_full_line_comments(plmat_string) plmat_string = split_apart_tables(plmat_string) plmat_string = split_rows(plmat_string) plmat_string = format_rows(plmat_string) base_file_name = plmat.slice(0..(plmat.index('.')-1)) generator.output(plmat_string, base_file_name+".html") end |