chordsheetjs 6.0.2 → 6.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +449 -557
- package/lib/bundle.js +15357 -0
- package/lib/index.js +6254 -216
- package/lib/index.js.map +1 -0
- package/lib/main.d.ts +1062 -0
- package/lib/main.d.ts.map +1 -0
- package/package.json +44 -22
- package/.husky/pre-commit +0 -5
- package/lib/chord.js +0 -496
- package/lib/chord_sheet/chord_lyrics_pair.js +0 -75
- package/lib/chord_sheet/chord_pro/composite.js +0 -54
- package/lib/chord_sheet/chord_pro/evaluation_error.js +0 -58
- package/lib/chord_sheet/chord_pro/literal.js +0 -42
- package/lib/chord_sheet/chord_pro/ternary.js +0 -126
- package/lib/chord_sheet/comment.js +0 -55
- package/lib/chord_sheet/line.js +0 -185
- package/lib/chord_sheet/metadata.js +0 -202
- package/lib/chord_sheet/paragraph.js +0 -88
- package/lib/chord_sheet/song.js +0 -353
- package/lib/chord_sheet/tag.js +0 -345
- package/lib/chord_sheet_serializer.js +0 -278
- package/lib/constants.js +0 -54
- package/lib/formatter/chord_pro_formatter.js +0 -184
- package/lib/formatter/html_div_formatter.js +0 -130
- package/lib/formatter/html_formatter.js +0 -44
- package/lib/formatter/html_table_formatter.js +0 -154
- package/lib/formatter/templates/html_div_formatter.js +0 -544
- package/lib/formatter/templates/html_table_formatter.js +0 -731
- package/lib/formatter/text_formatter.js +0 -184
- package/lib/helpers.js +0 -32
- package/lib/key.js +0 -386
- package/lib/normalize_mappings/enharmonic-normalize.js +0 -124
- package/lib/normalize_mappings/generate-suffix-normalize-mapping.js +0 -36
- package/lib/normalize_mappings/suffix-normalize-mapping.js +0 -914
- package/lib/note.js +0 -264
- package/lib/parser/chord_pro_parser.js +0 -64
- package/lib/parser/chord_pro_peg_parser.js +0 -2069
- package/lib/parser/chord_sheet_parser.js +0 -175
- package/lib/parser/parser_warning.js +0 -62
- package/lib/parser/ultimate_guitar_parser.js +0 -154
- package/lib/template_helpers.js +0 -98
- package/lib/utilities.js +0 -110
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#
|
|
1
|
+
# ChordChartJS [](https://codeclimate.com/github/PraiseCharts/ChordChartJS)
|
|
2
2
|
|
|
3
3
|
A JavaScript library for parsing and formatting chord sheets
|
|
4
4
|
|
|
@@ -29,6 +29,19 @@ or `require()`:
|
|
|
29
29
|
var ChordSheetJS = require('chordsheetjs').default;
|
|
30
30
|
```
|
|
31
31
|
|
|
32
|
+
### Standalone bundle file
|
|
33
|
+
|
|
34
|
+
If you're not using a build tool, you can download and use the `bundle.js` from the
|
|
35
|
+
[latest release](https://github.com/martijnversluis/ChordSheetJS/releases/latest):
|
|
36
|
+
|
|
37
|
+
```html
|
|
38
|
+
<script src="bundle.js"></script>
|
|
39
|
+
<script>
|
|
40
|
+
// ChordSheetJS is available in global namespace now
|
|
41
|
+
const parser = new ChordSheetJS.ChordProParser();
|
|
42
|
+
</script>
|
|
43
|
+
```
|
|
44
|
+
|
|
32
45
|
## How to ...?
|
|
33
46
|
|
|
34
47
|
### Parse chord sheet
|
|
@@ -343,171 +356,132 @@ subject to breaking changes between major versions.
|
|
|
343
356
|
|
|
344
357
|
<dl>
|
|
345
358
|
<dt><a href="#ChordLyricsPair">ChordLyricsPair</a></dt>
|
|
346
|
-
<dd><p>Represents a chord with the corresponding (partial) lyrics</p>
|
|
347
|
-
</dd>
|
|
359
|
+
<dd><p>Represents a chord with the corresponding (partial) lyrics</p></dd>
|
|
348
360
|
<dt><a href="#Comment">Comment</a></dt>
|
|
349
|
-
<dd><p>Represents a comment. See
|
|
350
|
-
</dd>
|
|
351
|
-
<dt><a href="#Line">Line</a></dt>
|
|
352
|
-
<dd><p>Represents a line in a chord sheet, consisting of items of type ChordLyricsPair or Tag</p>
|
|
353
|
-
</dd>
|
|
361
|
+
<dd><p>Represents a comment. See https://www.chordpro.org/chordpro/chordpro-file-format-specification/#overview</p></dd>
|
|
354
362
|
<dt><a href="#Metadata">Metadata</a></dt>
|
|
355
363
|
<dd><p>Stores song metadata. Properties can be accessed using the get() method:</p>
|
|
356
|
-
<p>const metadata = new Metadata({ author:
|
|
357
|
-
metadata.get(
|
|
358
|
-
<p>See
|
|
359
|
-
</dd>
|
|
364
|
+
<p>const metadata = new Metadata({ author: 'John' });
|
|
365
|
+
metadata.get('author') // => 'John'</p>
|
|
366
|
+
<p>See [get](#Metadata+get)</p></dd>
|
|
360
367
|
<dt><a href="#Paragraph">Paragraph</a></dt>
|
|
361
|
-
<dd><p>Represents a paragraph of lines in a chord sheet</p>
|
|
362
|
-
</dd>
|
|
368
|
+
<dd><p>Represents a paragraph of lines in a chord sheet</p></dd>
|
|
363
369
|
<dt><a href="#Song">Song</a></dt>
|
|
364
|
-
<dd><p>Represents a song in a chord sheet. Currently a chord sheet can only have one song.</p>
|
|
365
|
-
</dd>
|
|
370
|
+
<dd><p>Represents a song in a chord sheet. Currently a chord sheet can only have one song.</p></dd>
|
|
366
371
|
<dt><a href="#Tag">Tag</a></dt>
|
|
367
|
-
<dd><p>Represents a tag/directive. See
|
|
368
|
-
</dd>
|
|
372
|
+
<dd><p>Represents a tag/directive. See https://www.chordpro.org/chordpro/chordpro-directives/</p></dd>
|
|
369
373
|
<dt><a href="#ChordProFormatter">ChordProFormatter</a></dt>
|
|
370
|
-
<dd><p>Formats a song into a ChordPro chord sheet</p>
|
|
371
|
-
</
|
|
374
|
+
<dd><p>Formats a song into a ChordPro chord sheet</p></dd>
|
|
375
|
+
<dt><a href="#Formatter">Formatter</a></dt>
|
|
376
|
+
<dd><p>Base class for all formatters, taking care of receiving a configuration wrapping that inside a Configuration object</p></dd>
|
|
372
377
|
<dt><a href="#HtmlDivFormatter">HtmlDivFormatter</a></dt>
|
|
373
|
-
<dd><p>Formats a song into HTML. It uses DIVs to align lyrics with chords, which makes it useful for responsive web pages.</p>
|
|
374
|
-
</dd>
|
|
378
|
+
<dd><p>Formats a song into HTML. It uses DIVs to align lyrics with chords, which makes it useful for responsive web pages.</p></dd>
|
|
375
379
|
<dt><a href="#HtmlFormatter">HtmlFormatter</a></dt>
|
|
376
|
-
<dd><p>Acts as a base class for HTML formatters, taking care of whitelisting prototype property access.</p>
|
|
377
|
-
</dd>
|
|
380
|
+
<dd><p>Acts as a base class for HTML formatters, taking care of whitelisting prototype property access.</p></dd>
|
|
378
381
|
<dt><a href="#HtmlTableFormatter">HtmlTableFormatter</a></dt>
|
|
379
382
|
<dd><p>Formats a song into HTML. It uses TABLEs to align lyrics with chords, which makes the HTML for things like
|
|
380
|
-
PDF conversion.</p>
|
|
381
|
-
</dd>
|
|
383
|
+
PDF conversion.</p></dd>
|
|
382
384
|
<dt><a href="#TextFormatter">TextFormatter</a></dt>
|
|
383
|
-
<dd><p>Formats a song into a plain text chord sheet</p>
|
|
384
|
-
</dd>
|
|
385
|
+
<dd><p>Formats a song into a plain text chord sheet</p></dd>
|
|
385
386
|
<dt><a href="#ChordProParser">ChordProParser</a></dt>
|
|
386
|
-
<dd><p>Parses a ChordPro chord sheet</p>
|
|
387
|
-
</dd>
|
|
387
|
+
<dd><p>Parses a ChordPro chord sheet</p></dd>
|
|
388
388
|
<dt><a href="#ChordSheetParser">ChordSheetParser</a></dt>
|
|
389
|
-
<dd><p>Parses a normal chord sheet</p>
|
|
390
|
-
</dd>
|
|
389
|
+
<dd><p>Parses a normal chord sheet</p></dd>
|
|
391
390
|
<dt><a href="#ParserWarning">ParserWarning</a></dt>
|
|
392
|
-
<dd><p>Represents a parser warning, currently only used by ChordProParser.</p>
|
|
393
|
-
</dd>
|
|
391
|
+
<dd><p>Represents a parser warning, currently only used by ChordProParser.</p></dd>
|
|
394
392
|
<dt><a href="#UltimateGuitarParser">UltimateGuitarParser</a></dt>
|
|
395
393
|
<dd><p>Parses an Ultimate Guitar chord sheet with metadata
|
|
396
|
-
Inherits from
|
|
397
|
-
</dd>
|
|
394
|
+
Inherits from [ChordSheetParser](#ChordSheetParser)</p></dd>
|
|
398
395
|
<dt><a href="#Chord">Chord</a></dt>
|
|
399
|
-
<dd><p>Represents a Chord, consisting of a root, suffix (quality) and bass</p>
|
|
400
|
-
</dd>
|
|
396
|
+
<dd><p>Represents a Chord, consisting of a root, suffix (quality) and bass</p></dd>
|
|
401
397
|
<dt><a href="#ChordSheetSerializer">ChordSheetSerializer</a></dt>
|
|
402
|
-
<dd><p>Serializes a song into een plain object, and deserializes the serialized object back into a
|
|
403
|
-
</dd>
|
|
398
|
+
<dd><p>Serializes a song into een plain object, and deserializes the serialized object back into a [Song](#Song)</p></dd>
|
|
404
399
|
</dl>
|
|
405
400
|
|
|
406
|
-
##
|
|
401
|
+
## Members
|
|
407
402
|
|
|
408
403
|
<dl>
|
|
409
404
|
<dt><a href="#ALBUM">ALBUM</a> : <code>string</code></dt>
|
|
410
|
-
<dd><p>
|
|
411
|
-
</dd>
|
|
405
|
+
<dd><p>Artist meta directive. See https://www.chordpro.org/chordpro/directives-artist/</p></dd>
|
|
412
406
|
<dt><a href="#ARTIST">ARTIST</a> : <code>string</code></dt>
|
|
413
|
-
<dd><p>
|
|
414
|
-
</dd>
|
|
407
|
+
<dd><p>Capo meta directive. See https://www.chordpro.org/chordpro/directives-capo/</p></dd>
|
|
415
408
|
<dt><a href="#CAPO">CAPO</a> : <code>string</code></dt>
|
|
416
|
-
<dd><p>
|
|
417
|
-
</dd>
|
|
409
|
+
<dd><p>Comment directive. See https://www.chordpro.org/chordpro/directives-comment/</p></dd>
|
|
418
410
|
<dt><a href="#COMMENT">COMMENT</a> : <code>string</code></dt>
|
|
419
|
-
<dd><p>
|
|
420
|
-
</dd>
|
|
411
|
+
<dd><p>Composer meta directive. See https://www.chordpro.org/chordpro/directives-composer/</p></dd>
|
|
421
412
|
<dt><a href="#COMPOSER">COMPOSER</a> : <code>string</code></dt>
|
|
422
|
-
<dd><p>
|
|
423
|
-
</dd>
|
|
413
|
+
<dd><p>Copyright meta directive. See https://www.chordpro.org/chordpro/directives-copyright/</p></dd>
|
|
424
414
|
<dt><a href="#COPYRIGHT">COPYRIGHT</a> : <code>string</code></dt>
|
|
425
|
-
<dd><p>
|
|
426
|
-
</dd>
|
|
415
|
+
<dd><p>Duration meta directive. See https://www.chordpro.org/chordpro/directives-duration/</p></dd>
|
|
427
416
|
<dt><a href="#DURATION">DURATION</a> : <code>string</code></dt>
|
|
428
|
-
<dd><p>
|
|
429
|
-
</dd>
|
|
417
|
+
<dd><p>End of chorus directive. See https://www.chordpro.org/chordpro/directives-env_chorus/</p></dd>
|
|
430
418
|
<dt><a href="#END_OF_CHORUS">END_OF_CHORUS</a> : <code>string</code></dt>
|
|
431
|
-
<dd><p>End of
|
|
432
|
-
</dd>
|
|
419
|
+
<dd><p>End of tab directive. See https://www.chordpro.org/chordpro/directives-env_tab/</p></dd>
|
|
433
420
|
<dt><a href="#END_OF_TAB">END_OF_TAB</a> : <code>string</code></dt>
|
|
434
|
-
<dd><p>End of
|
|
435
|
-
</dd>
|
|
421
|
+
<dd><p>End of verse directive. See https://www.chordpro.org/chordpro/directives-env_verse/</p></dd>
|
|
436
422
|
<dt><a href="#END_OF_VERSE">END_OF_VERSE</a> : <code>string</code></dt>
|
|
437
|
-
<dd><p>
|
|
438
|
-
</dd>
|
|
423
|
+
<dd><p>Key meta directive. See https://www.chordpro.org/chordpro/directives-key/</p></dd>
|
|
439
424
|
<dt><a href="#KEY">KEY</a> : <code>string</code></dt>
|
|
440
|
-
<dd><p>Key meta directive. See
|
|
441
|
-
</dd>
|
|
425
|
+
<dd><p>Key meta directive. See https://www.chordpro.org/chordpro/directives-key/</p></dd>
|
|
442
426
|
<dt><a href="#_KEY">_KEY</a> : <code>string</code></dt>
|
|
443
|
-
<dd><p>
|
|
444
|
-
</dd>
|
|
427
|
+
<dd><p>Lyricist meta directive. See https://www.chordpro.org/chordpro/directives-lyricist/</p></dd>
|
|
445
428
|
<dt><a href="#LYRICIST">LYRICIST</a> : <code>string</code></dt>
|
|
446
|
-
<dd><p>
|
|
447
|
-
</dd>
|
|
429
|
+
<dd><p>Start of chorus directive. See https://www.chordpro.org/chordpro/directives-env_chorus/</p></dd>
|
|
448
430
|
<dt><a href="#START_OF_CHORUS">START_OF_CHORUS</a> : <code>string</code></dt>
|
|
449
|
-
<dd><p>Start of
|
|
450
|
-
</dd>
|
|
431
|
+
<dd><p>Start of tab directive. See https://www.chordpro.org/chordpro/directives-env_tab/</p></dd>
|
|
451
432
|
<dt><a href="#START_OF_TAB">START_OF_TAB</a> : <code>string</code></dt>
|
|
452
|
-
<dd><p>Start of
|
|
453
|
-
</dd>
|
|
433
|
+
<dd><p>Start of verse directive. See https://www.chordpro.org/chordpro/directives-env_verse/</p></dd>
|
|
454
434
|
<dt><a href="#START_OF_VERSE">START_OF_VERSE</a> : <code>string</code></dt>
|
|
455
|
-
<dd><p>
|
|
456
|
-
</dd>
|
|
435
|
+
<dd><p>Subtitle meta directive. See https://www.chordpro.org/chordpro/directives-subtitle/</p></dd>
|
|
457
436
|
<dt><a href="#SUBTITLE">SUBTITLE</a> : <code>string</code></dt>
|
|
458
|
-
<dd><p>
|
|
459
|
-
</dd>
|
|
437
|
+
<dd><p>Tempo meta directive. See https://www.chordpro.org/chordpro/directives-tempo/</p></dd>
|
|
460
438
|
<dt><a href="#TEMPO">TEMPO</a> : <code>string</code></dt>
|
|
461
|
-
<dd><p>
|
|
462
|
-
</dd>
|
|
439
|
+
<dd><p>Time meta directive. See https://www.chordpro.org/chordpro/directives-time/</p></dd>
|
|
463
440
|
<dt><a href="#TIME">TIME</a> : <code>string</code></dt>
|
|
464
|
-
<dd><p>
|
|
465
|
-
</dd>
|
|
441
|
+
<dd><p>Title meta directive. See https://www.chordpro.org/chordpro/directives-title/</p></dd>
|
|
466
442
|
<dt><a href="#TITLE">TITLE</a> : <code>string</code></dt>
|
|
467
|
-
<dd><p>
|
|
468
|
-
</dd>
|
|
443
|
+
<dd><p>Transpose meta directive. See: https://www.chordpro.org/chordpro/directives-transpose/</p></dd>
|
|
469
444
|
<dt><a href="#TRANSPOSE">TRANSPOSE</a> : <code>string</code></dt>
|
|
470
|
-
<dd><p>
|
|
471
|
-
</
|
|
472
|
-
<
|
|
473
|
-
<
|
|
474
|
-
</dd>
|
|
445
|
+
<dd><p>New Key meta directive. See: https://github.com/PraiseCharts/ChordChartJS/issues/53</p></dd>
|
|
446
|
+
<dt><a href="#NEW_KEY">NEW_KEY</a> : <code>string</code></dt>
|
|
447
|
+
<dd><p>Year meta directive. See https://www.chordpro.org/chordpro/directives-year/</p></dd>
|
|
448
|
+
<dt><a href="#defaultCss">defaultCss</a> ⇒ <code>string</code></dt>
|
|
449
|
+
<dd><p>Generates basic CSS, scoped within the provided selector, to use with output generated by [HtmlTableFormatter](#HtmlTableFormatter)</p></dd>
|
|
450
|
+
</dl>
|
|
451
|
+
|
|
452
|
+
## Constants
|
|
453
|
+
|
|
454
|
+
<dl>
|
|
475
455
|
<dt><a href="#defaultCss">defaultCss</a> : <code>Object.<string, Object.<string, string>></code></dt>
|
|
476
456
|
<dd><p>Basic CSS, in object style à la useStyles, to use with output generated by {@link }HtmlTableFormatter}
|
|
477
|
-
For a CSS string see
|
|
478
|
-
</dd>
|
|
457
|
+
For a CSS string see [scopedCss](scopedCss)</p></dd>
|
|
479
458
|
<dt><a href="#VERSE">VERSE</a> : <code>string</code></dt>
|
|
480
|
-
<dd><p>Used to mark a paragraph as verse</p>
|
|
481
|
-
</
|
|
459
|
+
<dd><p>Used to mark a paragraph as verse</p></dd>
|
|
460
|
+
<dt><a href="#VERSE">VERSE</a> : <code>string</code></dt>
|
|
461
|
+
<dd><p>Used to mark a paragraph as chorus</p></dd>
|
|
482
462
|
<dt><a href="#CHORUS">CHORUS</a> : <code>string</code></dt>
|
|
483
|
-
<dd><p>Used to mark a paragraph as
|
|
484
|
-
</dd>
|
|
463
|
+
<dd><p>Used to mark a paragraph as not containing a line marked with a type</p></dd>
|
|
485
464
|
<dt><a href="#NONE">NONE</a> : <code>string</code></dt>
|
|
486
|
-
<dd><p>Used to mark a paragraph as
|
|
487
|
-
</dd>
|
|
465
|
+
<dd><p>Used to mark a paragraph as containing lines with both verse and chorus type</p></dd>
|
|
488
466
|
<dt><a href="#INDETERMINATE">INDETERMINATE</a> : <code>string</code></dt>
|
|
489
|
-
<dd><p>Used to mark a paragraph as
|
|
490
|
-
</dd>
|
|
491
|
-
<dt><a href="#TAB">TAB</a> : <code>string</code></dt>
|
|
492
|
-
<dd><p>Used to mark a paragraph as tab</p>
|
|
493
|
-
</dd>
|
|
467
|
+
<dd><p>Used to mark a paragraph as tab</p></dd>
|
|
494
468
|
</dl>
|
|
495
469
|
|
|
496
470
|
## Functions
|
|
497
471
|
|
|
498
472
|
<dl>
|
|
499
|
-
<dt><a href="#scopedCss">scopedCss(scope)</a> ⇒ <code>string</code></dt>
|
|
500
|
-
<dd><p>Generates basic CSS, scoped within the provided selector, to use with output generated by <a href="#HtmlTableFormatter">HtmlTableFormatter</a></p>
|
|
501
|
-
</dd>
|
|
502
473
|
<dt><del><a href="#parseChord">parseChord(chordString)</a> ⇒ <code>null</code> | <code><a href="#Chord">Chord</a></code></del></dt>
|
|
503
|
-
<dd><p>Tries to parse a chord string into a chord</p>
|
|
504
|
-
</
|
|
474
|
+
<dd><p>Tries to parse a chord string into a chord</p></dd>
|
|
475
|
+
<dt><a href="#getCapos">getCapos(key)</a> ⇒ <code>Object.<string, string></code></dt>
|
|
476
|
+
<dd><p>Returns applicable capos for the provided key</p></dd>
|
|
477
|
+
<dt><a href="#getKeys">getKeys(key)</a> ⇒ <code>Array.<string></code></dt>
|
|
478
|
+
<dd><p>Returns applicable keys to transpose to from the provided key</p></dd>
|
|
505
479
|
</dl>
|
|
506
480
|
|
|
507
481
|
<a name="ChordLyricsPair"></a>
|
|
508
482
|
|
|
509
483
|
## ChordLyricsPair
|
|
510
|
-
Represents a chord with the corresponding (partial) lyrics
|
|
484
|
+
<p>Represents a chord with the corresponding (partial) lyrics</p>
|
|
511
485
|
|
|
512
486
|
**Kind**: global class
|
|
513
487
|
|
|
@@ -521,42 +495,42 @@ Represents a chord with the corresponding (partial) lyrics
|
|
|
521
495
|
<a name="new_ChordLyricsPair_new"></a>
|
|
522
496
|
|
|
523
497
|
### new ChordLyricsPair(chords, lyrics)
|
|
524
|
-
Initialises a ChordLyricsPair
|
|
498
|
+
<p>Initialises a ChordLyricsPair</p>
|
|
525
499
|
|
|
526
500
|
|
|
527
501
|
| Param | Type | Description |
|
|
528
502
|
| --- | --- | --- |
|
|
529
|
-
| chords | <code>string</code> | The chords |
|
|
530
|
-
| lyrics | <code>string</code> | The lyrics |
|
|
503
|
+
| chords | <code>string</code> | <p>The chords</p> |
|
|
504
|
+
| lyrics | <code>string</code> | <p>The lyrics</p> |
|
|
531
505
|
|
|
532
506
|
<a name="ChordLyricsPair+chords"></a>
|
|
533
507
|
|
|
534
508
|
### chordLyricsPair.chords : <code>string</code>
|
|
535
|
-
The chords
|
|
509
|
+
<p>The chords</p>
|
|
536
510
|
|
|
537
511
|
**Kind**: instance property of [<code>ChordLyricsPair</code>](#ChordLyricsPair)
|
|
538
512
|
<a name="ChordLyricsPair+lyrics"></a>
|
|
539
513
|
|
|
540
514
|
### chordLyricsPair.lyrics : <code>string</code>
|
|
541
|
-
The lyrics
|
|
515
|
+
<p>The lyrics</p>
|
|
542
516
|
|
|
543
517
|
**Kind**: instance property of [<code>ChordLyricsPair</code>](#ChordLyricsPair)
|
|
544
518
|
<a name="ChordLyricsPair+isRenderable"></a>
|
|
545
519
|
|
|
546
520
|
### chordLyricsPair.isRenderable() ⇒ <code>boolean</code>
|
|
547
|
-
Indicates whether a ChordLyricsPair should be visible in a formatted chord sheet (except for ChordPro sheets)
|
|
521
|
+
<p>Indicates whether a ChordLyricsPair should be visible in a formatted chord sheet (except for ChordPro sheets)</p>
|
|
548
522
|
|
|
549
523
|
**Kind**: instance method of [<code>ChordLyricsPair</code>](#ChordLyricsPair)
|
|
550
524
|
<a name="ChordLyricsPair+clone"></a>
|
|
551
525
|
|
|
552
526
|
### chordLyricsPair.clone() ⇒ [<code>ChordLyricsPair</code>](#ChordLyricsPair)
|
|
553
|
-
Returns a deep copy of the ChordLyricsPair, useful when programmatically transforming a song
|
|
527
|
+
<p>Returns a deep copy of the ChordLyricsPair, useful when programmatically transforming a song</p>
|
|
554
528
|
|
|
555
529
|
**Kind**: instance method of [<code>ChordLyricsPair</code>](#ChordLyricsPair)
|
|
556
530
|
<a name="Comment"></a>
|
|
557
531
|
|
|
558
532
|
## Comment
|
|
559
|
-
Represents a comment. See https://www.chordpro.org/chordpro/chordpro-file-format-specification/#overview
|
|
533
|
+
<p>Represents a comment. See https://www.chordpro.org/chordpro/chordpro-file-format-specification/#overview</p>
|
|
560
534
|
|
|
561
535
|
**Kind**: global class
|
|
562
536
|
|
|
@@ -567,104 +541,22 @@ Represents a comment. See https://www.chordpro.org/chordpro/chordpro-file-format
|
|
|
567
541
|
<a name="Comment+isRenderable"></a>
|
|
568
542
|
|
|
569
543
|
### comment.isRenderable() ⇒ <code>boolean</code>
|
|
570
|
-
Indicates whether a Comment should be visible in a formatted chord sheet (except for ChordPro sheets)
|
|
544
|
+
<p>Indicates whether a Comment should be visible in a formatted chord sheet (except for ChordPro sheets)</p>
|
|
571
545
|
|
|
572
546
|
**Kind**: instance method of [<code>Comment</code>](#Comment)
|
|
573
547
|
<a name="Comment+clone"></a>
|
|
574
548
|
|
|
575
549
|
### comment.clone() ⇒ [<code>Comment</code>](#Comment)
|
|
576
|
-
Returns a deep copy of the Comment, useful when programmatically transforming a song
|
|
550
|
+
<p>Returns a deep copy of the Comment, useful when programmatically transforming a song</p>
|
|
577
551
|
|
|
578
552
|
**Kind**: instance method of [<code>Comment</code>](#Comment)
|
|
579
|
-
<a name="Line"></a>
|
|
580
|
-
|
|
581
|
-
## Line
|
|
582
|
-
Represents a line in a chord sheet, consisting of items of type ChordLyricsPair or Tag
|
|
583
|
-
|
|
584
|
-
**Kind**: global class
|
|
585
|
-
|
|
586
|
-
* [Line](#Line)
|
|
587
|
-
* [.items](#Line+items) : <code>Array.<(ChordLyricsPair\|Tag\|Comment)></code>
|
|
588
|
-
* [.type](#Line+type) : <code>string</code>
|
|
589
|
-
* [.isEmpty()](#Line+isEmpty) ⇒ <code>boolean</code>
|
|
590
|
-
* [.addItem(item)](#Line+addItem)
|
|
591
|
-
* [.hasRenderableItems()](#Line+hasRenderableItems) ⇒ <code>boolean</code>
|
|
592
|
-
* [.clone()](#Line+clone) ⇒ [<code>Line</code>](#Line)
|
|
593
|
-
* [.isVerse()](#Line+isVerse) ⇒ <code>boolean</code>
|
|
594
|
-
* [.isChorus()](#Line+isChorus) ⇒ <code>boolean</code>
|
|
595
|
-
* ~~[.hasContent()](#Line+hasContent) ⇒ <code>boolean</code>~~
|
|
596
|
-
|
|
597
|
-
<a name="Line+items"></a>
|
|
598
|
-
|
|
599
|
-
### line.items : <code>Array.<(ChordLyricsPair\|Tag\|Comment)></code>
|
|
600
|
-
The items ([ChordLyricsPair](#ChordLyricsPair) or [Tag](#Tag) or [Comment](#Comment)) of which the line consists
|
|
601
|
-
|
|
602
|
-
**Kind**: instance property of [<code>Line</code>](#Line)
|
|
603
|
-
<a name="Line+type"></a>
|
|
604
|
-
|
|
605
|
-
### line.type : <code>string</code>
|
|
606
|
-
The line type, This is set by the ChordProParser when it read tags like {start_of_chorus} or {start_of_verse}
|
|
607
|
-
Values can be [VERSE](#VERSE), [CHORUS](#CHORUS) or [NONE](#NONE)
|
|
608
|
-
|
|
609
|
-
**Kind**: instance property of [<code>Line</code>](#Line)
|
|
610
|
-
<a name="Line+isEmpty"></a>
|
|
611
|
-
|
|
612
|
-
### line.isEmpty() ⇒ <code>boolean</code>
|
|
613
|
-
Indicates whether the line contains any items
|
|
614
|
-
|
|
615
|
-
**Kind**: instance method of [<code>Line</code>](#Line)
|
|
616
|
-
<a name="Line+addItem"></a>
|
|
617
|
-
|
|
618
|
-
### line.addItem(item)
|
|
619
|
-
Adds an item ([ChordLyricsPair](#ChordLyricsPair) or [Tag](#Tag)) to the line
|
|
620
|
-
|
|
621
|
-
**Kind**: instance method of [<code>Line</code>](#Line)
|
|
622
|
-
|
|
623
|
-
| Param | Type | Description |
|
|
624
|
-
| --- | --- | --- |
|
|
625
|
-
| item | [<code>ChordLyricsPair</code>](#ChordLyricsPair) \| [<code>Tag</code>](#Tag) | The item to be added |
|
|
626
|
-
|
|
627
|
-
<a name="Line+hasRenderableItems"></a>
|
|
628
|
-
|
|
629
|
-
### line.hasRenderableItems() ⇒ <code>boolean</code>
|
|
630
|
-
Indicates whether the line contains items that are renderable
|
|
631
|
-
|
|
632
|
-
**Kind**: instance method of [<code>Line</code>](#Line)
|
|
633
|
-
<a name="Line+clone"></a>
|
|
634
|
-
|
|
635
|
-
### line.clone() ⇒ [<code>Line</code>](#Line)
|
|
636
|
-
Returns a deep copy of the line and all of its items
|
|
637
|
-
|
|
638
|
-
**Kind**: instance method of [<code>Line</code>](#Line)
|
|
639
|
-
<a name="Line+isVerse"></a>
|
|
640
|
-
|
|
641
|
-
### line.isVerse() ⇒ <code>boolean</code>
|
|
642
|
-
Indicates whether the line type is [VERSE](#VERSE)
|
|
643
|
-
|
|
644
|
-
**Kind**: instance method of [<code>Line</code>](#Line)
|
|
645
|
-
<a name="Line+isChorus"></a>
|
|
646
|
-
|
|
647
|
-
### line.isChorus() ⇒ <code>boolean</code>
|
|
648
|
-
Indicates whether the line type is [CHORUS](#CHORUS)
|
|
649
|
-
|
|
650
|
-
**Kind**: instance method of [<code>Line</code>](#Line)
|
|
651
|
-
<a name="Line+hasContent"></a>
|
|
652
|
-
|
|
653
|
-
### ~~line.hasContent() ⇒ <code>boolean</code>~~
|
|
654
|
-
***Deprecated***
|
|
655
|
-
|
|
656
|
-
Indicates whether the line contains items that are renderable. Please use [hasRenderableItems](hasRenderableItems)
|
|
657
|
-
|
|
658
|
-
**Kind**: instance method of [<code>Line</code>](#Line)
|
|
659
553
|
<a name="Metadata"></a>
|
|
660
554
|
|
|
661
555
|
## Metadata
|
|
662
|
-
Stores song metadata. Properties can be accessed using the get() method
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
See [get](#Metadata+get)
|
|
556
|
+
<p>Stores song metadata. Properties can be accessed using the get() method:</p>
|
|
557
|
+
<p>const metadata = new Metadata({ author: 'John' });
|
|
558
|
+
metadata.get('author') // => 'John'</p>
|
|
559
|
+
<p>See [get](#Metadata+get)</p>
|
|
668
560
|
|
|
669
561
|
**Kind**: global class
|
|
670
562
|
|
|
@@ -675,130 +567,98 @@ See [get](#Metadata+get)
|
|
|
675
567
|
<a name="Metadata+get"></a>
|
|
676
568
|
|
|
677
569
|
### metadata.get(prop) ⇒ <code>Array.<String></code> \| <code>String</code>
|
|
678
|
-
Reads a metadata value by key. This method supports simple value lookup, as fetching single array values
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
metadata.get('
|
|
686
|
-
|
|
687
|
-
metadata
|
|
688
|
-
metadata.get('author
|
|
689
|
-
|
|
690
|
-
Using a negative index will start counting at the end of the list:
|
|
691
|
-
|
|
692
|
-
const metadata = new Metadata({ lyricist: 'Pete', author: ['John', 'Mary'] });
|
|
693
|
-
metadata.get('author.-1') // => 'Mary'
|
|
694
|
-
metadata.get('author.-2') // => 'John'
|
|
570
|
+
<p>Reads a metadata value by key. This method supports simple value lookup, as fetching single array values.</p>
|
|
571
|
+
<p>This method deprecates direct property access, eg: metadata['author']</p>
|
|
572
|
+
<p>Examples:</p>
|
|
573
|
+
<p>const metadata = new Metadata({ lyricist: 'Pete', author: ['John', 'Mary'] });
|
|
574
|
+
metadata.get('lyricist') // => 'Pete'
|
|
575
|
+
metadata.get('author') // => ['John', 'Mary']
|
|
576
|
+
metadata.get('author.1') // => 'John'
|
|
577
|
+
metadata.get('author.2') // => 'Mary'</p>
|
|
578
|
+
<p>Using a negative index will start counting at the end of the list:</p>
|
|
579
|
+
<p>const metadata = new Metadata({ lyricist: 'Pete', author: ['John', 'Mary'] });
|
|
580
|
+
metadata.get('author.-1') // => 'Mary'
|
|
581
|
+
metadata.get('author.-2') // => 'John'</p>
|
|
695
582
|
|
|
696
583
|
**Kind**: instance method of [<code>Metadata</code>](#Metadata)
|
|
697
|
-
**Returns**: <code>Array.<String></code> \| <code>String</code> - the metadata value(s). If there is only one value, it will return a String,
|
|
698
|
-
else it returns an array of strings
|
|
584
|
+
**Returns**: <code>Array.<String></code> \| <code>String</code> - <p>the metadata value(s). If there is only one value, it will return a String,
|
|
585
|
+
else it returns an array of strings.</p>
|
|
699
586
|
|
|
700
587
|
| Param | Description |
|
|
701
588
|
| --- | --- |
|
|
702
|
-
| prop | the property name |
|
|
589
|
+
| prop | <p>the property name</p> |
|
|
703
590
|
|
|
704
591
|
<a name="Metadata+clone"></a>
|
|
705
592
|
|
|
706
593
|
### metadata.clone() ⇒ [<code>Metadata</code>](#Metadata)
|
|
707
|
-
Returns a deep clone of this Metadata object
|
|
594
|
+
<p>Returns a deep clone of this Metadata object</p>
|
|
708
595
|
|
|
709
596
|
**Kind**: instance method of [<code>Metadata</code>](#Metadata)
|
|
710
|
-
**Returns**: [<code>Metadata</code>](#Metadata) - the cloned Metadata object
|
|
597
|
+
**Returns**: [<code>Metadata</code>](#Metadata) - <p>the cloned Metadata object</p>
|
|
711
598
|
<a name="Paragraph"></a>
|
|
712
599
|
|
|
713
600
|
## Paragraph
|
|
714
|
-
Represents a paragraph of lines in a chord sheet
|
|
601
|
+
<p>Represents a paragraph of lines in a chord sheet</p>
|
|
715
602
|
|
|
716
603
|
**Kind**: global class
|
|
717
604
|
|
|
718
605
|
* [Paragraph](#Paragraph)
|
|
719
|
-
* [.lines](#Paragraph+lines) : [<code>Array.<Line></code>](#Line)
|
|
720
606
|
* [.type](#Paragraph+type) ⇒ <code>string</code>
|
|
721
607
|
* [.hasRenderableItems()](#Paragraph+hasRenderableItems) ⇒ <code>boolean</code>
|
|
722
608
|
|
|
723
|
-
<a name="Paragraph+lines"></a>
|
|
724
|
-
|
|
725
|
-
### paragraph.lines : [<code>Array.<Line></code>](#Line)
|
|
726
|
-
The [Line](#Line) items of which the paragraph consists
|
|
727
|
-
|
|
728
|
-
**Kind**: instance property of [<code>Paragraph</code>](#Paragraph)
|
|
729
609
|
<a name="Paragraph+type"></a>
|
|
730
610
|
|
|
731
611
|
### paragraph.type ⇒ <code>string</code>
|
|
732
|
-
Tries to determine the common type for all lines. If the types for all lines are equal, it returns that type.
|
|
733
|
-
If not, it returns [INDETERMINATE](#INDETERMINATE)
|
|
612
|
+
<p>Tries to determine the common type for all lines. If the types for all lines are equal, it returns that type.
|
|
613
|
+
If not, it returns [INDETERMINATE](#INDETERMINATE)</p>
|
|
734
614
|
|
|
735
615
|
**Kind**: instance property of [<code>Paragraph</code>](#Paragraph)
|
|
736
616
|
<a name="Paragraph+hasRenderableItems"></a>
|
|
737
617
|
|
|
738
618
|
### paragraph.hasRenderableItems() ⇒ <code>boolean</code>
|
|
739
|
-
Indicates whether the paragraph contains lines with renderable items
|
|
619
|
+
<p>Indicates whether the paragraph contains lines with renderable items.</p>
|
|
740
620
|
|
|
741
621
|
**Kind**: instance method of [<code>Paragraph</code>](#Paragraph)
|
|
742
622
|
**See**: [Line.hasRenderableItems](Line.hasRenderableItems)
|
|
743
623
|
<a name="Song"></a>
|
|
744
624
|
|
|
745
625
|
## Song
|
|
746
|
-
Represents a song in a chord sheet. Currently a chord sheet can only have one song
|
|
626
|
+
<p>Represents a song in a chord sheet. Currently a chord sheet can only have one song.</p>
|
|
747
627
|
|
|
748
628
|
**Kind**: global class
|
|
749
629
|
|
|
750
630
|
* [Song](#Song)
|
|
751
631
|
* [new Song(metadata)](#new_Song_new)
|
|
752
|
-
* [.
|
|
753
|
-
* [.paragraphs](#Song+paragraphs) : [<code>Array.<Paragraph></code>](#Paragraph)
|
|
754
|
-
* [.metadata](#Song+metadata) : [<code>Metadata</code>](#Metadata)
|
|
755
|
-
* [.bodyLines](#Song+bodyLines) ⇒ [<code>Array.<Line></code>](#Line)
|
|
632
|
+
* [.bodyLines](#Song+bodyLines) ⇒ <code>Array.<Line></code>
|
|
756
633
|
* [.bodyParagraphs](#Song+bodyParagraphs) ⇒ [<code>Array.<Paragraph></code>](#Paragraph)
|
|
757
634
|
* ~~[.metaData](#Song+metaData) ⇒~~
|
|
758
635
|
* [.clone()](#Song+clone) ⇒ [<code>Song</code>](#Song)
|
|
636
|
+
* [.setCapo(capo)](#Song+setCapo) ⇒ [<code>Song</code>](#Song)
|
|
637
|
+
* [.setKey(key)](#Song+setKey) ⇒ [<code>Song</code>](#Song)
|
|
759
638
|
|
|
760
639
|
<a name="new_Song_new"></a>
|
|
761
640
|
|
|
762
641
|
### new Song(metadata)
|
|
763
|
-
Creates a new {Song} instance
|
|
642
|
+
<p>Creates a new {Song} instance</p>
|
|
764
643
|
|
|
765
644
|
|
|
766
645
|
| Param | Type | Description |
|
|
767
646
|
| --- | --- | --- |
|
|
768
|
-
| metadata | <code>Object</code> \| [<code>Metadata</code>](#Metadata) | predefined metadata |
|
|
769
|
-
|
|
770
|
-
<a name="Song+lines"></a>
|
|
771
|
-
|
|
772
|
-
### song.lines : [<code>Array.<Line></code>](#Line)
|
|
773
|
-
The [Line](#Line) items of which the song consists
|
|
774
|
-
|
|
775
|
-
**Kind**: instance property of [<code>Song</code>](#Song)
|
|
776
|
-
<a name="Song+paragraphs"></a>
|
|
777
|
-
|
|
778
|
-
### song.paragraphs : [<code>Array.<Paragraph></code>](#Paragraph)
|
|
779
|
-
The [Paragraph](#Paragraph) items of which the song consists
|
|
780
|
-
|
|
781
|
-
**Kind**: instance property of [<code>Song</code>](#Song)
|
|
782
|
-
<a name="Song+metadata"></a>
|
|
647
|
+
| metadata | <code>Object</code> \| [<code>Metadata</code>](#Metadata) | <p>predefined metadata</p> |
|
|
783
648
|
|
|
784
|
-
### song.metadata : [<code>Metadata</code>](#Metadata)
|
|
785
|
-
The song's metadata. When there is only one value for an entry, the value is a string. Else, the value is
|
|
786
|
-
an array containing all unique values for the entry.
|
|
787
|
-
|
|
788
|
-
**Kind**: instance property of [<code>Song</code>](#Song)
|
|
789
649
|
<a name="Song+bodyLines"></a>
|
|
790
650
|
|
|
791
|
-
### song.bodyLines ⇒
|
|
792
|
-
Returns the song lines, skipping the leading empty lines (empty as in not rendering any content). This is useful
|
|
793
|
-
if you want to skip the
|
|
651
|
+
### song.bodyLines ⇒ <code>Array.<Line></code>
|
|
652
|
+
<p>Returns the song lines, skipping the leading empty lines (empty as in not rendering any content). This is useful
|
|
653
|
+
if you want to skip the "header lines": the lines that only contain meta data.</p>
|
|
794
654
|
|
|
795
655
|
**Kind**: instance property of [<code>Song</code>](#Song)
|
|
796
|
-
**Returns**:
|
|
656
|
+
**Returns**: <code>Array.<Line></code> - <p>The song body lines</p>
|
|
797
657
|
<a name="Song+bodyParagraphs"></a>
|
|
798
658
|
|
|
799
659
|
### song.bodyParagraphs ⇒ [<code>Array.<Paragraph></code>](#Paragraph)
|
|
800
|
-
Returns the song paragraphs, skipping the paragraphs that only contain empty lines
|
|
801
|
-
(empty as in not rendering any content)
|
|
660
|
+
<p>Returns the song paragraphs, skipping the paragraphs that only contain empty lines
|
|
661
|
+
(empty as in not rendering any content)</p>
|
|
802
662
|
|
|
803
663
|
**Kind**: instance property of [<code>Song</code>](#Song)
|
|
804
664
|
**See**: [bodyLines](bodyLines)
|
|
@@ -807,21 +667,54 @@ Returns the song paragraphs, skipping the paragraphs that only contain empty lin
|
|
|
807
667
|
### ~~song.metaData ⇒~~
|
|
808
668
|
***Deprecated***
|
|
809
669
|
|
|
810
|
-
The song's metadata. Please use [metadata](metadata) instead
|
|
670
|
+
<p>The song's metadata. Please use [metadata](metadata) instead.</p>
|
|
811
671
|
|
|
812
672
|
**Kind**: instance property of [<code>Song</code>](#Song)
|
|
813
|
-
**Returns**: [Metadata](#Metadata) The metadata
|
|
673
|
+
**Returns**: <p>[Metadata](#Metadata) The metadata</p>
|
|
814
674
|
<a name="Song+clone"></a>
|
|
815
675
|
|
|
816
676
|
### song.clone() ⇒ [<code>Song</code>](#Song)
|
|
817
|
-
Returns a deep clone of the song
|
|
677
|
+
<p>Returns a deep clone of the song</p>
|
|
678
|
+
|
|
679
|
+
**Kind**: instance method of [<code>Song</code>](#Song)
|
|
680
|
+
**Returns**: [<code>Song</code>](#Song) - <p>The cloned song</p>
|
|
681
|
+
<a name="Song+setCapo"></a>
|
|
682
|
+
|
|
683
|
+
### song.setCapo(capo) ⇒ [<code>Song</code>](#Song)
|
|
684
|
+
<p>Returns a copy of the song with the capo value set to the specified capo. It changes:</p>
|
|
685
|
+
<ul>
|
|
686
|
+
<li>the value for <code>capo</code> in the <code>metadata</code> set</li>
|
|
687
|
+
<li>any existing <code>capo</code> directive)</li>
|
|
688
|
+
</ul>
|
|
689
|
+
|
|
690
|
+
**Kind**: instance method of [<code>Song</code>](#Song)
|
|
691
|
+
**Returns**: [<code>Song</code>](#Song) - <p>The changed song</p>
|
|
692
|
+
|
|
693
|
+
| Param | Type | Description |
|
|
694
|
+
| --- | --- | --- |
|
|
695
|
+
| capo | <code>number</code> \| <code>null</code> | <p>the capo. Passing <code>null</code> will:</p> <ul> <li>remove the current key from <code>metadata</code></li> <li>remove any <code>capo</code> directive</li> </ul> |
|
|
696
|
+
|
|
697
|
+
<a name="Song+setKey"></a>
|
|
698
|
+
|
|
699
|
+
### song.setKey(key) ⇒ [<code>Song</code>](#Song)
|
|
700
|
+
<p>Returns a copy of the song with the key set to the specified key. It changes:</p>
|
|
701
|
+
<ul>
|
|
702
|
+
<li>the value for <code>key</code> in the <code>metadata</code> set</li>
|
|
703
|
+
<li>any existing <code>key</code> directive</li>
|
|
704
|
+
<li>all chords, those are transposed according to the distance between the current and the new key</li>
|
|
705
|
+
</ul>
|
|
818
706
|
|
|
819
707
|
**Kind**: instance method of [<code>Song</code>](#Song)
|
|
820
|
-
**Returns**: [<code>Song</code>](#Song) - The
|
|
708
|
+
**Returns**: [<code>Song</code>](#Song) - <p>The changed song</p>
|
|
709
|
+
|
|
710
|
+
| Param | Type | Description |
|
|
711
|
+
| --- | --- | --- |
|
|
712
|
+
| key | <code>string</code> | <p>The new key.</p> |
|
|
713
|
+
|
|
821
714
|
<a name="Tag"></a>
|
|
822
715
|
|
|
823
716
|
## Tag
|
|
824
|
-
Represents a tag/directive. See https://www.chordpro.org/chordpro/chordpro-directives
|
|
717
|
+
<p>Represents a tag/directive. See https://www.chordpro.org/chordpro/chordpro-directives/</p>
|
|
825
718
|
|
|
826
719
|
**Kind**: global class
|
|
827
720
|
|
|
@@ -837,84 +730,87 @@ Represents a tag/directive. See https://www.chordpro.org/chordpro/chordpro-direc
|
|
|
837
730
|
<a name="Tag+name"></a>
|
|
838
731
|
|
|
839
732
|
### tag.name : <code>string</code>
|
|
840
|
-
The tag full name. When the original tag used the short name,
|
|
733
|
+
<p>The tag full name. When the original tag used the short name, <code>name</code> will return the full name.</p>
|
|
841
734
|
|
|
842
735
|
**Kind**: instance property of [<code>Tag</code>](#Tag)
|
|
843
736
|
<a name="Tag+originalName"></a>
|
|
844
737
|
|
|
845
738
|
### tag.originalName : <code>string</code>
|
|
846
|
-
The original tag name that was used to construct the tag
|
|
739
|
+
<p>The original tag name that was used to construct the tag.</p>
|
|
847
740
|
|
|
848
741
|
**Kind**: instance property of [<code>Tag</code>](#Tag)
|
|
849
742
|
<a name="Tag+value"></a>
|
|
850
743
|
|
|
851
744
|
### tag.value : <code>string</code> \| <code>null</code>
|
|
852
|
-
The tag value
|
|
745
|
+
<p>The tag value</p>
|
|
853
746
|
|
|
854
747
|
**Kind**: instance property of [<code>Tag</code>](#Tag)
|
|
855
748
|
<a name="Tag+hasValue"></a>
|
|
856
749
|
|
|
857
750
|
### tag.hasValue() ⇒ <code>boolean</code>
|
|
858
|
-
Checks whether the tag value is a non-empty string
|
|
751
|
+
<p>Checks whether the tag value is a non-empty string.</p>
|
|
859
752
|
|
|
860
753
|
**Kind**: instance method of [<code>Tag</code>](#Tag)
|
|
861
754
|
<a name="Tag+isRenderable"></a>
|
|
862
755
|
|
|
863
756
|
### tag.isRenderable() ⇒ <code>boolean</code>
|
|
864
|
-
Checks whether the tag is usually rendered inline. It currently only applies to comment tags
|
|
757
|
+
<p>Checks whether the tag is usually rendered inline. It currently only applies to comment tags.</p>
|
|
865
758
|
|
|
866
759
|
**Kind**: instance method of [<code>Tag</code>](#Tag)
|
|
867
760
|
<a name="Tag+isMetaTag"></a>
|
|
868
761
|
|
|
869
762
|
### tag.isMetaTag() ⇒ <code>boolean</code>
|
|
870
|
-
Checks whether the tag is either a standard meta tag or a custom meta directive (
|
|
763
|
+
<p>Checks whether the tag is either a standard meta tag or a custom meta directive (<code>{x_some_name}</code>)</p>
|
|
871
764
|
|
|
872
765
|
**Kind**: instance method of [<code>Tag</code>](#Tag)
|
|
873
766
|
<a name="Tag+clone"></a>
|
|
874
767
|
|
|
875
768
|
### tag.clone() ⇒ [<code>Tag</code>](#Tag)
|
|
876
|
-
Returns a clone of the tag
|
|
769
|
+
<p>Returns a clone of the tag.</p>
|
|
877
770
|
|
|
878
771
|
**Kind**: instance method of [<code>Tag</code>](#Tag)
|
|
879
|
-
**Returns**: [<code>Tag</code>](#Tag) - The cloned tag
|
|
772
|
+
**Returns**: [<code>Tag</code>](#Tag) - <p>The cloned tag</p>
|
|
880
773
|
<a name="ChordProFormatter"></a>
|
|
881
774
|
|
|
882
775
|
## ChordProFormatter
|
|
883
|
-
Formats a song into a ChordPro chord sheet
|
|
776
|
+
<p>Formats a song into a ChordPro chord sheet</p>
|
|
884
777
|
|
|
885
778
|
**Kind**: global class
|
|
779
|
+
<a name="ChordProFormatter+format"></a>
|
|
886
780
|
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
* [.format(song)](#ChordProFormatter+format) ⇒ <code>string</code>
|
|
890
|
-
|
|
891
|
-
<a name="new_ChordProFormatter_new"></a>
|
|
892
|
-
|
|
893
|
-
### new ChordProFormatter(options)
|
|
894
|
-
Instantiate
|
|
781
|
+
### chordProFormatter.format(song) ⇒ <code>string</code>
|
|
782
|
+
<p>Formats a song into a ChordPro chord sheet.</p>
|
|
895
783
|
|
|
784
|
+
**Kind**: instance method of [<code>ChordProFormatter</code>](#ChordProFormatter)
|
|
785
|
+
**Returns**: <code>string</code> - <p>The ChordPro string</p>
|
|
896
786
|
|
|
897
787
|
| Param | Type | Description |
|
|
898
788
|
| --- | --- | --- |
|
|
899
|
-
|
|
|
900
|
-
| options.evaluate | <code>boolean</code> | Whether or not to evaluate meta expressions. For more info about meta expression, see: https://bit.ly/2SC9c2u |
|
|
789
|
+
| song | [<code>Song</code>](#Song) | <p>The song to be formatted</p> |
|
|
901
790
|
|
|
902
|
-
<a name="
|
|
791
|
+
<a name="Formatter"></a>
|
|
903
792
|
|
|
904
|
-
|
|
905
|
-
|
|
793
|
+
## Formatter
|
|
794
|
+
<p>Base class for all formatters, taking care of receiving a configuration wrapping that inside a Configuration object</p>
|
|
906
795
|
|
|
907
|
-
**Kind**:
|
|
908
|
-
|
|
796
|
+
**Kind**: global class
|
|
797
|
+
<a name="new_Formatter_new"></a>
|
|
909
798
|
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
799
|
+
### new Formatter([configuration])
|
|
800
|
+
<p>Instantiate</p>
|
|
801
|
+
|
|
802
|
+
|
|
803
|
+
| Param | Type | Default | Description |
|
|
804
|
+
| --- | --- | --- | --- |
|
|
805
|
+
| [configuration] | <code>Object</code> | <code>{}</code> | <p>options</p> |
|
|
806
|
+
| [configuration.evaluate] | <code>boolean</code> | <code>false</code> | <p>Whether or not to evaluate meta expressions. For more info about meta expressions, see: https://bit.ly/2SC9c2u</p> |
|
|
807
|
+
| [configuration.metadata] | <code>object</code> | <code>{}</code> | |
|
|
808
|
+
| [configuration.metadata.separator] | <code>string</code> | <code>"\", \""</code> | <p>The separator to be used when rendering a metadata value that has multiple values. See: https://bit.ly/2SC9c2u</p> |
|
|
913
809
|
|
|
914
810
|
<a name="HtmlDivFormatter"></a>
|
|
915
811
|
|
|
916
812
|
## HtmlDivFormatter
|
|
917
|
-
Formats a song into HTML. It uses DIVs to align lyrics with chords, which makes it useful for responsive web pages
|
|
813
|
+
<p>Formats a song into HTML. It uses DIVs to align lyrics with chords, which makes it useful for responsive web pages.</p>
|
|
918
814
|
|
|
919
815
|
**Kind**: global class
|
|
920
816
|
|
|
@@ -928,60 +824,57 @@ Formats a song into HTML. It uses DIVs to align lyrics with chords, which makes
|
|
|
928
824
|
<a name="HtmlDivFormatter+format"></a>
|
|
929
825
|
|
|
930
826
|
### htmlDivFormatter.format(song) ⇒ <code>string</code>
|
|
931
|
-
Formats a song into HTML
|
|
827
|
+
<p>Formats a song into HTML.</p>
|
|
932
828
|
|
|
933
829
|
**Kind**: instance method of [<code>HtmlDivFormatter</code>](#HtmlDivFormatter)
|
|
934
|
-
**Returns**: <code>string</code> - The HTML string
|
|
830
|
+
**Returns**: <code>string</code> - <p>The HTML string</p>
|
|
935
831
|
|
|
936
832
|
| Param | Type | Description |
|
|
937
833
|
| --- | --- | --- |
|
|
938
|
-
| song | [<code>Song</code>](#Song) | The song to be formatted |
|
|
834
|
+
| song | [<code>Song</code>](#Song) | <p>The song to be formatted</p> |
|
|
939
835
|
|
|
940
836
|
<a name="HtmlDivFormatter.cssString"></a>
|
|
941
837
|
|
|
942
838
|
### HtmlDivFormatter.cssString(scope) ⇒ <code>string</code>
|
|
943
|
-
Generates basic CSS, optionally scoped within the provided selector, to use with output generated by
|
|
944
|
-
[HtmlDivFormatter](#HtmlDivFormatter)
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
}
|
|
839
|
+
<p>Generates basic CSS, optionally scoped within the provided selector, to use with output generated by
|
|
840
|
+
[HtmlDivFormatter](#HtmlDivFormatter)</p>
|
|
841
|
+
<p>For example, execute cssString('.chordSheetViewer') will result in CSS like:</p>
|
|
842
|
+
<pre><code>.chordSheetViewer .paragraph {
|
|
843
|
+
margin-bottom: 1em;
|
|
844
|
+
}
|
|
845
|
+
</code></pre>
|
|
951
846
|
|
|
952
847
|
**Kind**: static method of [<code>HtmlDivFormatter</code>](#HtmlDivFormatter)
|
|
953
|
-
**Returns**: <code>string</code> - the CSS string
|
|
848
|
+
**Returns**: <code>string</code> - <p>the CSS string</p>
|
|
954
849
|
|
|
955
850
|
| Param | Description |
|
|
956
851
|
| --- | --- |
|
|
957
|
-
| scope | the CSS scope to use, for example
|
|
852
|
+
| scope | <p>the CSS scope to use, for example <code>.chordSheetViewer</code></p> |
|
|
958
853
|
|
|
959
854
|
<a name="HtmlDivFormatter.cssObject"></a>
|
|
960
855
|
|
|
961
856
|
### HtmlDivFormatter.cssObject() ⇒ <code>Object.<string, Object.<string, string>></code>
|
|
962
|
-
Basic CSS, in object style à la useStyles, to use with output generated by [HtmlDivFormatter](#HtmlDivFormatter)
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
For a CSS string see [cssString](cssString)
|
|
857
|
+
<p>Basic CSS, in object style à la useStyles, to use with output generated by [HtmlDivFormatter](#HtmlDivFormatter)</p>
|
|
858
|
+
<p>Example:</p>
|
|
859
|
+
<pre><code>'.paragraph': {
|
|
860
|
+
marginBottom: '1em'
|
|
861
|
+
}
|
|
862
|
+
</code></pre>
|
|
863
|
+
<p>For a CSS string see [cssString](cssString)</p>
|
|
971
864
|
|
|
972
865
|
**Kind**: static method of [<code>HtmlDivFormatter</code>](#HtmlDivFormatter)
|
|
973
|
-
**Returns**: <code>Object.<string, Object.<string, string>></code> - the CSS object
|
|
866
|
+
**Returns**: <code>Object.<string, Object.<string, string>></code> - <p>the CSS object</p>
|
|
974
867
|
<a name="HtmlFormatter"></a>
|
|
975
868
|
|
|
976
869
|
## HtmlFormatter
|
|
977
|
-
Acts as a base class for HTML formatters, taking care of whitelisting prototype property access
|
|
870
|
+
<p>Acts as a base class for HTML formatters, taking care of whitelisting prototype property access.</p>
|
|
978
871
|
|
|
979
872
|
**Kind**: global class
|
|
980
873
|
<a name="HtmlTableFormatter"></a>
|
|
981
874
|
|
|
982
875
|
## HtmlTableFormatter
|
|
983
|
-
Formats a song into HTML. It uses TABLEs to align lyrics with chords, which makes the HTML for things like
|
|
984
|
-
PDF conversion
|
|
876
|
+
<p>Formats a song into HTML. It uses TABLEs to align lyrics with chords, which makes the HTML for things like
|
|
877
|
+
PDF conversion.</p>
|
|
985
878
|
|
|
986
879
|
**Kind**: global class
|
|
987
880
|
|
|
@@ -995,70 +888,68 @@ PDF conversion.
|
|
|
995
888
|
<a name="HtmlTableFormatter+format"></a>
|
|
996
889
|
|
|
997
890
|
### htmlTableFormatter.format(song) ⇒ <code>string</code>
|
|
998
|
-
Formats a song into HTML
|
|
891
|
+
<p>Formats a song into HTML.</p>
|
|
999
892
|
|
|
1000
893
|
**Kind**: instance method of [<code>HtmlTableFormatter</code>](#HtmlTableFormatter)
|
|
1001
|
-
**Returns**: <code>string</code> - The HTML string
|
|
894
|
+
**Returns**: <code>string</code> - <p>The HTML string</p>
|
|
1002
895
|
|
|
1003
896
|
| Param | Type | Description |
|
|
1004
897
|
| --- | --- | --- |
|
|
1005
|
-
| song | [<code>Song</code>](#Song) | The song to be formatted |
|
|
898
|
+
| song | [<code>Song</code>](#Song) | <p>The song to be formatted</p> |
|
|
1006
899
|
|
|
1007
900
|
<a name="HtmlTableFormatter.cssString"></a>
|
|
1008
901
|
|
|
1009
902
|
### HtmlTableFormatter.cssString(scope) ⇒ <code>string</code>
|
|
1010
|
-
Generates basic CSS, optionally scoped within the provided selector, to use with output generated by
|
|
1011
|
-
[HtmlTableFormatter](#HtmlTableFormatter)
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
}
|
|
903
|
+
<p>Generates basic CSS, optionally scoped within the provided selector, to use with output generated by
|
|
904
|
+
[HtmlTableFormatter](#HtmlTableFormatter)</p>
|
|
905
|
+
<p>For example, execute cssString('.chordSheetViewer') will result in CSS like:</p>
|
|
906
|
+
<pre><code>.chordSheetViewer .paragraph {
|
|
907
|
+
margin-bottom: 1em;
|
|
908
|
+
}
|
|
909
|
+
</code></pre>
|
|
1018
910
|
|
|
1019
911
|
**Kind**: static method of [<code>HtmlTableFormatter</code>](#HtmlTableFormatter)
|
|
1020
|
-
**Returns**: <code>string</code> - the CSS string
|
|
912
|
+
**Returns**: <code>string</code> - <p>the CSS string</p>
|
|
1021
913
|
|
|
1022
914
|
| Param | Description |
|
|
1023
915
|
| --- | --- |
|
|
1024
|
-
| scope | the CSS scope to use, for example
|
|
916
|
+
| scope | <p>the CSS scope to use, for example <code>.chordSheetViewer</code></p> |
|
|
1025
917
|
|
|
1026
918
|
<a name="HtmlTableFormatter.cssObject"></a>
|
|
1027
919
|
|
|
1028
920
|
### HtmlTableFormatter.cssObject() ⇒ <code>Object.<string, Object.<string, string>></code>
|
|
1029
|
-
Basic CSS, in object style à la useStyles, to use with output generated by [HtmlTableFormatter](#HtmlTableFormatter)
|
|
1030
|
-
For a CSS string see [cssString](cssString)
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
}
|
|
921
|
+
<p>Basic CSS, in object style à la useStyles, to use with output generated by [HtmlTableFormatter](#HtmlTableFormatter)
|
|
922
|
+
For a CSS string see [cssString](cssString)</p>
|
|
923
|
+
<p>Example:</p>
|
|
924
|
+
<pre><code>'.paragraph': {
|
|
925
|
+
marginBottom: '1em'
|
|
926
|
+
}
|
|
927
|
+
</code></pre>
|
|
1037
928
|
|
|
1038
929
|
**Kind**: static method of [<code>HtmlTableFormatter</code>](#HtmlTableFormatter)
|
|
1039
|
-
**Returns**: <code>Object.<string, Object.<string, string>></code> - the CSS object
|
|
930
|
+
**Returns**: <code>Object.<string, Object.<string, string>></code> - <p>the CSS object</p>
|
|
1040
931
|
<a name="TextFormatter"></a>
|
|
1041
932
|
|
|
1042
933
|
## TextFormatter
|
|
1043
|
-
Formats a song into a plain text chord sheet
|
|
934
|
+
<p>Formats a song into a plain text chord sheet</p>
|
|
1044
935
|
|
|
1045
936
|
**Kind**: global class
|
|
1046
937
|
<a name="TextFormatter+format"></a>
|
|
1047
938
|
|
|
1048
939
|
### textFormatter.format(song) ⇒ <code>string</code>
|
|
1049
|
-
Formats a song into a plain text chord sheet
|
|
940
|
+
<p>Formats a song into a plain text chord sheet</p>
|
|
1050
941
|
|
|
1051
942
|
**Kind**: instance method of [<code>TextFormatter</code>](#TextFormatter)
|
|
1052
|
-
**Returns**: <code>string</code> - the chord sheet
|
|
943
|
+
**Returns**: <code>string</code> - <p>the chord sheet</p>
|
|
1053
944
|
|
|
1054
945
|
| Param | Type | Description |
|
|
1055
946
|
| --- | --- | --- |
|
|
1056
|
-
| song | [<code>Song</code>](#Song) | The song to be formatted |
|
|
947
|
+
| song | [<code>Song</code>](#Song) | <p>The song to be formatted</p> |
|
|
1057
948
|
|
|
1058
949
|
<a name="ChordProParser"></a>
|
|
1059
950
|
|
|
1060
951
|
## ChordProParser
|
|
1061
|
-
Parses a ChordPro chord sheet
|
|
952
|
+
<p>Parses a ChordPro chord sheet</p>
|
|
1062
953
|
|
|
1063
954
|
**Kind**: global class
|
|
1064
955
|
|
|
@@ -1069,120 +960,95 @@ Parses a ChordPro chord sheet
|
|
|
1069
960
|
<a name="ChordProParser+warnings"></a>
|
|
1070
961
|
|
|
1071
962
|
### chordProParser.warnings : [<code>Array.<ParserWarning></code>](#ParserWarning)
|
|
1072
|
-
All warnings raised during parsing the ChordPro chord sheet
|
|
963
|
+
<p>All warnings raised during parsing the ChordPro chord sheet</p>
|
|
1073
964
|
|
|
1074
965
|
**Kind**: instance property of [<code>ChordProParser</code>](#ChordProParser)
|
|
1075
966
|
<a name="ChordProParser+parse"></a>
|
|
1076
967
|
|
|
1077
968
|
### chordProParser.parse(chordProChordSheet) ⇒ [<code>Song</code>](#Song)
|
|
1078
|
-
Parses a ChordPro chord sheet into a song
|
|
969
|
+
<p>Parses a ChordPro chord sheet into a song</p>
|
|
1079
970
|
|
|
1080
971
|
**Kind**: instance method of [<code>ChordProParser</code>](#ChordProParser)
|
|
1081
|
-
**Returns**: [<code>Song</code>](#Song) - The parsed song
|
|
972
|
+
**Returns**: [<code>Song</code>](#Song) - <p>The parsed song</p>
|
|
1082
973
|
|
|
1083
974
|
| Param | Type | Description |
|
|
1084
975
|
| --- | --- | --- |
|
|
1085
|
-
| chordProChordSheet | <code>string</code> | the ChordPro chord sheet |
|
|
976
|
+
| chordProChordSheet | <code>string</code> | <p>the ChordPro chord sheet</p> |
|
|
1086
977
|
|
|
1087
978
|
<a name="ChordSheetParser"></a>
|
|
1088
979
|
|
|
1089
980
|
## ChordSheetParser
|
|
1090
|
-
Parses a normal chord sheet
|
|
981
|
+
<p>Parses a normal chord sheet</p>
|
|
1091
982
|
|
|
1092
983
|
**Kind**: global class
|
|
1093
984
|
|
|
1094
985
|
* [ChordSheetParser](#ChordSheetParser)
|
|
1095
|
-
* [new ChordSheetParser(options)](#new_ChordSheetParser_new)
|
|
1096
|
-
* [.parse(chordSheet, options)](#ChordSheetParser+parse) ⇒ [<code>Song</code>](#Song)
|
|
986
|
+
* [new ChordSheetParser([options])](#new_ChordSheetParser_new)
|
|
987
|
+
* [.parse(chordSheet, [options])](#ChordSheetParser+parse) ⇒ [<code>Song</code>](#Song)
|
|
1097
988
|
|
|
1098
989
|
<a name="new_ChordSheetParser_new"></a>
|
|
1099
990
|
|
|
1100
|
-
### new ChordSheetParser(options)
|
|
1101
|
-
Instantiate a chord sheet parser
|
|
991
|
+
### new ChordSheetParser([options])
|
|
992
|
+
<p>Instantiate a chord sheet parser</p>
|
|
1102
993
|
|
|
1103
994
|
|
|
1104
|
-
| Param | Type | Description |
|
|
1105
|
-
| --- | --- | --- |
|
|
1106
|
-
| options | <code>Object</code> | options |
|
|
1107
|
-
| options.preserveWhitespace | <code>boolean</code> | whether to preserve trailing whitespace for chords |
|
|
995
|
+
| Param | Type | Default | Description |
|
|
996
|
+
| --- | --- | --- | --- |
|
|
997
|
+
| [options] | <code>Object</code> | <code>{}</code> | <p>options</p> |
|
|
998
|
+
| [options.preserveWhitespace] | <code>boolean</code> | <code>true</code> | <p>whether to preserve trailing whitespace for chords</p> |
|
|
1108
999
|
|
|
1109
1000
|
<a name="ChordSheetParser+parse"></a>
|
|
1110
1001
|
|
|
1111
|
-
### chordSheetParser.parse(chordSheet, options) ⇒ [<code>Song</code>](#Song)
|
|
1112
|
-
Parses a chord sheet into a song
|
|
1002
|
+
### chordSheetParser.parse(chordSheet, [options]) ⇒ [<code>Song</code>](#Song)
|
|
1003
|
+
<p>Parses a chord sheet into a song</p>
|
|
1113
1004
|
|
|
1114
1005
|
**Kind**: instance method of [<code>ChordSheetParser</code>](#ChordSheetParser)
|
|
1115
|
-
**Returns**: [<code>Song</code>](#Song) - The parsed song
|
|
1006
|
+
**Returns**: [<code>Song</code>](#Song) - <p>The parsed song</p>
|
|
1116
1007
|
|
|
1117
|
-
| Param | Type | Description |
|
|
1118
|
-
| --- | --- | --- |
|
|
1119
|
-
| chordSheet | <code>string</code> | The ChordPro chord sheet |
|
|
1120
|
-
| options | <code>Object</code> | Optional parser options |
|
|
1121
|
-
| options.song | [<code>Song</code>](#Song) | The [Song](#Song) to store the song data in |
|
|
1008
|
+
| Param | Type | Default | Description |
|
|
1009
|
+
| --- | --- | --- | --- |
|
|
1010
|
+
| chordSheet | <code>string</code> | | <p>The ChordPro chord sheet</p> |
|
|
1011
|
+
| [options] | <code>Object</code> | <code>{}</code> | <p>Optional parser options</p> |
|
|
1012
|
+
| [options.song] | [<code>Song</code>](#Song) | <code></code> | <p>The [Song](#Song) to store the song data in</p> |
|
|
1122
1013
|
|
|
1123
1014
|
<a name="ParserWarning"></a>
|
|
1124
1015
|
|
|
1125
1016
|
## ParserWarning
|
|
1126
|
-
Represents a parser warning, currently only used by ChordProParser
|
|
1017
|
+
<p>Represents a parser warning, currently only used by ChordProParser.</p>
|
|
1127
1018
|
|
|
1128
1019
|
**Kind**: global class
|
|
1129
|
-
|
|
1130
|
-
* [ParserWarning](#ParserWarning)
|
|
1131
|
-
* [.message](#ParserWarning+message) : <code>string</code>
|
|
1132
|
-
* [.lineNumber](#ParserWarning+lineNumber) : <code>number</code>
|
|
1133
|
-
* [.column](#ParserWarning+column) : <code>number</code>
|
|
1134
|
-
* [.toString()](#ParserWarning+toString) ⇒ <code>string</code>
|
|
1135
|
-
|
|
1136
|
-
<a name="ParserWarning+message"></a>
|
|
1137
|
-
|
|
1138
|
-
### parserWarning.message : <code>string</code>
|
|
1139
|
-
The warning message
|
|
1140
|
-
|
|
1141
|
-
**Kind**: instance property of [<code>ParserWarning</code>](#ParserWarning)
|
|
1142
|
-
<a name="ParserWarning+lineNumber"></a>
|
|
1143
|
-
|
|
1144
|
-
### parserWarning.lineNumber : <code>number</code>
|
|
1145
|
-
The chord sheet line number on which the warning occurred
|
|
1146
|
-
|
|
1147
|
-
**Kind**: instance property of [<code>ParserWarning</code>](#ParserWarning)
|
|
1148
|
-
<a name="ParserWarning+column"></a>
|
|
1149
|
-
|
|
1150
|
-
### parserWarning.column : <code>number</code>
|
|
1151
|
-
The chord sheet column on which the warning occurred
|
|
1152
|
-
|
|
1153
|
-
**Kind**: instance property of [<code>ParserWarning</code>](#ParserWarning)
|
|
1154
1020
|
<a name="ParserWarning+toString"></a>
|
|
1155
1021
|
|
|
1156
1022
|
### parserWarning.toString() ⇒ <code>string</code>
|
|
1157
|
-
Returns a stringified version of the warning
|
|
1023
|
+
<p>Returns a stringified version of the warning</p>
|
|
1158
1024
|
|
|
1159
1025
|
**Kind**: instance method of [<code>ParserWarning</code>](#ParserWarning)
|
|
1160
|
-
**Returns**: <code>string</code> - The string warning
|
|
1026
|
+
**Returns**: <code>string</code> - <p>The string warning</p>
|
|
1161
1027
|
<a name="UltimateGuitarParser"></a>
|
|
1162
1028
|
|
|
1163
1029
|
## UltimateGuitarParser
|
|
1164
|
-
Parses an Ultimate Guitar chord sheet with metadata
|
|
1165
|
-
Inherits from [ChordSheetParser](#ChordSheetParser)
|
|
1030
|
+
<p>Parses an Ultimate Guitar chord sheet with metadata
|
|
1031
|
+
Inherits from [ChordSheetParser](#ChordSheetParser)</p>
|
|
1166
1032
|
|
|
1167
1033
|
**Kind**: global class
|
|
1168
1034
|
<a name="Chord"></a>
|
|
1169
1035
|
|
|
1170
1036
|
## Chord
|
|
1171
|
-
Represents a Chord, consisting of a root, suffix (quality) and bass
|
|
1037
|
+
<p>Represents a Chord, consisting of a root, suffix (quality) and bass</p>
|
|
1172
1038
|
|
|
1173
1039
|
**Kind**: global class
|
|
1174
1040
|
|
|
1175
1041
|
* [Chord](#Chord)
|
|
1176
1042
|
* _instance_
|
|
1177
1043
|
* [.clone()](#Chord+clone) ⇒ [<code>Chord</code>](#Chord)
|
|
1178
|
-
* [.toChordSymbol(key)](#Chord+toChordSymbol) ⇒ [<code>Chord</code>](#Chord)
|
|
1179
|
-
* [.toChordSymbolString(key)](#Chord+toChordSymbolString) ⇒ <code>string</code>
|
|
1044
|
+
* [.toChordSymbol([key])](#Chord+toChordSymbol) ⇒ [<code>Chord</code>](#Chord)
|
|
1045
|
+
* [.toChordSymbolString([key])](#Chord+toChordSymbolString) ⇒ <code>string</code>
|
|
1180
1046
|
* [.isChordSymbol()](#Chord+isChordSymbol) ⇒ <code>boolean</code>
|
|
1181
|
-
* [.toNumeric(key)](#Chord+toNumeric) ⇒ [<code>Chord</code>](#Chord)
|
|
1047
|
+
* [.toNumeric([key])](#Chord+toNumeric) ⇒ [<code>Chord</code>](#Chord)
|
|
1182
1048
|
* [.toNumeral(key)](#Chord+toNumeral) ⇒ [<code>Chord</code>](#Chord)
|
|
1183
|
-
* [.toNumeralString(key)](#Chord+toNumeralString) ⇒ <code>string</code>
|
|
1049
|
+
* [.toNumeralString([key])](#Chord+toNumeralString) ⇒ <code>string</code>
|
|
1184
1050
|
* [.isNumeric()](#Chord+isNumeric) ⇒ <code>boolean</code>
|
|
1185
|
-
* [.toNumericString(key)](#Chord+toNumericString) ⇒ <code>string</code>
|
|
1051
|
+
* [.toNumericString([key])](#Chord+toNumericString) ⇒ <code>string</code>
|
|
1186
1052
|
* [.isNumeral()](#Chord+isNumeral) ⇒ <code>boolean</code>
|
|
1187
1053
|
* [.toString()](#Chord+toString) ⇒ <code>string</code>
|
|
1188
1054
|
* [.normalize()](#Chord+normalize) ⇒ [<code>Chord</code>](#Chord)
|
|
@@ -1196,188 +1062,189 @@ Represents a Chord, consisting of a root, suffix (quality) and bass
|
|
|
1196
1062
|
<a name="Chord+clone"></a>
|
|
1197
1063
|
|
|
1198
1064
|
### chord.clone() ⇒ [<code>Chord</code>](#Chord)
|
|
1199
|
-
Returns a deep copy of the chord
|
|
1065
|
+
<p>Returns a deep copy of the chord</p>
|
|
1200
1066
|
|
|
1201
1067
|
**Kind**: instance method of [<code>Chord</code>](#Chord)
|
|
1202
1068
|
<a name="Chord+toChordSymbol"></a>
|
|
1203
1069
|
|
|
1204
|
-
### chord.toChordSymbol(key) ⇒ [<code>Chord</code>](#Chord)
|
|
1205
|
-
Converts the chord to a chord symbol, using the supplied key as a reference.
|
|
1206
|
-
For example, a numeric chord
|
|
1207
|
-
When the chord is already a chord symbol, it will return a clone of the object
|
|
1070
|
+
### chord.toChordSymbol([key]) ⇒ [<code>Chord</code>](#Chord)
|
|
1071
|
+
<p>Converts the chord to a chord symbol, using the supplied key as a reference.
|
|
1072
|
+
For example, a numeric chord <code>#4</code> with reference key <code>E</code> will return the chord symbol <code>A#</code>.
|
|
1073
|
+
When the chord is already a chord symbol, it will return a clone of the object.</p>
|
|
1208
1074
|
|
|
1209
1075
|
**Kind**: instance method of [<code>Chord</code>](#Chord)
|
|
1210
|
-
**Returns**: [<code>Chord</code>](#Chord) - the chord symbol
|
|
1076
|
+
**Returns**: [<code>Chord</code>](#Chord) - <p>the chord symbol</p>
|
|
1211
1077
|
|
|
1212
|
-
| Param | Type | Description |
|
|
1213
|
-
| --- | --- | --- |
|
|
1214
|
-
| key | <code>Key</code> \| <code>string</code> | the reference key |
|
|
1078
|
+
| Param | Type | Default | Description |
|
|
1079
|
+
| --- | --- | --- | --- |
|
|
1080
|
+
| [key] | <code>Key</code> \| <code>string</code> | <code></code> | <p>the reference key</p> |
|
|
1215
1081
|
|
|
1216
1082
|
<a name="Chord+toChordSymbolString"></a>
|
|
1217
1083
|
|
|
1218
|
-
### chord.toChordSymbolString(key) ⇒ <code>string</code>
|
|
1219
|
-
Converts the chord to a chord symbol string, using the supplied key as a reference.
|
|
1220
|
-
For example, a numeric chord
|
|
1221
|
-
When the chord is already a chord symbol, it will return a string version of the chord
|
|
1084
|
+
### chord.toChordSymbolString([key]) ⇒ <code>string</code>
|
|
1085
|
+
<p>Converts the chord to a chord symbol string, using the supplied key as a reference.
|
|
1086
|
+
For example, a numeric chord <code>#4</code> with reference key <code>E</code> will return the chord symbol <code>A#</code>.
|
|
1087
|
+
When the chord is already a chord symbol, it will return a string version of the chord.</p>
|
|
1222
1088
|
|
|
1223
1089
|
**Kind**: instance method of [<code>Chord</code>](#Chord)
|
|
1224
|
-
**Returns**: <code>string</code> - the chord symbol string
|
|
1090
|
+
**Returns**: <code>string</code> - <p>the chord symbol string</p>
|
|
1225
1091
|
**See**: {toChordSymbol}
|
|
1226
1092
|
|
|
1227
|
-
| Param | Type | Description |
|
|
1228
|
-
| --- | --- | --- |
|
|
1229
|
-
| key | <code>Key</code> \| <code>string</code> | the reference key |
|
|
1093
|
+
| Param | Type | Default | Description |
|
|
1094
|
+
| --- | --- | --- | --- |
|
|
1095
|
+
| [key] | <code>Key</code> \| <code>string</code> | <code></code> | <p>the reference key</p> |
|
|
1230
1096
|
|
|
1231
1097
|
<a name="Chord+isChordSymbol"></a>
|
|
1232
1098
|
|
|
1233
1099
|
### chord.isChordSymbol() ⇒ <code>boolean</code>
|
|
1234
|
-
Determines whether the chord is a chord symbol
|
|
1100
|
+
<p>Determines whether the chord is a chord symbol</p>
|
|
1235
1101
|
|
|
1236
1102
|
**Kind**: instance method of [<code>Chord</code>](#Chord)
|
|
1237
1103
|
<a name="Chord+toNumeric"></a>
|
|
1238
1104
|
|
|
1239
|
-
### chord.toNumeric(key) ⇒ [<code>Chord</code>](#Chord)
|
|
1240
|
-
Converts the chord to a numeric chord, using the supplied key as a reference.
|
|
1241
|
-
For example, a chord symbol A# with reference key E will return the numeric chord #4
|
|
1105
|
+
### chord.toNumeric([key]) ⇒ [<code>Chord</code>](#Chord)
|
|
1106
|
+
<p>Converts the chord to a numeric chord, using the supplied key as a reference.
|
|
1107
|
+
For example, a chord symbol A# with reference key E will return the numeric chord #4.</p>
|
|
1242
1108
|
|
|
1243
1109
|
**Kind**: instance method of [<code>Chord</code>](#Chord)
|
|
1244
|
-
**Returns**: [<code>Chord</code>](#Chord) - the numeric chord
|
|
1110
|
+
**Returns**: [<code>Chord</code>](#Chord) - <p>the numeric chord</p>
|
|
1245
1111
|
|
|
1246
|
-
| Param | Type | Description |
|
|
1247
|
-
| --- | --- | --- |
|
|
1248
|
-
| key | <code>Key</code> \| <code>string</code> | the reference key |
|
|
1112
|
+
| Param | Type | Default | Description |
|
|
1113
|
+
| --- | --- | --- | --- |
|
|
1114
|
+
| [key] | <code>Key</code> \| <code>string</code> | <code></code> | <p>the reference key</p> |
|
|
1249
1115
|
|
|
1250
1116
|
<a name="Chord+toNumeral"></a>
|
|
1251
1117
|
|
|
1252
1118
|
### chord.toNumeral(key) ⇒ [<code>Chord</code>](#Chord)
|
|
1253
|
-
Converts the chord to a numeral chord, using the supplied key as a reference.
|
|
1254
|
-
For example, a chord symbol A# with reference key E will return the numeral chord #IV
|
|
1119
|
+
<p>Converts the chord to a numeral chord, using the supplied key as a reference.
|
|
1120
|
+
For example, a chord symbol A# with reference key E will return the numeral chord #IV.</p>
|
|
1255
1121
|
|
|
1256
1122
|
**Kind**: instance method of [<code>Chord</code>](#Chord)
|
|
1257
|
-
**Returns**: [<code>Chord</code>](#Chord) - the numeral chord
|
|
1123
|
+
**Returns**: [<code>Chord</code>](#Chord) - <p>the numeral chord</p>
|
|
1258
1124
|
|
|
1259
1125
|
| Param | Type | Default | Description |
|
|
1260
1126
|
| --- | --- | --- | --- |
|
|
1261
|
-
| key | <code>Key</code> \| <code>string</code> \| <code>null</code> | <code></code> | the reference key. The key is required when converting a chord symbol |
|
|
1127
|
+
| key | <code>Key</code> \| <code>string</code> \| <code>null</code> | <code></code> | <p>the reference key. The key is required when converting a chord symbol</p> |
|
|
1262
1128
|
|
|
1263
1129
|
<a name="Chord+toNumeralString"></a>
|
|
1264
1130
|
|
|
1265
|
-
### chord.toNumeralString(key) ⇒ <code>string</code>
|
|
1266
|
-
Converts the chord to a numeral chord string, using the supplied kye as a reference.
|
|
1267
|
-
For example, a chord symbol A# with reference key E will return the numeral chord #4
|
|
1131
|
+
### chord.toNumeralString([key]) ⇒ <code>string</code>
|
|
1132
|
+
<p>Converts the chord to a numeral chord string, using the supplied kye as a reference.
|
|
1133
|
+
For example, a chord symbol A# with reference key E will return the numeral chord #4.</p>
|
|
1268
1134
|
|
|
1269
1135
|
**Kind**: instance method of [<code>Chord</code>](#Chord)
|
|
1270
|
-
**Returns**: <code>string</code> - the numeral chord string
|
|
1136
|
+
**Returns**: <code>string</code> - <p>the numeral chord string</p>
|
|
1271
1137
|
**See**: {toNumeral}
|
|
1272
1138
|
|
|
1273
|
-
| Param | Type | Description |
|
|
1274
|
-
| --- | --- | --- |
|
|
1275
|
-
| key | <code>Key</code> \| <code>string</code> | the reference key |
|
|
1139
|
+
| Param | Type | Default | Description |
|
|
1140
|
+
| --- | --- | --- | --- |
|
|
1141
|
+
| [key] | <code>Key</code> \| <code>string</code> | <code></code> | <p>the reference key</p> |
|
|
1276
1142
|
|
|
1277
1143
|
<a name="Chord+isNumeric"></a>
|
|
1278
1144
|
|
|
1279
1145
|
### chord.isNumeric() ⇒ <code>boolean</code>
|
|
1280
|
-
Determines whether the chord is numeric
|
|
1146
|
+
<p>Determines whether the chord is numeric</p>
|
|
1281
1147
|
|
|
1282
1148
|
**Kind**: instance method of [<code>Chord</code>](#Chord)
|
|
1283
1149
|
<a name="Chord+toNumericString"></a>
|
|
1284
1150
|
|
|
1285
|
-
### chord.toNumericString(key) ⇒ <code>string</code>
|
|
1286
|
-
Converts the chord to a numeric chord string, using the supplied kye as a reference.
|
|
1287
|
-
For example, a chord symbol A# with reference key E will return the numeric chord #4
|
|
1151
|
+
### chord.toNumericString([key]) ⇒ <code>string</code>
|
|
1152
|
+
<p>Converts the chord to a numeric chord string, using the supplied kye as a reference.
|
|
1153
|
+
For example, a chord symbol A# with reference key E will return the numeric chord #4.</p>
|
|
1288
1154
|
|
|
1289
1155
|
**Kind**: instance method of [<code>Chord</code>](#Chord)
|
|
1290
|
-
**Returns**: <code>string</code> - the numeric chord string
|
|
1156
|
+
**Returns**: <code>string</code> - <p>the numeric chord string</p>
|
|
1291
1157
|
**See**: {toNumeric}
|
|
1292
1158
|
|
|
1293
|
-
| Param | Type | Description |
|
|
1294
|
-
| --- | --- | --- |
|
|
1295
|
-
| key | <code>Key</code> \| <code>string</code> | the reference key |
|
|
1159
|
+
| Param | Type | Default | Description |
|
|
1160
|
+
| --- | --- | --- | --- |
|
|
1161
|
+
| [key] | <code>Key</code> \| <code>string</code> | <code></code> | <p>the reference key</p> |
|
|
1296
1162
|
|
|
1297
1163
|
<a name="Chord+isNumeral"></a>
|
|
1298
1164
|
|
|
1299
1165
|
### chord.isNumeral() ⇒ <code>boolean</code>
|
|
1300
|
-
Determines whether the chord is a numeral
|
|
1166
|
+
<p>Determines whether the chord is a numeral</p>
|
|
1301
1167
|
|
|
1302
1168
|
**Kind**: instance method of [<code>Chord</code>](#Chord)
|
|
1303
1169
|
<a name="Chord+toString"></a>
|
|
1304
1170
|
|
|
1305
1171
|
### chord.toString() ⇒ <code>string</code>
|
|
1306
|
-
Converts the chord to a string, eg
|
|
1172
|
+
<p>Converts the chord to a string, eg <code>Esus4/G#</code> or <code>1sus4/#3</code></p>
|
|
1307
1173
|
|
|
1308
1174
|
**Kind**: instance method of [<code>Chord</code>](#Chord)
|
|
1309
|
-
**Returns**: <code>string</code> - the chord string
|
|
1175
|
+
**Returns**: <code>string</code> - <p>the chord string</p>
|
|
1310
1176
|
<a name="Chord+normalize"></a>
|
|
1311
1177
|
|
|
1312
1178
|
### chord.normalize() ⇒ [<code>Chord</code>](#Chord)
|
|
1313
|
-
Normalizes the chord root and bass notes
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1179
|
+
<p>Normalizes the chord root and bass notes:</p>
|
|
1180
|
+
<ul>
|
|
1181
|
+
<li>Fb becomes E</li>
|
|
1182
|
+
<li>Cb becomes B</li>
|
|
1183
|
+
<li>B# becomes C</li>
|
|
1184
|
+
<li>E# becomes F</li>
|
|
1185
|
+
<li>4b becomes 3</li>
|
|
1186
|
+
<li>1b becomes 7</li>
|
|
1187
|
+
<li>7# becomes 1</li>
|
|
1188
|
+
<li>3# becomes 4</li>
|
|
1189
|
+
</ul>
|
|
1190
|
+
<p>Besides that it normalizes the suffix. For example, <code>sus2</code> becomes <code>2</code>, <code>sus4</code> becomes <code>sus</code>.
|
|
1191
|
+
All suffix normalizations can be found in <code>src/normalize_mappings/suffix-mapping.txt</code>.</p>
|
|
1325
1192
|
|
|
1326
1193
|
**Kind**: instance method of [<code>Chord</code>](#Chord)
|
|
1327
|
-
**Returns**: [<code>Chord</code>](#Chord) - the normalized chord
|
|
1194
|
+
**Returns**: [<code>Chord</code>](#Chord) - <p>the normalized chord</p>
|
|
1328
1195
|
<a name="Chord+useModifier"></a>
|
|
1329
1196
|
|
|
1330
1197
|
### chord.useModifier(newModifier) ⇒ [<code>Chord</code>](#Chord)
|
|
1331
|
-
Switches to the specified modifier
|
|
1198
|
+
<p>Switches to the specified modifier</p>
|
|
1332
1199
|
|
|
1333
1200
|
**Kind**: instance method of [<code>Chord</code>](#Chord)
|
|
1334
|
-
**Returns**: [<code>Chord</code>](#Chord) - the new, changed chord
|
|
1201
|
+
**Returns**: [<code>Chord</code>](#Chord) - <p>the new, changed chord</p>
|
|
1335
1202
|
|
|
1336
1203
|
| Param | Description |
|
|
1337
1204
|
| --- | --- |
|
|
1338
|
-
| newModifier | the modifier to use:
|
|
1205
|
+
| newModifier | <p>the modifier to use: <code>'#'</code> or <code>'b'</code></p> |
|
|
1339
1206
|
|
|
1340
1207
|
<a name="Chord+transposeUp"></a>
|
|
1341
1208
|
|
|
1342
1209
|
### chord.transposeUp() ⇒ [<code>Chord</code>](#Chord)
|
|
1343
|
-
Transposes the chord up by 1 semitone. Eg. A becomes A#, Eb becomes E
|
|
1210
|
+
<p>Transposes the chord up by 1 semitone. Eg. A becomes A#, Eb becomes E</p>
|
|
1344
1211
|
|
|
1345
1212
|
**Kind**: instance method of [<code>Chord</code>](#Chord)
|
|
1346
|
-
**Returns**: [<code>Chord</code>](#Chord) - the new, transposed chord
|
|
1213
|
+
**Returns**: [<code>Chord</code>](#Chord) - <p>the new, transposed chord</p>
|
|
1347
1214
|
<a name="Chord+transposeDown"></a>
|
|
1348
1215
|
|
|
1349
1216
|
### chord.transposeDown() ⇒ [<code>Chord</code>](#Chord)
|
|
1350
|
-
Transposes the chord down by 1 semitone. Eg. A# becomes A, E becomes Eb
|
|
1217
|
+
<p>Transposes the chord down by 1 semitone. Eg. A# becomes A, E becomes Eb</p>
|
|
1351
1218
|
|
|
1352
1219
|
**Kind**: instance method of [<code>Chord</code>](#Chord)
|
|
1353
|
-
**Returns**: [<code>Chord</code>](#Chord) - the new, transposed chord
|
|
1220
|
+
**Returns**: [<code>Chord</code>](#Chord) - <p>the new, transposed chord</p>
|
|
1354
1221
|
<a name="Chord+transpose"></a>
|
|
1355
1222
|
|
|
1356
1223
|
### chord.transpose(delta) ⇒ [<code>Chord</code>](#Chord)
|
|
1357
|
-
Transposes the chord by the specified number of semitones
|
|
1224
|
+
<p>Transposes the chord by the specified number of semitones</p>
|
|
1358
1225
|
|
|
1359
1226
|
**Kind**: instance method of [<code>Chord</code>](#Chord)
|
|
1360
|
-
**Returns**: [<code>Chord</code>](#Chord) - the new, transposed chord
|
|
1227
|
+
**Returns**: [<code>Chord</code>](#Chord) - <p>the new, transposed chord</p>
|
|
1361
1228
|
|
|
1362
1229
|
| Param | Description |
|
|
1363
1230
|
| --- | --- |
|
|
1364
|
-
| delta | de number of semitones |
|
|
1231
|
+
| delta | <p>de number of semitones</p> |
|
|
1365
1232
|
|
|
1366
1233
|
<a name="Chord.parse"></a>
|
|
1367
1234
|
|
|
1368
1235
|
### Chord.parse(chordString) ⇒ <code>null</code> \| [<code>Chord</code>](#Chord)
|
|
1369
|
-
Tries to parse a chord string into a chord
|
|
1236
|
+
<p>Tries to parse a chord string into a chord</p>
|
|
1370
1237
|
|
|
1371
1238
|
**Kind**: static method of [<code>Chord</code>](#Chord)
|
|
1372
1239
|
|
|
1373
1240
|
| Param | Description |
|
|
1374
1241
|
| --- | --- |
|
|
1375
|
-
| chordString | the chord string, eg
|
|
1242
|
+
| chordString | <p>the chord string, eg <code>Esus4/G#</code> or <code>1sus4/#3</code></p> |
|
|
1376
1243
|
|
|
1377
1244
|
<a name="ChordSheetSerializer"></a>
|
|
1378
1245
|
|
|
1379
1246
|
## ChordSheetSerializer
|
|
1380
|
-
Serializes a song into een plain object, and deserializes the serialized object back into a [Song](#Song)
|
|
1247
|
+
<p>Serializes a song into een plain object, and deserializes the serialized object back into a [Song](#Song)</p>
|
|
1381
1248
|
|
|
1382
1249
|
**Kind**: global class
|
|
1383
1250
|
|
|
@@ -1388,214 +1255,239 @@ Serializes a song into een plain object, and deserializes the serialized object
|
|
|
1388
1255
|
<a name="ChordSheetSerializer+serialize"></a>
|
|
1389
1256
|
|
|
1390
1257
|
### chordSheetSerializer.serialize() ⇒
|
|
1391
|
-
Serializes the chord sheet to a plain object, which can be converted to any format like JSON, XML etc
|
|
1392
|
-
Can be deserialized using [deserialize](deserialize)
|
|
1258
|
+
<p>Serializes the chord sheet to a plain object, which can be converted to any format like JSON, XML etc
|
|
1259
|
+
Can be deserialized using [deserialize](deserialize)</p>
|
|
1393
1260
|
|
|
1394
1261
|
**Kind**: instance method of [<code>ChordSheetSerializer</code>](#ChordSheetSerializer)
|
|
1395
|
-
**Returns**: object A plain JS object containing all chord sheet data
|
|
1262
|
+
**Returns**: <p>object A plain JS object containing all chord sheet data</p>
|
|
1396
1263
|
<a name="ChordSheetSerializer+deserialize"></a>
|
|
1397
1264
|
|
|
1398
1265
|
### chordSheetSerializer.deserialize(serializedSong) ⇒ [<code>Song</code>](#Song)
|
|
1399
|
-
Deserializes a song that has been serialized using [serialize](serialize)
|
|
1266
|
+
<p>Deserializes a song that has been serialized using [serialize](serialize)</p>
|
|
1400
1267
|
|
|
1401
1268
|
**Kind**: instance method of [<code>ChordSheetSerializer</code>](#ChordSheetSerializer)
|
|
1402
|
-
**Returns**: [<code>Song</code>](#Song) - The deserialized song
|
|
1269
|
+
**Returns**: [<code>Song</code>](#Song) - <p>The deserialized song</p>
|
|
1403
1270
|
|
|
1404
1271
|
| Param | Type | Description |
|
|
1405
1272
|
| --- | --- | --- |
|
|
1406
|
-
| serializedSong | <code>object</code> | The serialized song |
|
|
1273
|
+
| serializedSong | <code>object</code> | <p>The serialized song</p> |
|
|
1407
1274
|
|
|
1408
1275
|
<a name="ALBUM"></a>
|
|
1409
1276
|
|
|
1410
1277
|
## ALBUM : <code>string</code>
|
|
1411
|
-
|
|
1278
|
+
<p>Artist meta directive. See https://www.chordpro.org/chordpro/directives-artist/</p>
|
|
1412
1279
|
|
|
1413
|
-
**Kind**: global
|
|
1280
|
+
**Kind**: global variable
|
|
1414
1281
|
<a name="ARTIST"></a>
|
|
1415
1282
|
|
|
1416
1283
|
## ARTIST : <code>string</code>
|
|
1417
|
-
|
|
1284
|
+
<p>Capo meta directive. See https://www.chordpro.org/chordpro/directives-capo/</p>
|
|
1418
1285
|
|
|
1419
|
-
**Kind**: global
|
|
1286
|
+
**Kind**: global variable
|
|
1420
1287
|
<a name="CAPO"></a>
|
|
1421
1288
|
|
|
1422
1289
|
## CAPO : <code>string</code>
|
|
1423
|
-
|
|
1290
|
+
<p>Comment directive. See https://www.chordpro.org/chordpro/directives-comment/</p>
|
|
1424
1291
|
|
|
1425
|
-
**Kind**: global
|
|
1292
|
+
**Kind**: global variable
|
|
1426
1293
|
<a name="COMMENT"></a>
|
|
1427
1294
|
|
|
1428
1295
|
## COMMENT : <code>string</code>
|
|
1429
|
-
|
|
1296
|
+
<p>Composer meta directive. See https://www.chordpro.org/chordpro/directives-composer/</p>
|
|
1430
1297
|
|
|
1431
|
-
**Kind**: global
|
|
1298
|
+
**Kind**: global variable
|
|
1432
1299
|
<a name="COMPOSER"></a>
|
|
1433
1300
|
|
|
1434
1301
|
## COMPOSER : <code>string</code>
|
|
1435
|
-
|
|
1302
|
+
<p>Copyright meta directive. See https://www.chordpro.org/chordpro/directives-copyright/</p>
|
|
1436
1303
|
|
|
1437
|
-
**Kind**: global
|
|
1304
|
+
**Kind**: global variable
|
|
1438
1305
|
<a name="COPYRIGHT"></a>
|
|
1439
1306
|
|
|
1440
1307
|
## COPYRIGHT : <code>string</code>
|
|
1441
|
-
|
|
1308
|
+
<p>Duration meta directive. See https://www.chordpro.org/chordpro/directives-duration/</p>
|
|
1442
1309
|
|
|
1443
|
-
**Kind**: global
|
|
1310
|
+
**Kind**: global variable
|
|
1444
1311
|
<a name="DURATION"></a>
|
|
1445
1312
|
|
|
1446
1313
|
## DURATION : <code>string</code>
|
|
1447
|
-
|
|
1314
|
+
<p>End of chorus directive. See https://www.chordpro.org/chordpro/directives-env_chorus/</p>
|
|
1448
1315
|
|
|
1449
|
-
**Kind**: global
|
|
1316
|
+
**Kind**: global variable
|
|
1450
1317
|
<a name="END_OF_CHORUS"></a>
|
|
1451
1318
|
|
|
1452
1319
|
## END\_OF\_CHORUS : <code>string</code>
|
|
1453
|
-
End of
|
|
1320
|
+
<p>End of tab directive. See https://www.chordpro.org/chordpro/directives-env_tab/</p>
|
|
1454
1321
|
|
|
1455
|
-
**Kind**: global
|
|
1322
|
+
**Kind**: global variable
|
|
1456
1323
|
<a name="END_OF_TAB"></a>
|
|
1457
1324
|
|
|
1458
1325
|
## END\_OF\_TAB : <code>string</code>
|
|
1459
|
-
End of
|
|
1326
|
+
<p>End of verse directive. See https://www.chordpro.org/chordpro/directives-env_verse/</p>
|
|
1460
1327
|
|
|
1461
|
-
**Kind**: global
|
|
1328
|
+
**Kind**: global variable
|
|
1462
1329
|
<a name="END_OF_VERSE"></a>
|
|
1463
1330
|
|
|
1464
1331
|
## END\_OF\_VERSE : <code>string</code>
|
|
1465
|
-
|
|
1332
|
+
<p>Key meta directive. See https://www.chordpro.org/chordpro/directives-key/</p>
|
|
1466
1333
|
|
|
1467
|
-
**Kind**: global
|
|
1334
|
+
**Kind**: global variable
|
|
1468
1335
|
<a name="KEY"></a>
|
|
1469
1336
|
|
|
1470
1337
|
## KEY : <code>string</code>
|
|
1471
|
-
Key meta directive. See https://www.chordpro.org/chordpro/directives-key
|
|
1338
|
+
<p>Key meta directive. See https://www.chordpro.org/chordpro/directives-key/</p>
|
|
1472
1339
|
|
|
1473
|
-
**Kind**: global
|
|
1340
|
+
**Kind**: global variable
|
|
1474
1341
|
<a name="_KEY"></a>
|
|
1475
1342
|
|
|
1476
1343
|
## \_KEY : <code>string</code>
|
|
1477
|
-
|
|
1344
|
+
<p>Lyricist meta directive. See https://www.chordpro.org/chordpro/directives-lyricist/</p>
|
|
1478
1345
|
|
|
1479
|
-
**Kind**: global
|
|
1346
|
+
**Kind**: global variable
|
|
1480
1347
|
<a name="LYRICIST"></a>
|
|
1481
1348
|
|
|
1482
1349
|
## LYRICIST : <code>string</code>
|
|
1483
|
-
|
|
1350
|
+
<p>Start of chorus directive. See https://www.chordpro.org/chordpro/directives-env_chorus/</p>
|
|
1484
1351
|
|
|
1485
|
-
**Kind**: global
|
|
1352
|
+
**Kind**: global variable
|
|
1486
1353
|
<a name="START_OF_CHORUS"></a>
|
|
1487
1354
|
|
|
1488
1355
|
## START\_OF\_CHORUS : <code>string</code>
|
|
1489
|
-
Start of
|
|
1356
|
+
<p>Start of tab directive. See https://www.chordpro.org/chordpro/directives-env_tab/</p>
|
|
1490
1357
|
|
|
1491
|
-
**Kind**: global
|
|
1358
|
+
**Kind**: global variable
|
|
1492
1359
|
<a name="START_OF_TAB"></a>
|
|
1493
1360
|
|
|
1494
1361
|
## START\_OF\_TAB : <code>string</code>
|
|
1495
|
-
Start of
|
|
1362
|
+
<p>Start of verse directive. See https://www.chordpro.org/chordpro/directives-env_verse/</p>
|
|
1496
1363
|
|
|
1497
|
-
**Kind**: global
|
|
1364
|
+
**Kind**: global variable
|
|
1498
1365
|
<a name="START_OF_VERSE"></a>
|
|
1499
1366
|
|
|
1500
1367
|
## START\_OF\_VERSE : <code>string</code>
|
|
1501
|
-
|
|
1368
|
+
<p>Subtitle meta directive. See https://www.chordpro.org/chordpro/directives-subtitle/</p>
|
|
1502
1369
|
|
|
1503
|
-
**Kind**: global
|
|
1370
|
+
**Kind**: global variable
|
|
1504
1371
|
<a name="SUBTITLE"></a>
|
|
1505
1372
|
|
|
1506
1373
|
## SUBTITLE : <code>string</code>
|
|
1507
|
-
|
|
1374
|
+
<p>Tempo meta directive. See https://www.chordpro.org/chordpro/directives-tempo/</p>
|
|
1508
1375
|
|
|
1509
|
-
**Kind**: global
|
|
1376
|
+
**Kind**: global variable
|
|
1510
1377
|
<a name="TEMPO"></a>
|
|
1511
1378
|
|
|
1512
1379
|
## TEMPO : <code>string</code>
|
|
1513
|
-
|
|
1380
|
+
<p>Time meta directive. See https://www.chordpro.org/chordpro/directives-time/</p>
|
|
1514
1381
|
|
|
1515
|
-
**Kind**: global
|
|
1382
|
+
**Kind**: global variable
|
|
1516
1383
|
<a name="TIME"></a>
|
|
1517
1384
|
|
|
1518
1385
|
## TIME : <code>string</code>
|
|
1519
|
-
|
|
1386
|
+
<p>Title meta directive. See https://www.chordpro.org/chordpro/directives-title/</p>
|
|
1520
1387
|
|
|
1521
|
-
**Kind**: global
|
|
1388
|
+
**Kind**: global variable
|
|
1522
1389
|
<a name="TITLE"></a>
|
|
1523
1390
|
|
|
1524
1391
|
## TITLE : <code>string</code>
|
|
1525
|
-
|
|
1392
|
+
<p>Transpose meta directive. See: https://www.chordpro.org/chordpro/directives-transpose/</p>
|
|
1526
1393
|
|
|
1527
|
-
**Kind**: global
|
|
1394
|
+
**Kind**: global variable
|
|
1528
1395
|
<a name="TRANSPOSE"></a>
|
|
1529
1396
|
|
|
1530
1397
|
## TRANSPOSE : <code>string</code>
|
|
1531
|
-
|
|
1398
|
+
<p>New Key meta directive. See: https://github.com/PraiseCharts/ChordChartJS/issues/53</p>
|
|
1532
1399
|
|
|
1533
|
-
**Kind**: global
|
|
1534
|
-
<a name="
|
|
1400
|
+
**Kind**: global variable
|
|
1401
|
+
<a name="NEW_KEY"></a>
|
|
1535
1402
|
|
|
1536
|
-
##
|
|
1537
|
-
Year meta directive. See https://www.chordpro.org/chordpro/directives-year
|
|
1403
|
+
## NEW\_KEY : <code>string</code>
|
|
1404
|
+
<p>Year meta directive. See https://www.chordpro.org/chordpro/directives-year/</p>
|
|
1405
|
+
|
|
1406
|
+
**Kind**: global variable
|
|
1407
|
+
<a name="defaultCss"></a>
|
|
1408
|
+
|
|
1409
|
+
## defaultCss ⇒ <code>string</code>
|
|
1410
|
+
<p>Generates basic CSS, scoped within the provided selector, to use with output generated by [HtmlTableFormatter](#HtmlTableFormatter)</p>
|
|
1411
|
+
|
|
1412
|
+
**Kind**: global variable
|
|
1413
|
+
**Returns**: <code>string</code> - <p>the CSS string</p>
|
|
1414
|
+
|
|
1415
|
+
| Param | Description |
|
|
1416
|
+
| --- | --- |
|
|
1417
|
+
| scope | <p>the CSS scope to use, for example <code>.chordSheetViewer</code></p> |
|
|
1538
1418
|
|
|
1539
|
-
**Kind**: global constant
|
|
1540
1419
|
<a name="defaultCss"></a>
|
|
1541
1420
|
|
|
1542
1421
|
## defaultCss : <code>Object.<string, Object.<string, string>></code>
|
|
1543
|
-
Basic CSS, in object style à la useStyles, to use with output generated by {@link }HtmlTableFormatter}
|
|
1544
|
-
For a CSS string see [scopedCss](
|
|
1422
|
+
<p>Basic CSS, in object style à la useStyles, to use with output generated by {@link }HtmlTableFormatter}
|
|
1423
|
+
For a CSS string see [scopedCss](scopedCss)</p>
|
|
1545
1424
|
|
|
1546
1425
|
**Kind**: global constant
|
|
1547
1426
|
<a name="VERSE"></a>
|
|
1548
1427
|
|
|
1549
1428
|
## VERSE : <code>string</code>
|
|
1550
|
-
Used to mark a paragraph as verse
|
|
1429
|
+
<p>Used to mark a paragraph as verse</p>
|
|
1430
|
+
|
|
1431
|
+
**Kind**: global constant
|
|
1432
|
+
<a name="VERSE"></a>
|
|
1433
|
+
|
|
1434
|
+
## VERSE : <code>string</code>
|
|
1435
|
+
<p>Used to mark a paragraph as chorus</p>
|
|
1551
1436
|
|
|
1552
1437
|
**Kind**: global constant
|
|
1553
1438
|
<a name="CHORUS"></a>
|
|
1554
1439
|
|
|
1555
1440
|
## CHORUS : <code>string</code>
|
|
1556
|
-
Used to mark a paragraph as
|
|
1441
|
+
<p>Used to mark a paragraph as not containing a line marked with a type</p>
|
|
1557
1442
|
|
|
1558
1443
|
**Kind**: global constant
|
|
1559
1444
|
<a name="NONE"></a>
|
|
1560
1445
|
|
|
1561
1446
|
## NONE : <code>string</code>
|
|
1562
|
-
Used to mark a paragraph as
|
|
1447
|
+
<p>Used to mark a paragraph as containing lines with both verse and chorus type</p>
|
|
1563
1448
|
|
|
1564
1449
|
**Kind**: global constant
|
|
1565
1450
|
<a name="INDETERMINATE"></a>
|
|
1566
1451
|
|
|
1567
1452
|
## INDETERMINATE : <code>string</code>
|
|
1568
|
-
Used to mark a paragraph as
|
|
1453
|
+
<p>Used to mark a paragraph as tab</p>
|
|
1569
1454
|
|
|
1570
1455
|
**Kind**: global constant
|
|
1571
|
-
<a name="
|
|
1572
|
-
|
|
1573
|
-
## TAB : <code>string</code>
|
|
1574
|
-
Used to mark a paragraph as tab
|
|
1456
|
+
<a name="parseChord"></a>
|
|
1575
1457
|
|
|
1576
|
-
|
|
1577
|
-
|
|
1458
|
+
## ~~parseChord(chordString) ⇒ <code>null</code> \| [<code>Chord</code>](#Chord)~~
|
|
1459
|
+
***Deprecated***
|
|
1578
1460
|
|
|
1579
|
-
|
|
1580
|
-
Generates basic CSS, scoped within the provided selector, to use with output generated by [HtmlTableFormatter](#HtmlTableFormatter)
|
|
1461
|
+
<p>Tries to parse a chord string into a chord</p>
|
|
1581
1462
|
|
|
1582
1463
|
**Kind**: global function
|
|
1583
|
-
**Returns**: <code>string</code> - the CSS string
|
|
1584
1464
|
|
|
1585
1465
|
| Param | Description |
|
|
1586
1466
|
| --- | --- |
|
|
1587
|
-
|
|
|
1467
|
+
| chordString | <p>the chord string, eg Esus4/G# or 1sus4/#3</p> |
|
|
1588
1468
|
|
|
1589
|
-
<a name="
|
|
1469
|
+
<a name="getCapos"></a>
|
|
1590
1470
|
|
|
1591
|
-
##
|
|
1592
|
-
|
|
1471
|
+
## getCapos(key) ⇒ <code>Object.<string, string></code>
|
|
1472
|
+
<p>Returns applicable capos for the provided key</p>
|
|
1473
|
+
|
|
1474
|
+
**Kind**: global function
|
|
1475
|
+
**Returns**: <code>Object.<string, string></code> - <p>The available capos, where the keys are capo numbers and the
|
|
1476
|
+
values are the effective key for that capo.</p>
|
|
1477
|
+
|
|
1478
|
+
| Param | Type | Description |
|
|
1479
|
+
| --- | --- | --- |
|
|
1480
|
+
| key | <code>Key</code> \| <code>string</code> | <p>The key to get capos for</p> |
|
|
1593
1481
|
|
|
1594
|
-
|
|
1482
|
+
<a name="getKeys"></a>
|
|
1483
|
+
|
|
1484
|
+
## getKeys(key) ⇒ <code>Array.<string></code>
|
|
1485
|
+
<p>Returns applicable keys to transpose to from the provided key</p>
|
|
1595
1486
|
|
|
1596
1487
|
**Kind**: global function
|
|
1488
|
+
**Returns**: <code>Array.<string></code> - <p>The available keys</p>
|
|
1597
1489
|
|
|
1598
|
-
| Param | Description |
|
|
1599
|
-
| --- | --- |
|
|
1600
|
-
|
|
|
1490
|
+
| Param | Type | Description |
|
|
1491
|
+
| --- | --- | --- |
|
|
1492
|
+
| key | <code>Key</code> \| <code>string</code> | <p>The key to get keys for</p> |
|
|
1601
1493
|
|