Chords

PdfExportVisitor
in package
implements VisitorInterface

Creates HTML code for conversion to PDF.

Interfaces, Classes, Traits and Enums

VisitorInterface
Visitor pattern for song objects.

Table of Contents

AUTHOR_CLASSNAME  = 'author'
HTML class of song author element.
CELL_CLASSNAME  = 'cell'
HTML class of a text chunk.
CHORD_CLASSNAME  = 'chord'
HTML class of a chord element.
HEADER_CLASSNAME  = 'header'
HTML class of header element.
METADATA_CLASSNAME  = 'meta'
HTML class of metadata block.
PARAGRAPH_CLASSNAME  = 'paragraph'
HTML class of a paragraph.
REPEAT_CLASSNAME  = 'repeat-marker'
HTML class of a repeat marker.
REPEAT_COUNT_DEFAULT  = 2
Default repeat count.
REPEAT_COUNT_FORMAT  = '%d×'
Repeat count formatting string.
REPEAT_END  = ' :]'
Repeat marker end.
REPEAT_START  = '[: '
Repeat marker start.
STROPHE_LABEL_CLASSNAME  = 'strophe-label'
HTML class of strophe label.
STROPHE_LABEL_FORMAT  = '%s '
Strophe label formatting string.
STROPHE_LABEL_REPEAT_FORMAT  = '%s (%d×) '
Strophe label with repeat indicator formatting string.
STROPHE_REFERENCE_CLASSNAME  = 'strophe-reference'
HTML class of strophe reference.
STROPHE_REFERENCE_FORMAT  = '%s'
Strophe reference formatting string.
STROPHE_REFERENCE_REPEAT_FORMAT  = '%s %d×'
Strophe reference with repeat indicator formatting string.
TEXT_CLASSNAME  = 'text'
HTML class of plain text.
VERSE_CLASSNAME  = 'verse'
HTML class of a verse.
$hasChords  : bool
Does the current line have any chords?
$html  : array<string|int, string>
Lines of HTML code.
$label  : string|null
Label of the currently processed strophe.
$options  : PdfExportOptions
Export settings.
$repeat  : int|null
Repeat count of the currently processed node.
$row  : array<string|int, array<string|int, mixed>>|null
Chunks in the current line.
__construct()  : mixed
saveHtml()  : string
Returns the built HTML.
visitChord()  : void
Process a chord.
visitParagraph()  : void
Process a paragraph.
visitRepeat()  : void
Process a repeat.
visitSong()  : void
Process entire song.
visitSongInfo()  : void
Process song metadata.
visitSongLyrics()  : void
Process song lyrics.
visitStrophe()  : void
Process a strophe.
visitStropheReference()  : void
Process a strophe reference.
visitText()  : void
Process plain text.
visitVerse()  : void
Process a verse.

Constants

AUTHOR_CLASSNAME

HTML class of song author element.

private string AUTHOR_CLASSNAME = 'author'

CELL_CLASSNAME

HTML class of a text chunk.

private string CELL_CLASSNAME = 'cell'

CHORD_CLASSNAME

HTML class of a chord element.

private string CHORD_CLASSNAME = 'chord'

HEADER_CLASSNAME

HTML class of header element.

private string HEADER_CLASSNAME = 'header'

METADATA_CLASSNAME

HTML class of metadata block.

private string METADATA_CLASSNAME = 'meta'

PARAGRAPH_CLASSNAME

HTML class of a paragraph.

private string PARAGRAPH_CLASSNAME = 'paragraph'

REPEAT_CLASSNAME

HTML class of a repeat marker.

private string REPEAT_CLASSNAME = 'repeat-marker'

REPEAT_COUNT_DEFAULT

Default repeat count.

private int REPEAT_COUNT_DEFAULT = 2

REPEAT_COUNT_FORMAT

Repeat count formatting string.

private string REPEAT_COUNT_FORMAT = '%d×'

STROPHE_LABEL_CLASSNAME

HTML class of strophe label.

private string STROPHE_LABEL_CLASSNAME = 'strophe-label'

STROPHE_LABEL_FORMAT

Strophe label formatting string.

private string STROPHE_LABEL_FORMAT = '%s '

STROPHE_LABEL_REPEAT_FORMAT

Strophe label with repeat indicator formatting string.

private string STROPHE_LABEL_REPEAT_FORMAT = '%s (%d×) '

STROPHE_REFERENCE_CLASSNAME

HTML class of strophe reference.

private string STROPHE_REFERENCE_CLASSNAME = 'strophe-reference'

STROPHE_REFERENCE_FORMAT

Strophe reference formatting string.

private string STROPHE_REFERENCE_FORMAT = '%s'

STROPHE_REFERENCE_REPEAT_FORMAT

Strophe reference with repeat indicator formatting string.

private string STROPHE_REFERENCE_REPEAT_FORMAT = '%s %d×'

TEXT_CLASSNAME

HTML class of plain text.

private string TEXT_CLASSNAME = 'text'

VERSE_CLASSNAME

HTML class of a verse.

private string VERSE_CLASSNAME = 'verse'

Properties

$hasChords

Does the current line have any chords?

private bool $hasChords = false

$label

Label of the currently processed strophe.

private string|null $label = null

$repeat

Repeat count of the currently processed node.

private int|null $repeat = null

$row

Chunks in the current line.

private array<string|int, array<string|int, mixed>>|null $row = null

Contains arrays with chord and text keys.

Methods

saveHtml()

Returns the built HTML.

public saveHtml() : string
Return values
string

HTML

visitChord()

Process a chord.

public visitChord(Chord $chord) : void
Parameters
$chord : Chord

chord

Tags
inheritdoc
Return values
void

visitParagraph()

Process a paragraph.

public visitParagraph(Paragraph $paragraph) : void
Parameters
$paragraph : Paragraph

paragraph

Tags
inheritdoc
Return values
void

visitRepeat()

Process a repeat.

public visitRepeat(Repeat $repeat) : void
Parameters
$repeat : Repeat

repeat

Tags
inheritdoc
Return values
void

visitSong()

Process entire song.

public visitSong(Song $song) : void
Parameters
$song : Song

song

Tags
inheritdoc
Return values
void

visitSongInfo()

Process song metadata.

public visitSongInfo(SongInfo $info) : void
Parameters
$info : SongInfo

metadata

Tags
inheritdoc
Return values
void

visitStrophe()

Process a strophe.

public visitStrophe(Strophe $strophe) : void
Parameters
$strophe : Strophe

strophe

Tags
inheritdoc
Return values
void

visitText()

Process plain text.

public visitText(Text $text) : void
Parameters
$text : Text

text

Tags
inheritdoc
Return values
void

visitVerse()

Process a verse.

public visitVerse(Verse $verse) : void
Parameters
$verse : Verse

verse

Tags
inheritdoc
Return values
void

Search results