API Docs for: 1.4.4
Show:

ukeGeeks.chordParser Class

Reads an HTML (text) block looking for chords in format: [Emaj7] Returns the HTML block with wrapped chords: <code><strong><em>

Methods

_encloseChords

(
  • text
  • chords
)
String private

Returns the input string having replaced all of the "bracketed chord names" (i.e. [D7]) with HTML marked-up version (i.e. <code><strong>[<em>D7</em>]</strong></code>)

Parameters:

  • text String
  • chords StringArray

Returns:

String:

_findChords

(
  • text
)
StringArray private

Returns an array of all of the unique bracket chord names. So even if [D7] appears a dozen times you'll only see it once in this list.

Parameters:

  • text String

    CPM Text Block to be parsed

Returns:

StringArray:

_packChords

(
  • text
)
String private

Looks for consecutive chords and strips the whitespace between them -- thus "packing" the chords against each other with only a single space separating them.

Parameters:

  • text String

Returns:

String:

getChords

() Array-chords

Getter method for _chords

Returns:

Array-chords:

init

() Void

Again this is a constructor replacement. Just here for consistency. Does nothing.

Returns:

Void:

parse

(
  • text
)
String

This does all of the work -- it's a Wrapper method that calls all of this classes other (private) methods in correct order.

Parameters:

  • text String

    CPM Text Block to be parsed

Returns:

String:

Properties

_public

Object

attach public members to this object