Class: Pslm::LatexOutputter::PartsFormatter

Inherits:
Formatter
  • Object
show all
Defined in:
lib/pslm/latexoutputter.rb

Overview

formatting of verse parts - adds part dividing marks (flex, asterisk), eventually inserts newlines

Constant Summary collapse

MARKS =
{
  :simple => { :flex => '~\dag\mbox{}', :first => '~*', :second => '' },
  :semantic => { :flex => '\flex', :first => '\asterisk', :second => '' },
  :no => { :flex => '', :first => '', :second => '' }
}

Instance Method Summary collapse

Methods inherited from Formatter

format, #initialize, #psalm_format, #strophe_format, #syllable_format, #verse_format, #word_format

Constructor Details

This class inherits a constructor from Pslm::LatexOutputter::Formatter

Instance Method Details

#part_format(text, part, verse, strophe, psalm) ⇒ Object



278
279
280
281
282
# File 'lib/pslm/latexoutputter.rb', line 278

def part_format(text, part, verse, strophe, psalm)
  text +
    MARKS[@options[:marks_type]][part.pos] +
    ((@options[:novydvur_newlines] && part.pos != :second) ? "\\\\" : '') # insert two backslashes
end