chordsheetjs 6.0.0 → 6.2.0
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 +477 -539
- package/lib/bundle.js +15353 -0
- package/lib/index.js +6253 -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 +50 -23
- package/d7b54993c4ea66c07a35bd36690482ab620f836e.patch +0 -105
- 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,168 +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
|
-
</
|
|
469
|
-
<
|
|
470
|
-
<
|
|
471
|
-
|
|
443
|
+
<dd><p>Transpose meta directive. See: https://www.chordpro.org/chordpro/directives-transpose/</p></dd>
|
|
444
|
+
<dt><a href="#TRANSPOSE">TRANSPOSE</a> : <code>string</code></dt>
|
|
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>
|
|
472
455
|
<dt><a href="#defaultCss">defaultCss</a> : <code>Object.<string, Object.<string, string>></code></dt>
|
|
473
456
|
<dd><p>Basic CSS, in object style à la useStyles, to use with output generated by {@link }HtmlTableFormatter}
|
|
474
|
-
For a CSS string see
|
|
475
|
-
</dd>
|
|
457
|
+
For a CSS string see [scopedCss](scopedCss)</p></dd>
|
|
476
458
|
<dt><a href="#VERSE">VERSE</a> : <code>string</code></dt>
|
|
477
|
-
<dd><p>Used to mark a paragraph as verse</p>
|
|
478
|
-
</
|
|
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>
|
|
479
462
|
<dt><a href="#CHORUS">CHORUS</a> : <code>string</code></dt>
|
|
480
|
-
<dd><p>Used to mark a paragraph as
|
|
481
|
-
</dd>
|
|
463
|
+
<dd><p>Used to mark a paragraph as not containing a line marked with a type</p></dd>
|
|
482
464
|
<dt><a href="#NONE">NONE</a> : <code>string</code></dt>
|
|
483
|
-
<dd><p>Used to mark a paragraph as
|
|
484
|
-
</dd>
|
|
465
|
+
<dd><p>Used to mark a paragraph as containing lines with both verse and chorus type</p></dd>
|
|
485
466
|
<dt><a href="#INDETERMINATE">INDETERMINATE</a> : <code>string</code></dt>
|
|
486
|
-
<dd><p>Used to mark a paragraph as
|
|
487
|
-
</dd>
|
|
488
|
-
<dt><a href="#TAB">TAB</a> : <code>string</code></dt>
|
|
489
|
-
<dd><p>Used to mark a paragraph as tab</p>
|
|
490
|
-
</dd>
|
|
467
|
+
<dd><p>Used to mark a paragraph as tab</p></dd>
|
|
491
468
|
</dl>
|
|
492
469
|
|
|
493
470
|
## Functions
|
|
494
471
|
|
|
495
472
|
<dl>
|
|
496
|
-
<dt><a href="#scopedCss">scopedCss(scope)</a> ⇒ <code>string</code></dt>
|
|
497
|
-
<dd><p>Generates basic CSS, scoped within the provided selector, to use with output generated by <a href="#HtmlTableFormatter">HtmlTableFormatter</a></p>
|
|
498
|
-
</dd>
|
|
499
473
|
<dt><del><a href="#parseChord">parseChord(chordString)</a> ⇒ <code>null</code> | <code><a href="#Chord">Chord</a></code></del></dt>
|
|
500
|
-
<dd><p>Tries to parse a chord string into a chord</p>
|
|
501
|
-
</
|
|
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>
|
|
502
479
|
</dl>
|
|
503
480
|
|
|
504
481
|
<a name="ChordLyricsPair"></a>
|
|
505
482
|
|
|
506
483
|
## ChordLyricsPair
|
|
507
|
-
Represents a chord with the corresponding (partial) lyrics
|
|
484
|
+
<p>Represents a chord with the corresponding (partial) lyrics</p>
|
|
508
485
|
|
|
509
486
|
**Kind**: global class
|
|
510
487
|
|
|
@@ -518,42 +495,42 @@ Represents a chord with the corresponding (partial) lyrics
|
|
|
518
495
|
<a name="new_ChordLyricsPair_new"></a>
|
|
519
496
|
|
|
520
497
|
### new ChordLyricsPair(chords, lyrics)
|
|
521
|
-
Initialises a ChordLyricsPair
|
|
498
|
+
<p>Initialises a ChordLyricsPair</p>
|
|
522
499
|
|
|
523
500
|
|
|
524
501
|
| Param | Type | Description |
|
|
525
502
|
| --- | --- | --- |
|
|
526
|
-
| chords | <code>string</code> | The chords |
|
|
527
|
-
| lyrics | <code>string</code> | The lyrics |
|
|
503
|
+
| chords | <code>string</code> | <p>The chords</p> |
|
|
504
|
+
| lyrics | <code>string</code> | <p>The lyrics</p> |
|
|
528
505
|
|
|
529
506
|
<a name="ChordLyricsPair+chords"></a>
|
|
530
507
|
|
|
531
508
|
### chordLyricsPair.chords : <code>string</code>
|
|
532
|
-
The chords
|
|
509
|
+
<p>The chords</p>
|
|
533
510
|
|
|
534
511
|
**Kind**: instance property of [<code>ChordLyricsPair</code>](#ChordLyricsPair)
|
|
535
512
|
<a name="ChordLyricsPair+lyrics"></a>
|
|
536
513
|
|
|
537
514
|
### chordLyricsPair.lyrics : <code>string</code>
|
|
538
|
-
The lyrics
|
|
515
|
+
<p>The lyrics</p>
|
|
539
516
|
|
|
540
517
|
**Kind**: instance property of [<code>ChordLyricsPair</code>](#ChordLyricsPair)
|
|
541
518
|
<a name="ChordLyricsPair+isRenderable"></a>
|
|
542
519
|
|
|
543
520
|
### chordLyricsPair.isRenderable() ⇒ <code>boolean</code>
|
|
544
|
-
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>
|
|
545
522
|
|
|
546
523
|
**Kind**: instance method of [<code>ChordLyricsPair</code>](#ChordLyricsPair)
|
|
547
524
|
<a name="ChordLyricsPair+clone"></a>
|
|
548
525
|
|
|
549
526
|
### chordLyricsPair.clone() ⇒ [<code>ChordLyricsPair</code>](#ChordLyricsPair)
|
|
550
|
-
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>
|
|
551
528
|
|
|
552
529
|
**Kind**: instance method of [<code>ChordLyricsPair</code>](#ChordLyricsPair)
|
|
553
530
|
<a name="Comment"></a>
|
|
554
531
|
|
|
555
532
|
## Comment
|
|
556
|
-
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>
|
|
557
534
|
|
|
558
535
|
**Kind**: global class
|
|
559
536
|
|
|
@@ -564,104 +541,22 @@ Represents a comment. See https://www.chordpro.org/chordpro/chordpro-file-format
|
|
|
564
541
|
<a name="Comment+isRenderable"></a>
|
|
565
542
|
|
|
566
543
|
### comment.isRenderable() ⇒ <code>boolean</code>
|
|
567
|
-
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>
|
|
568
545
|
|
|
569
546
|
**Kind**: instance method of [<code>Comment</code>](#Comment)
|
|
570
547
|
<a name="Comment+clone"></a>
|
|
571
548
|
|
|
572
549
|
### comment.clone() ⇒ [<code>Comment</code>](#Comment)
|
|
573
|
-
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>
|
|
574
551
|
|
|
575
552
|
**Kind**: instance method of [<code>Comment</code>](#Comment)
|
|
576
|
-
<a name="Line"></a>
|
|
577
|
-
|
|
578
|
-
## Line
|
|
579
|
-
Represents a line in a chord sheet, consisting of items of type ChordLyricsPair or Tag
|
|
580
|
-
|
|
581
|
-
**Kind**: global class
|
|
582
|
-
|
|
583
|
-
* [Line](#Line)
|
|
584
|
-
* [.items](#Line+items) : <code>Array.<(ChordLyricsPair\|Tag\|Comment)></code>
|
|
585
|
-
* [.type](#Line+type) : <code>string</code>
|
|
586
|
-
* [.isEmpty()](#Line+isEmpty) ⇒ <code>boolean</code>
|
|
587
|
-
* [.addItem(item)](#Line+addItem)
|
|
588
|
-
* [.hasRenderableItems()](#Line+hasRenderableItems) ⇒ <code>boolean</code>
|
|
589
|
-
* [.clone()](#Line+clone) ⇒ [<code>Line</code>](#Line)
|
|
590
|
-
* [.isVerse()](#Line+isVerse) ⇒ <code>boolean</code>
|
|
591
|
-
* [.isChorus()](#Line+isChorus) ⇒ <code>boolean</code>
|
|
592
|
-
* ~~[.hasContent()](#Line+hasContent) ⇒ <code>boolean</code>~~
|
|
593
|
-
|
|
594
|
-
<a name="Line+items"></a>
|
|
595
|
-
|
|
596
|
-
### line.items : <code>Array.<(ChordLyricsPair\|Tag\|Comment)></code>
|
|
597
|
-
The items ([ChordLyricsPair](#ChordLyricsPair) or [Tag](#Tag) or [Comment](#Comment)) of which the line consists
|
|
598
|
-
|
|
599
|
-
**Kind**: instance property of [<code>Line</code>](#Line)
|
|
600
|
-
<a name="Line+type"></a>
|
|
601
|
-
|
|
602
|
-
### line.type : <code>string</code>
|
|
603
|
-
The line type, This is set by the ChordProParser when it read tags like {start_of_chorus} or {start_of_verse}
|
|
604
|
-
Values can be [VERSE](#VERSE), [CHORUS](#CHORUS) or [NONE](#NONE)
|
|
605
|
-
|
|
606
|
-
**Kind**: instance property of [<code>Line</code>](#Line)
|
|
607
|
-
<a name="Line+isEmpty"></a>
|
|
608
|
-
|
|
609
|
-
### line.isEmpty() ⇒ <code>boolean</code>
|
|
610
|
-
Indicates whether the line contains any items
|
|
611
|
-
|
|
612
|
-
**Kind**: instance method of [<code>Line</code>](#Line)
|
|
613
|
-
<a name="Line+addItem"></a>
|
|
614
|
-
|
|
615
|
-
### line.addItem(item)
|
|
616
|
-
Adds an item ([ChordLyricsPair](#ChordLyricsPair) or [Tag](#Tag)) to the line
|
|
617
|
-
|
|
618
|
-
**Kind**: instance method of [<code>Line</code>](#Line)
|
|
619
|
-
|
|
620
|
-
| Param | Type | Description |
|
|
621
|
-
| --- | --- | --- |
|
|
622
|
-
| item | [<code>ChordLyricsPair</code>](#ChordLyricsPair) \| [<code>Tag</code>](#Tag) | The item to be added |
|
|
623
|
-
|
|
624
|
-
<a name="Line+hasRenderableItems"></a>
|
|
625
|
-
|
|
626
|
-
### line.hasRenderableItems() ⇒ <code>boolean</code>
|
|
627
|
-
Indicates whether the line contains items that are renderable
|
|
628
|
-
|
|
629
|
-
**Kind**: instance method of [<code>Line</code>](#Line)
|
|
630
|
-
<a name="Line+clone"></a>
|
|
631
|
-
|
|
632
|
-
### line.clone() ⇒ [<code>Line</code>](#Line)
|
|
633
|
-
Returns a deep copy of the line and all of its items
|
|
634
|
-
|
|
635
|
-
**Kind**: instance method of [<code>Line</code>](#Line)
|
|
636
|
-
<a name="Line+isVerse"></a>
|
|
637
|
-
|
|
638
|
-
### line.isVerse() ⇒ <code>boolean</code>
|
|
639
|
-
Indicates whether the line type is [VERSE](#VERSE)
|
|
640
|
-
|
|
641
|
-
**Kind**: instance method of [<code>Line</code>](#Line)
|
|
642
|
-
<a name="Line+isChorus"></a>
|
|
643
|
-
|
|
644
|
-
### line.isChorus() ⇒ <code>boolean</code>
|
|
645
|
-
Indicates whether the line type is [CHORUS](#CHORUS)
|
|
646
|
-
|
|
647
|
-
**Kind**: instance method of [<code>Line</code>](#Line)
|
|
648
|
-
<a name="Line+hasContent"></a>
|
|
649
|
-
|
|
650
|
-
### ~~line.hasContent() ⇒ <code>boolean</code>~~
|
|
651
|
-
***Deprecated***
|
|
652
|
-
|
|
653
|
-
Indicates whether the line contains items that are renderable. Please use [hasRenderableItems](hasRenderableItems)
|
|
654
|
-
|
|
655
|
-
**Kind**: instance method of [<code>Line</code>](#Line)
|
|
656
553
|
<a name="Metadata"></a>
|
|
657
554
|
|
|
658
555
|
## Metadata
|
|
659
|
-
Stores song metadata. Properties can be accessed using the get() method
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
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>
|
|
665
560
|
|
|
666
561
|
**Kind**: global class
|
|
667
562
|
|
|
@@ -672,130 +567,98 @@ See [get](#Metadata+get)
|
|
|
672
567
|
<a name="Metadata+get"></a>
|
|
673
568
|
|
|
674
569
|
### metadata.get(prop) ⇒ <code>Array.<String></code> \| <code>String</code>
|
|
675
|
-
Reads a metadata value by key. This method supports simple value lookup, as fetching single array values
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
metadata.get('
|
|
683
|
-
|
|
684
|
-
metadata
|
|
685
|
-
metadata.get('author
|
|
686
|
-
|
|
687
|
-
Using a negative index will start counting at the end of the list:
|
|
688
|
-
|
|
689
|
-
const metadata = new Metadata({ lyricist: 'Pete', author: ['John', 'Mary'] });
|
|
690
|
-
metadata.get('author.-1') // => 'Mary'
|
|
691
|
-
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>
|
|
692
582
|
|
|
693
583
|
**Kind**: instance method of [<code>Metadata</code>](#Metadata)
|
|
694
|
-
**Returns**: <code>Array.<String></code> \| <code>String</code> - the metadata value(s). If there is only one value, it will return a String,
|
|
695
|
-
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>
|
|
696
586
|
|
|
697
587
|
| Param | Description |
|
|
698
588
|
| --- | --- |
|
|
699
|
-
| prop | the property name |
|
|
589
|
+
| prop | <p>the property name</p> |
|
|
700
590
|
|
|
701
591
|
<a name="Metadata+clone"></a>
|
|
702
592
|
|
|
703
593
|
### metadata.clone() ⇒ [<code>Metadata</code>](#Metadata)
|
|
704
|
-
Returns a deep clone of this Metadata object
|
|
594
|
+
<p>Returns a deep clone of this Metadata object</p>
|
|
705
595
|
|
|
706
596
|
**Kind**: instance method of [<code>Metadata</code>](#Metadata)
|
|
707
|
-
**Returns**: [<code>Metadata</code>](#Metadata) - the cloned Metadata object
|
|
597
|
+
**Returns**: [<code>Metadata</code>](#Metadata) - <p>the cloned Metadata object</p>
|
|
708
598
|
<a name="Paragraph"></a>
|
|
709
599
|
|
|
710
600
|
## Paragraph
|
|
711
|
-
Represents a paragraph of lines in a chord sheet
|
|
601
|
+
<p>Represents a paragraph of lines in a chord sheet</p>
|
|
712
602
|
|
|
713
603
|
**Kind**: global class
|
|
714
604
|
|
|
715
605
|
* [Paragraph](#Paragraph)
|
|
716
|
-
* [.lines](#Paragraph+lines) : [<code>Array.<Line></code>](#Line)
|
|
717
606
|
* [.type](#Paragraph+type) ⇒ <code>string</code>
|
|
718
607
|
* [.hasRenderableItems()](#Paragraph+hasRenderableItems) ⇒ <code>boolean</code>
|
|
719
608
|
|
|
720
|
-
<a name="Paragraph+lines"></a>
|
|
721
|
-
|
|
722
|
-
### paragraph.lines : [<code>Array.<Line></code>](#Line)
|
|
723
|
-
The [Line](#Line) items of which the paragraph consists
|
|
724
|
-
|
|
725
|
-
**Kind**: instance property of [<code>Paragraph</code>](#Paragraph)
|
|
726
609
|
<a name="Paragraph+type"></a>
|
|
727
610
|
|
|
728
611
|
### paragraph.type ⇒ <code>string</code>
|
|
729
|
-
Tries to determine the common type for all lines. If the types for all lines are equal, it returns that type.
|
|
730
|
-
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>
|
|
731
614
|
|
|
732
615
|
**Kind**: instance property of [<code>Paragraph</code>](#Paragraph)
|
|
733
616
|
<a name="Paragraph+hasRenderableItems"></a>
|
|
734
617
|
|
|
735
618
|
### paragraph.hasRenderableItems() ⇒ <code>boolean</code>
|
|
736
|
-
Indicates whether the paragraph contains lines with renderable items
|
|
619
|
+
<p>Indicates whether the paragraph contains lines with renderable items.</p>
|
|
737
620
|
|
|
738
621
|
**Kind**: instance method of [<code>Paragraph</code>](#Paragraph)
|
|
739
622
|
**See**: [Line.hasRenderableItems](Line.hasRenderableItems)
|
|
740
623
|
<a name="Song"></a>
|
|
741
624
|
|
|
742
625
|
## Song
|
|
743
|
-
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>
|
|
744
627
|
|
|
745
628
|
**Kind**: global class
|
|
746
629
|
|
|
747
630
|
* [Song](#Song)
|
|
748
631
|
* [new Song(metadata)](#new_Song_new)
|
|
749
|
-
* [.
|
|
750
|
-
* [.paragraphs](#Song+paragraphs) : [<code>Array.<Paragraph></code>](#Paragraph)
|
|
751
|
-
* [.metadata](#Song+metadata) : [<code>Metadata</code>](#Metadata)
|
|
752
|
-
* [.bodyLines](#Song+bodyLines) ⇒ [<code>Array.<Line></code>](#Line)
|
|
632
|
+
* [.bodyLines](#Song+bodyLines) ⇒ <code>Array.<Line></code>
|
|
753
633
|
* [.bodyParagraphs](#Song+bodyParagraphs) ⇒ [<code>Array.<Paragraph></code>](#Paragraph)
|
|
754
634
|
* ~~[.metaData](#Song+metaData) ⇒~~
|
|
755
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)
|
|
756
638
|
|
|
757
639
|
<a name="new_Song_new"></a>
|
|
758
640
|
|
|
759
641
|
### new Song(metadata)
|
|
760
|
-
Creates a new {Song} instance
|
|
642
|
+
<p>Creates a new {Song} instance</p>
|
|
761
643
|
|
|
762
644
|
|
|
763
645
|
| Param | Type | Description |
|
|
764
646
|
| --- | --- | --- |
|
|
765
|
-
| metadata | <code>Object</code> \| [<code>Metadata</code>](#Metadata) | predefined metadata |
|
|
647
|
+
| metadata | <code>Object</code> \| [<code>Metadata</code>](#Metadata) | <p>predefined metadata</p> |
|
|
766
648
|
|
|
767
|
-
<a name="Song+lines"></a>
|
|
768
|
-
|
|
769
|
-
### song.lines : [<code>Array.<Line></code>](#Line)
|
|
770
|
-
The [Line](#Line) items of which the song consists
|
|
771
|
-
|
|
772
|
-
**Kind**: instance property of [<code>Song</code>](#Song)
|
|
773
|
-
<a name="Song+paragraphs"></a>
|
|
774
|
-
|
|
775
|
-
### song.paragraphs : [<code>Array.<Paragraph></code>](#Paragraph)
|
|
776
|
-
The [Paragraph](#Paragraph) items of which the song consists
|
|
777
|
-
|
|
778
|
-
**Kind**: instance property of [<code>Song</code>](#Song)
|
|
779
|
-
<a name="Song+metadata"></a>
|
|
780
|
-
|
|
781
|
-
### song.metadata : [<code>Metadata</code>](#Metadata)
|
|
782
|
-
The song's metadata. When there is only one value for an entry, the value is a string. Else, the value is
|
|
783
|
-
an array containing all unique values for the entry.
|
|
784
|
-
|
|
785
|
-
**Kind**: instance property of [<code>Song</code>](#Song)
|
|
786
649
|
<a name="Song+bodyLines"></a>
|
|
787
650
|
|
|
788
|
-
### song.bodyLines ⇒
|
|
789
|
-
Returns the song lines, skipping the leading empty lines (empty as in not rendering any content). This is useful
|
|
790
|
-
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>
|
|
791
654
|
|
|
792
655
|
**Kind**: instance property of [<code>Song</code>](#Song)
|
|
793
|
-
**Returns**:
|
|
656
|
+
**Returns**: <code>Array.<Line></code> - <p>The song body lines</p>
|
|
794
657
|
<a name="Song+bodyParagraphs"></a>
|
|
795
658
|
|
|
796
659
|
### song.bodyParagraphs ⇒ [<code>Array.<Paragraph></code>](#Paragraph)
|
|
797
|
-
Returns the song paragraphs, skipping the paragraphs that only contain empty lines
|
|
798
|
-
(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>
|
|
799
662
|
|
|
800
663
|
**Kind**: instance property of [<code>Song</code>](#Song)
|
|
801
664
|
**See**: [bodyLines](bodyLines)
|
|
@@ -804,21 +667,54 @@ Returns the song paragraphs, skipping the paragraphs that only contain empty lin
|
|
|
804
667
|
### ~~song.metaData ⇒~~
|
|
805
668
|
***Deprecated***
|
|
806
669
|
|
|
807
|
-
The song's metadata. Please use [metadata](metadata) instead
|
|
670
|
+
<p>The song's metadata. Please use [metadata](metadata) instead.</p>
|
|
808
671
|
|
|
809
672
|
**Kind**: instance property of [<code>Song</code>](#Song)
|
|
810
|
-
**Returns**: [Metadata](#Metadata) The metadata
|
|
673
|
+
**Returns**: <p>[Metadata](#Metadata) The metadata</p>
|
|
811
674
|
<a name="Song+clone"></a>
|
|
812
675
|
|
|
813
676
|
### song.clone() ⇒ [<code>Song</code>](#Song)
|
|
814
|
-
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>
|
|
815
706
|
|
|
816
707
|
**Kind**: instance method of [<code>Song</code>](#Song)
|
|
817
|
-
**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
|
+
|
|
818
714
|
<a name="Tag"></a>
|
|
819
715
|
|
|
820
716
|
## Tag
|
|
821
|
-
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>
|
|
822
718
|
|
|
823
719
|
**Kind**: global class
|
|
824
720
|
|
|
@@ -834,84 +730,87 @@ Represents a tag/directive. See https://www.chordpro.org/chordpro/chordpro-direc
|
|
|
834
730
|
<a name="Tag+name"></a>
|
|
835
731
|
|
|
836
732
|
### tag.name : <code>string</code>
|
|
837
|
-
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>
|
|
838
734
|
|
|
839
735
|
**Kind**: instance property of [<code>Tag</code>](#Tag)
|
|
840
736
|
<a name="Tag+originalName"></a>
|
|
841
737
|
|
|
842
738
|
### tag.originalName : <code>string</code>
|
|
843
|
-
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>
|
|
844
740
|
|
|
845
741
|
**Kind**: instance property of [<code>Tag</code>](#Tag)
|
|
846
742
|
<a name="Tag+value"></a>
|
|
847
743
|
|
|
848
744
|
### tag.value : <code>string</code> \| <code>null</code>
|
|
849
|
-
The tag value
|
|
745
|
+
<p>The tag value</p>
|
|
850
746
|
|
|
851
747
|
**Kind**: instance property of [<code>Tag</code>](#Tag)
|
|
852
748
|
<a name="Tag+hasValue"></a>
|
|
853
749
|
|
|
854
750
|
### tag.hasValue() ⇒ <code>boolean</code>
|
|
855
|
-
Checks whether the tag value is a non-empty string
|
|
751
|
+
<p>Checks whether the tag value is a non-empty string.</p>
|
|
856
752
|
|
|
857
753
|
**Kind**: instance method of [<code>Tag</code>](#Tag)
|
|
858
754
|
<a name="Tag+isRenderable"></a>
|
|
859
755
|
|
|
860
756
|
### tag.isRenderable() ⇒ <code>boolean</code>
|
|
861
|
-
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>
|
|
862
758
|
|
|
863
759
|
**Kind**: instance method of [<code>Tag</code>](#Tag)
|
|
864
760
|
<a name="Tag+isMetaTag"></a>
|
|
865
761
|
|
|
866
762
|
### tag.isMetaTag() ⇒ <code>boolean</code>
|
|
867
|
-
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>
|
|
868
764
|
|
|
869
765
|
**Kind**: instance method of [<code>Tag</code>](#Tag)
|
|
870
766
|
<a name="Tag+clone"></a>
|
|
871
767
|
|
|
872
768
|
### tag.clone() ⇒ [<code>Tag</code>](#Tag)
|
|
873
|
-
Returns a clone of the tag
|
|
769
|
+
<p>Returns a clone of the tag.</p>
|
|
874
770
|
|
|
875
771
|
**Kind**: instance method of [<code>Tag</code>](#Tag)
|
|
876
|
-
**Returns**: [<code>Tag</code>](#Tag) - The cloned tag
|
|
772
|
+
**Returns**: [<code>Tag</code>](#Tag) - <p>The cloned tag</p>
|
|
877
773
|
<a name="ChordProFormatter"></a>
|
|
878
774
|
|
|
879
775
|
## ChordProFormatter
|
|
880
|
-
Formats a song into a ChordPro chord sheet
|
|
776
|
+
<p>Formats a song into a ChordPro chord sheet</p>
|
|
881
777
|
|
|
882
778
|
**Kind**: global class
|
|
779
|
+
<a name="ChordProFormatter+format"></a>
|
|
883
780
|
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
* [.format(song)](#ChordProFormatter+format) ⇒ <code>string</code>
|
|
887
|
-
|
|
888
|
-
<a name="new_ChordProFormatter_new"></a>
|
|
889
|
-
|
|
890
|
-
### new ChordProFormatter(options)
|
|
891
|
-
Instantiate
|
|
781
|
+
### chordProFormatter.format(song) ⇒ <code>string</code>
|
|
782
|
+
<p>Formats a song into a ChordPro chord sheet.</p>
|
|
892
783
|
|
|
784
|
+
**Kind**: instance method of [<code>ChordProFormatter</code>](#ChordProFormatter)
|
|
785
|
+
**Returns**: <code>string</code> - <p>The ChordPro string</p>
|
|
893
786
|
|
|
894
787
|
| Param | Type | Description |
|
|
895
788
|
| --- | --- | --- |
|
|
896
|
-
|
|
|
897
|
-
| 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> |
|
|
898
790
|
|
|
899
|
-
<a name="
|
|
791
|
+
<a name="Formatter"></a>
|
|
900
792
|
|
|
901
|
-
|
|
902
|
-
|
|
793
|
+
## Formatter
|
|
794
|
+
<p>Base class for all formatters, taking care of receiving a configuration wrapping that inside a Configuration object</p>
|
|
903
795
|
|
|
904
|
-
**Kind**:
|
|
905
|
-
|
|
796
|
+
**Kind**: global class
|
|
797
|
+
<a name="new_Formatter_new"></a>
|
|
798
|
+
|
|
799
|
+
### new Formatter([configuration])
|
|
800
|
+
<p>Instantiate</p>
|
|
906
801
|
|
|
907
|
-
|
|
908
|
-
|
|
|
909
|
-
|
|
|
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> |
|
|
910
809
|
|
|
911
810
|
<a name="HtmlDivFormatter"></a>
|
|
912
811
|
|
|
913
812
|
## HtmlDivFormatter
|
|
914
|
-
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>
|
|
915
814
|
|
|
916
815
|
**Kind**: global class
|
|
917
816
|
|
|
@@ -925,60 +824,57 @@ Formats a song into HTML. It uses DIVs to align lyrics with chords, which makes
|
|
|
925
824
|
<a name="HtmlDivFormatter+format"></a>
|
|
926
825
|
|
|
927
826
|
### htmlDivFormatter.format(song) ⇒ <code>string</code>
|
|
928
|
-
Formats a song into HTML
|
|
827
|
+
<p>Formats a song into HTML.</p>
|
|
929
828
|
|
|
930
829
|
**Kind**: instance method of [<code>HtmlDivFormatter</code>](#HtmlDivFormatter)
|
|
931
|
-
**Returns**: <code>string</code> - The HTML string
|
|
830
|
+
**Returns**: <code>string</code> - <p>The HTML string</p>
|
|
932
831
|
|
|
933
832
|
| Param | Type | Description |
|
|
934
833
|
| --- | --- | --- |
|
|
935
|
-
| song | [<code>Song</code>](#Song) | The song to be formatted |
|
|
834
|
+
| song | [<code>Song</code>](#Song) | <p>The song to be formatted</p> |
|
|
936
835
|
|
|
937
836
|
<a name="HtmlDivFormatter.cssString"></a>
|
|
938
837
|
|
|
939
838
|
### HtmlDivFormatter.cssString(scope) ⇒ <code>string</code>
|
|
940
|
-
Generates basic CSS, optionally scoped within the provided selector, to use with output generated by
|
|
941
|
-
[HtmlDivFormatter](#HtmlDivFormatter)
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
}
|
|
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>
|
|
948
846
|
|
|
949
847
|
**Kind**: static method of [<code>HtmlDivFormatter</code>](#HtmlDivFormatter)
|
|
950
|
-
**Returns**: <code>string</code> - the CSS string
|
|
848
|
+
**Returns**: <code>string</code> - <p>the CSS string</p>
|
|
951
849
|
|
|
952
850
|
| Param | Description |
|
|
953
851
|
| --- | --- |
|
|
954
|
-
| scope | the CSS scope to use, for example
|
|
852
|
+
| scope | <p>the CSS scope to use, for example <code>.chordSheetViewer</code></p> |
|
|
955
853
|
|
|
956
854
|
<a name="HtmlDivFormatter.cssObject"></a>
|
|
957
855
|
|
|
958
856
|
### HtmlDivFormatter.cssObject() ⇒ <code>Object.<string, Object.<string, string>></code>
|
|
959
|
-
Basic CSS, in object style à la useStyles, to use with output generated by [HtmlDivFormatter](#HtmlDivFormatter)
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
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>
|
|
968
864
|
|
|
969
865
|
**Kind**: static method of [<code>HtmlDivFormatter</code>](#HtmlDivFormatter)
|
|
970
|
-
**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>
|
|
971
867
|
<a name="HtmlFormatter"></a>
|
|
972
868
|
|
|
973
869
|
## HtmlFormatter
|
|
974
|
-
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>
|
|
975
871
|
|
|
976
872
|
**Kind**: global class
|
|
977
873
|
<a name="HtmlTableFormatter"></a>
|
|
978
874
|
|
|
979
875
|
## HtmlTableFormatter
|
|
980
|
-
Formats a song into HTML. It uses TABLEs to align lyrics with chords, which makes the HTML for things like
|
|
981
|
-
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>
|
|
982
878
|
|
|
983
879
|
**Kind**: global class
|
|
984
880
|
|
|
@@ -992,70 +888,68 @@ PDF conversion.
|
|
|
992
888
|
<a name="HtmlTableFormatter+format"></a>
|
|
993
889
|
|
|
994
890
|
### htmlTableFormatter.format(song) ⇒ <code>string</code>
|
|
995
|
-
Formats a song into HTML
|
|
891
|
+
<p>Formats a song into HTML.</p>
|
|
996
892
|
|
|
997
893
|
**Kind**: instance method of [<code>HtmlTableFormatter</code>](#HtmlTableFormatter)
|
|
998
|
-
**Returns**: <code>string</code> - The HTML string
|
|
894
|
+
**Returns**: <code>string</code> - <p>The HTML string</p>
|
|
999
895
|
|
|
1000
896
|
| Param | Type | Description |
|
|
1001
897
|
| --- | --- | --- |
|
|
1002
|
-
| song | [<code>Song</code>](#Song) | The song to be formatted |
|
|
898
|
+
| song | [<code>Song</code>](#Song) | <p>The song to be formatted</p> |
|
|
1003
899
|
|
|
1004
900
|
<a name="HtmlTableFormatter.cssString"></a>
|
|
1005
901
|
|
|
1006
902
|
### HtmlTableFormatter.cssString(scope) ⇒ <code>string</code>
|
|
1007
|
-
Generates basic CSS, optionally scoped within the provided selector, to use with output generated by
|
|
1008
|
-
[HtmlTableFormatter](#HtmlTableFormatter)
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
}
|
|
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>
|
|
1015
910
|
|
|
1016
911
|
**Kind**: static method of [<code>HtmlTableFormatter</code>](#HtmlTableFormatter)
|
|
1017
|
-
**Returns**: <code>string</code> - the CSS string
|
|
912
|
+
**Returns**: <code>string</code> - <p>the CSS string</p>
|
|
1018
913
|
|
|
1019
914
|
| Param | Description |
|
|
1020
915
|
| --- | --- |
|
|
1021
|
-
| scope | the CSS scope to use, for example
|
|
916
|
+
| scope | <p>the CSS scope to use, for example <code>.chordSheetViewer</code></p> |
|
|
1022
917
|
|
|
1023
918
|
<a name="HtmlTableFormatter.cssObject"></a>
|
|
1024
919
|
|
|
1025
920
|
### HtmlTableFormatter.cssObject() ⇒ <code>Object.<string, Object.<string, string>></code>
|
|
1026
|
-
Basic CSS, in object style à la useStyles, to use with output generated by [HtmlTableFormatter](#HtmlTableFormatter)
|
|
1027
|
-
For a CSS string see [cssString](cssString)
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
}
|
|
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>
|
|
1034
928
|
|
|
1035
929
|
**Kind**: static method of [<code>HtmlTableFormatter</code>](#HtmlTableFormatter)
|
|
1036
|
-
**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>
|
|
1037
931
|
<a name="TextFormatter"></a>
|
|
1038
932
|
|
|
1039
933
|
## TextFormatter
|
|
1040
|
-
Formats a song into a plain text chord sheet
|
|
934
|
+
<p>Formats a song into a plain text chord sheet</p>
|
|
1041
935
|
|
|
1042
936
|
**Kind**: global class
|
|
1043
937
|
<a name="TextFormatter+format"></a>
|
|
1044
938
|
|
|
1045
939
|
### textFormatter.format(song) ⇒ <code>string</code>
|
|
1046
|
-
Formats a song into a plain text chord sheet
|
|
940
|
+
<p>Formats a song into a plain text chord sheet</p>
|
|
1047
941
|
|
|
1048
942
|
**Kind**: instance method of [<code>TextFormatter</code>](#TextFormatter)
|
|
1049
|
-
**Returns**: <code>string</code> - the chord sheet
|
|
943
|
+
**Returns**: <code>string</code> - <p>the chord sheet</p>
|
|
1050
944
|
|
|
1051
945
|
| Param | Type | Description |
|
|
1052
946
|
| --- | --- | --- |
|
|
1053
|
-
| song | [<code>Song</code>](#Song) | The song to be formatted |
|
|
947
|
+
| song | [<code>Song</code>](#Song) | <p>The song to be formatted</p> |
|
|
1054
948
|
|
|
1055
949
|
<a name="ChordProParser"></a>
|
|
1056
950
|
|
|
1057
951
|
## ChordProParser
|
|
1058
|
-
Parses a ChordPro chord sheet
|
|
952
|
+
<p>Parses a ChordPro chord sheet</p>
|
|
1059
953
|
|
|
1060
954
|
**Kind**: global class
|
|
1061
955
|
|
|
@@ -1066,118 +960,96 @@ Parses a ChordPro chord sheet
|
|
|
1066
960
|
<a name="ChordProParser+warnings"></a>
|
|
1067
961
|
|
|
1068
962
|
### chordProParser.warnings : [<code>Array.<ParserWarning></code>](#ParserWarning)
|
|
1069
|
-
All warnings raised during parsing the ChordPro chord sheet
|
|
963
|
+
<p>All warnings raised during parsing the ChordPro chord sheet</p>
|
|
1070
964
|
|
|
1071
965
|
**Kind**: instance property of [<code>ChordProParser</code>](#ChordProParser)
|
|
1072
966
|
<a name="ChordProParser+parse"></a>
|
|
1073
967
|
|
|
1074
968
|
### chordProParser.parse(chordProChordSheet) ⇒ [<code>Song</code>](#Song)
|
|
1075
|
-
Parses a ChordPro chord sheet into a song
|
|
969
|
+
<p>Parses a ChordPro chord sheet into a song</p>
|
|
1076
970
|
|
|
1077
971
|
**Kind**: instance method of [<code>ChordProParser</code>](#ChordProParser)
|
|
1078
|
-
**Returns**: [<code>Song</code>](#Song) - The parsed song
|
|
972
|
+
**Returns**: [<code>Song</code>](#Song) - <p>The parsed song</p>
|
|
1079
973
|
|
|
1080
974
|
| Param | Type | Description |
|
|
1081
975
|
| --- | --- | --- |
|
|
1082
|
-
| chordProChordSheet | <code>string</code> | the ChordPro chord sheet |
|
|
976
|
+
| chordProChordSheet | <code>string</code> | <p>the ChordPro chord sheet</p> |
|
|
1083
977
|
|
|
1084
978
|
<a name="ChordSheetParser"></a>
|
|
1085
979
|
|
|
1086
980
|
## ChordSheetParser
|
|
1087
|
-
Parses a normal chord sheet
|
|
981
|
+
<p>Parses a normal chord sheet</p>
|
|
1088
982
|
|
|
1089
983
|
**Kind**: global class
|
|
1090
984
|
|
|
1091
985
|
* [ChordSheetParser](#ChordSheetParser)
|
|
1092
|
-
* [new ChordSheetParser(options)](#new_ChordSheetParser_new)
|
|
1093
|
-
* [.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)
|
|
1094
988
|
|
|
1095
989
|
<a name="new_ChordSheetParser_new"></a>
|
|
1096
990
|
|
|
1097
|
-
### new ChordSheetParser(options)
|
|
1098
|
-
Instantiate a chord sheet parser
|
|
991
|
+
### new ChordSheetParser([options])
|
|
992
|
+
<p>Instantiate a chord sheet parser</p>
|
|
1099
993
|
|
|
1100
994
|
|
|
1101
|
-
| Param | Type | Description |
|
|
1102
|
-
| --- | --- | --- |
|
|
1103
|
-
| options | <code>Object</code> | options |
|
|
1104
|
-
| 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> |
|
|
1105
999
|
|
|
1106
1000
|
<a name="ChordSheetParser+parse"></a>
|
|
1107
1001
|
|
|
1108
|
-
### chordSheetParser.parse(chordSheet, options) ⇒ [<code>Song</code>](#Song)
|
|
1109
|
-
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>
|
|
1110
1004
|
|
|
1111
1005
|
**Kind**: instance method of [<code>ChordSheetParser</code>](#ChordSheetParser)
|
|
1112
|
-
**Returns**: [<code>Song</code>](#Song) - The parsed song
|
|
1006
|
+
**Returns**: [<code>Song</code>](#Song) - <p>The parsed song</p>
|
|
1113
1007
|
|
|
1114
|
-
| Param | Type | Description |
|
|
1115
|
-
| --- | --- | --- |
|
|
1116
|
-
| chordSheet | <code>string</code> | The ChordPro chord sheet |
|
|
1117
|
-
| options | <code>Object</code> | Optional parser options |
|
|
1118
|
-
| 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> |
|
|
1119
1013
|
|
|
1120
1014
|
<a name="ParserWarning"></a>
|
|
1121
1015
|
|
|
1122
1016
|
## ParserWarning
|
|
1123
|
-
Represents a parser warning, currently only used by ChordProParser
|
|
1017
|
+
<p>Represents a parser warning, currently only used by ChordProParser.</p>
|
|
1124
1018
|
|
|
1125
1019
|
**Kind**: global class
|
|
1126
|
-
|
|
1127
|
-
* [ParserWarning](#ParserWarning)
|
|
1128
|
-
* [.message](#ParserWarning+message) : <code>string</code>
|
|
1129
|
-
* [.lineNumber](#ParserWarning+lineNumber) : <code>number</code>
|
|
1130
|
-
* [.column](#ParserWarning+column) : <code>number</code>
|
|
1131
|
-
* [.toString()](#ParserWarning+toString) ⇒ <code>string</code>
|
|
1132
|
-
|
|
1133
|
-
<a name="ParserWarning+message"></a>
|
|
1134
|
-
|
|
1135
|
-
### parserWarning.message : <code>string</code>
|
|
1136
|
-
The warning message
|
|
1137
|
-
|
|
1138
|
-
**Kind**: instance property of [<code>ParserWarning</code>](#ParserWarning)
|
|
1139
|
-
<a name="ParserWarning+lineNumber"></a>
|
|
1140
|
-
|
|
1141
|
-
### parserWarning.lineNumber : <code>number</code>
|
|
1142
|
-
The chord sheet line number on which the warning occurred
|
|
1143
|
-
|
|
1144
|
-
**Kind**: instance property of [<code>ParserWarning</code>](#ParserWarning)
|
|
1145
|
-
<a name="ParserWarning+column"></a>
|
|
1146
|
-
|
|
1147
|
-
### parserWarning.column : <code>number</code>
|
|
1148
|
-
The chord sheet column on which the warning occurred
|
|
1149
|
-
|
|
1150
|
-
**Kind**: instance property of [<code>ParserWarning</code>](#ParserWarning)
|
|
1151
1020
|
<a name="ParserWarning+toString"></a>
|
|
1152
1021
|
|
|
1153
1022
|
### parserWarning.toString() ⇒ <code>string</code>
|
|
1154
|
-
Returns a stringified version of the warning
|
|
1023
|
+
<p>Returns a stringified version of the warning</p>
|
|
1155
1024
|
|
|
1156
1025
|
**Kind**: instance method of [<code>ParserWarning</code>](#ParserWarning)
|
|
1157
|
-
**Returns**: <code>string</code> - The string warning
|
|
1026
|
+
**Returns**: <code>string</code> - <p>The string warning</p>
|
|
1158
1027
|
<a name="UltimateGuitarParser"></a>
|
|
1159
1028
|
|
|
1160
1029
|
## UltimateGuitarParser
|
|
1161
|
-
Parses an Ultimate Guitar chord sheet with metadata
|
|
1162
|
-
Inherits from [ChordSheetParser](#ChordSheetParser)
|
|
1030
|
+
<p>Parses an Ultimate Guitar chord sheet with metadata
|
|
1031
|
+
Inherits from [ChordSheetParser](#ChordSheetParser)</p>
|
|
1163
1032
|
|
|
1164
1033
|
**Kind**: global class
|
|
1165
1034
|
<a name="Chord"></a>
|
|
1166
1035
|
|
|
1167
1036
|
## Chord
|
|
1168
|
-
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>
|
|
1169
1038
|
|
|
1170
1039
|
**Kind**: global class
|
|
1171
1040
|
|
|
1172
1041
|
* [Chord](#Chord)
|
|
1173
1042
|
* _instance_
|
|
1174
1043
|
* [.clone()](#Chord+clone) ⇒ [<code>Chord</code>](#Chord)
|
|
1175
|
-
* [.toChordSymbol(key)](#Chord+toChordSymbol) ⇒ [<code>Chord</code>](#Chord)
|
|
1176
|
-
* [.toChordSymbolString(key)](#Chord+toChordSymbolString) ⇒ <code>string</code>
|
|
1044
|
+
* [.toChordSymbol([key])](#Chord+toChordSymbol) ⇒ [<code>Chord</code>](#Chord)
|
|
1045
|
+
* [.toChordSymbolString([key])](#Chord+toChordSymbolString) ⇒ <code>string</code>
|
|
1177
1046
|
* [.isChordSymbol()](#Chord+isChordSymbol) ⇒ <code>boolean</code>
|
|
1178
|
-
* [.toNumeric(key)](#Chord+toNumeric) ⇒ [<code>Chord</code>](#Chord)
|
|
1047
|
+
* [.toNumeric([key])](#Chord+toNumeric) ⇒ [<code>Chord</code>](#Chord)
|
|
1048
|
+
* [.toNumeral(key)](#Chord+toNumeral) ⇒ [<code>Chord</code>](#Chord)
|
|
1049
|
+
* [.toNumeralString([key])](#Chord+toNumeralString) ⇒ <code>string</code>
|
|
1179
1050
|
* [.isNumeric()](#Chord+isNumeric) ⇒ <code>boolean</code>
|
|
1180
|
-
* [.toNumericString(key)](#Chord+toNumericString) ⇒ <code>string</code>
|
|
1051
|
+
* [.toNumericString([key])](#Chord+toNumericString) ⇒ <code>string</code>
|
|
1052
|
+
* [.isNumeral()](#Chord+isNumeral) ⇒ <code>boolean</code>
|
|
1181
1053
|
* [.toString()](#Chord+toString) ⇒ <code>string</code>
|
|
1182
1054
|
* [.normalize()](#Chord+normalize) ⇒ [<code>Chord</code>](#Chord)
|
|
1183
1055
|
* [.useModifier(newModifier)](#Chord+useModifier) ⇒ [<code>Chord</code>](#Chord)
|
|
@@ -1190,154 +1062,189 @@ Represents a Chord, consisting of a root, suffix (quality) and bass
|
|
|
1190
1062
|
<a name="Chord+clone"></a>
|
|
1191
1063
|
|
|
1192
1064
|
### chord.clone() ⇒ [<code>Chord</code>](#Chord)
|
|
1193
|
-
Returns a deep copy of the chord
|
|
1065
|
+
<p>Returns a deep copy of the chord</p>
|
|
1194
1066
|
|
|
1195
1067
|
**Kind**: instance method of [<code>Chord</code>](#Chord)
|
|
1196
1068
|
<a name="Chord+toChordSymbol"></a>
|
|
1197
1069
|
|
|
1198
|
-
### chord.toChordSymbol(key) ⇒ [<code>Chord</code>](#Chord)
|
|
1199
|
-
Converts the chord to a chord symbol, using the supplied key as a reference.
|
|
1200
|
-
For example, a numeric chord
|
|
1201
|
-
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>
|
|
1202
1074
|
|
|
1203
1075
|
**Kind**: instance method of [<code>Chord</code>](#Chord)
|
|
1204
|
-
**Returns**: [<code>Chord</code>](#Chord) - the chord symbol
|
|
1076
|
+
**Returns**: [<code>Chord</code>](#Chord) - <p>the chord symbol</p>
|
|
1205
1077
|
|
|
1206
|
-
| Param | Type | Description |
|
|
1207
|
-
| --- | --- | --- |
|
|
1208
|
-
| 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> |
|
|
1209
1081
|
|
|
1210
1082
|
<a name="Chord+toChordSymbolString"></a>
|
|
1211
1083
|
|
|
1212
|
-
### chord.toChordSymbolString(key) ⇒ <code>string</code>
|
|
1213
|
-
Converts the chord to a chord symbol string, using the supplied key as a reference.
|
|
1214
|
-
For example, a numeric chord
|
|
1215
|
-
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>
|
|
1216
1088
|
|
|
1217
1089
|
**Kind**: instance method of [<code>Chord</code>](#Chord)
|
|
1218
|
-
**Returns**: <code>string</code> - the chord symbol string
|
|
1090
|
+
**Returns**: <code>string</code> - <p>the chord symbol string</p>
|
|
1219
1091
|
**See**: {toChordSymbol}
|
|
1220
1092
|
|
|
1221
|
-
| Param | Type | Description |
|
|
1222
|
-
| --- | --- | --- |
|
|
1223
|
-
| 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> |
|
|
1224
1096
|
|
|
1225
1097
|
<a name="Chord+isChordSymbol"></a>
|
|
1226
1098
|
|
|
1227
1099
|
### chord.isChordSymbol() ⇒ <code>boolean</code>
|
|
1228
|
-
Determines whether the chord is a chord symbol
|
|
1100
|
+
<p>Determines whether the chord is a chord symbol</p>
|
|
1229
1101
|
|
|
1230
1102
|
**Kind**: instance method of [<code>Chord</code>](#Chord)
|
|
1231
1103
|
<a name="Chord+toNumeric"></a>
|
|
1232
1104
|
|
|
1233
|
-
### chord.toNumeric(key) ⇒ [<code>Chord</code>](#Chord)
|
|
1234
|
-
Converts the chord to a numeric chord, using the supplied
|
|
1235
|
-
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>
|
|
1236
1108
|
|
|
1237
1109
|
**Kind**: instance method of [<code>Chord</code>](#Chord)
|
|
1238
|
-
**Returns**: [<code>Chord</code>](#Chord) - the numeric chord
|
|
1110
|
+
**Returns**: [<code>Chord</code>](#Chord) - <p>the numeric chord</p>
|
|
1239
1111
|
|
|
1240
|
-
| Param | Type | Description |
|
|
1241
|
-
| --- | --- | --- |
|
|
1242
|
-
| 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> |
|
|
1115
|
+
|
|
1116
|
+
<a name="Chord+toNumeral"></a>
|
|
1117
|
+
|
|
1118
|
+
### chord.toNumeral(key) ⇒ [<code>Chord</code>](#Chord)
|
|
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>
|
|
1121
|
+
|
|
1122
|
+
**Kind**: instance method of [<code>Chord</code>](#Chord)
|
|
1123
|
+
**Returns**: [<code>Chord</code>](#Chord) - <p>the numeral chord</p>
|
|
1124
|
+
|
|
1125
|
+
| Param | Type | Default | Description |
|
|
1126
|
+
| --- | --- | --- | --- |
|
|
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> |
|
|
1128
|
+
|
|
1129
|
+
<a name="Chord+toNumeralString"></a>
|
|
1130
|
+
|
|
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>
|
|
1134
|
+
|
|
1135
|
+
**Kind**: instance method of [<code>Chord</code>](#Chord)
|
|
1136
|
+
**Returns**: <code>string</code> - <p>the numeral chord string</p>
|
|
1137
|
+
**See**: {toNumeral}
|
|
1138
|
+
|
|
1139
|
+
| Param | Type | Default | Description |
|
|
1140
|
+
| --- | --- | --- | --- |
|
|
1141
|
+
| [key] | <code>Key</code> \| <code>string</code> | <code></code> | <p>the reference key</p> |
|
|
1243
1142
|
|
|
1244
1143
|
<a name="Chord+isNumeric"></a>
|
|
1245
1144
|
|
|
1246
1145
|
### chord.isNumeric() ⇒ <code>boolean</code>
|
|
1247
|
-
Determines whether the chord is numeric
|
|
1146
|
+
<p>Determines whether the chord is numeric</p>
|
|
1248
1147
|
|
|
1249
1148
|
**Kind**: instance method of [<code>Chord</code>](#Chord)
|
|
1250
1149
|
<a name="Chord+toNumericString"></a>
|
|
1251
1150
|
|
|
1252
|
-
### chord.toNumericString(key) ⇒ <code>string</code>
|
|
1253
|
-
Converts the chord to a numeric chord string, using the supplied kye as a reference.
|
|
1254
|
-
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>
|
|
1255
1154
|
|
|
1256
1155
|
**Kind**: instance method of [<code>Chord</code>](#Chord)
|
|
1257
|
-
**Returns**: <code>string</code> - the numeric chord string
|
|
1156
|
+
**Returns**: <code>string</code> - <p>the numeric chord string</p>
|
|
1258
1157
|
**See**: {toNumeric}
|
|
1259
1158
|
|
|
1260
|
-
| Param | Type | Description |
|
|
1261
|
-
| --- | --- | --- |
|
|
1262
|
-
| 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> |
|
|
1162
|
+
|
|
1163
|
+
<a name="Chord+isNumeral"></a>
|
|
1164
|
+
|
|
1165
|
+
### chord.isNumeral() ⇒ <code>boolean</code>
|
|
1166
|
+
<p>Determines whether the chord is a numeral</p>
|
|
1263
1167
|
|
|
1168
|
+
**Kind**: instance method of [<code>Chord</code>](#Chord)
|
|
1264
1169
|
<a name="Chord+toString"></a>
|
|
1265
1170
|
|
|
1266
1171
|
### chord.toString() ⇒ <code>string</code>
|
|
1267
|
-
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>
|
|
1268
1173
|
|
|
1269
1174
|
**Kind**: instance method of [<code>Chord</code>](#Chord)
|
|
1270
|
-
**Returns**: <code>string</code> - the chord string
|
|
1175
|
+
**Returns**: <code>string</code> - <p>the chord string</p>
|
|
1271
1176
|
<a name="Chord+normalize"></a>
|
|
1272
1177
|
|
|
1273
1178
|
### chord.normalize() ⇒ [<code>Chord</code>](#Chord)
|
|
1274
|
-
Normalizes the chord
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
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>
|
|
1285
1192
|
|
|
1286
1193
|
**Kind**: instance method of [<code>Chord</code>](#Chord)
|
|
1287
|
-
**Returns**: [<code>Chord</code>](#Chord) - the normalized chord
|
|
1194
|
+
**Returns**: [<code>Chord</code>](#Chord) - <p>the normalized chord</p>
|
|
1288
1195
|
<a name="Chord+useModifier"></a>
|
|
1289
1196
|
|
|
1290
1197
|
### chord.useModifier(newModifier) ⇒ [<code>Chord</code>](#Chord)
|
|
1291
|
-
Switches to the specified modifier
|
|
1198
|
+
<p>Switches to the specified modifier</p>
|
|
1292
1199
|
|
|
1293
1200
|
**Kind**: instance method of [<code>Chord</code>](#Chord)
|
|
1294
|
-
**Returns**: [<code>Chord</code>](#Chord) - the new, changed chord
|
|
1201
|
+
**Returns**: [<code>Chord</code>](#Chord) - <p>the new, changed chord</p>
|
|
1295
1202
|
|
|
1296
1203
|
| Param | Description |
|
|
1297
1204
|
| --- | --- |
|
|
1298
|
-
| newModifier | the modifier to use:
|
|
1205
|
+
| newModifier | <p>the modifier to use: <code>'#'</code> or <code>'b'</code></p> |
|
|
1299
1206
|
|
|
1300
1207
|
<a name="Chord+transposeUp"></a>
|
|
1301
1208
|
|
|
1302
1209
|
### chord.transposeUp() ⇒ [<code>Chord</code>](#Chord)
|
|
1303
|
-
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>
|
|
1304
1211
|
|
|
1305
1212
|
**Kind**: instance method of [<code>Chord</code>](#Chord)
|
|
1306
|
-
**Returns**: [<code>Chord</code>](#Chord) - the new, transposed chord
|
|
1213
|
+
**Returns**: [<code>Chord</code>](#Chord) - <p>the new, transposed chord</p>
|
|
1307
1214
|
<a name="Chord+transposeDown"></a>
|
|
1308
1215
|
|
|
1309
1216
|
### chord.transposeDown() ⇒ [<code>Chord</code>](#Chord)
|
|
1310
|
-
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>
|
|
1311
1218
|
|
|
1312
1219
|
**Kind**: instance method of [<code>Chord</code>](#Chord)
|
|
1313
|
-
**Returns**: [<code>Chord</code>](#Chord) - the new, transposed chord
|
|
1220
|
+
**Returns**: [<code>Chord</code>](#Chord) - <p>the new, transposed chord</p>
|
|
1314
1221
|
<a name="Chord+transpose"></a>
|
|
1315
1222
|
|
|
1316
1223
|
### chord.transpose(delta) ⇒ [<code>Chord</code>](#Chord)
|
|
1317
|
-
Transposes the chord by the specified number of semitones
|
|
1224
|
+
<p>Transposes the chord by the specified number of semitones</p>
|
|
1318
1225
|
|
|
1319
1226
|
**Kind**: instance method of [<code>Chord</code>](#Chord)
|
|
1320
|
-
**Returns**: [<code>Chord</code>](#Chord) - the new, transposed chord
|
|
1227
|
+
**Returns**: [<code>Chord</code>](#Chord) - <p>the new, transposed chord</p>
|
|
1321
1228
|
|
|
1322
1229
|
| Param | Description |
|
|
1323
1230
|
| --- | --- |
|
|
1324
|
-
| delta | de number of semitones |
|
|
1231
|
+
| delta | <p>de number of semitones</p> |
|
|
1325
1232
|
|
|
1326
1233
|
<a name="Chord.parse"></a>
|
|
1327
1234
|
|
|
1328
1235
|
### Chord.parse(chordString) ⇒ <code>null</code> \| [<code>Chord</code>](#Chord)
|
|
1329
|
-
Tries to parse a chord string into a chord
|
|
1236
|
+
<p>Tries to parse a chord string into a chord</p>
|
|
1330
1237
|
|
|
1331
1238
|
**Kind**: static method of [<code>Chord</code>](#Chord)
|
|
1332
1239
|
|
|
1333
1240
|
| Param | Description |
|
|
1334
1241
|
| --- | --- |
|
|
1335
|
-
| chordString | the chord string, eg
|
|
1242
|
+
| chordString | <p>the chord string, eg <code>Esus4/G#</code> or <code>1sus4/#3</code></p> |
|
|
1336
1243
|
|
|
1337
1244
|
<a name="ChordSheetSerializer"></a>
|
|
1338
1245
|
|
|
1339
1246
|
## ChordSheetSerializer
|
|
1340
|
-
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>
|
|
1341
1248
|
|
|
1342
1249
|
**Kind**: global class
|
|
1343
1250
|
|
|
@@ -1348,208 +1255,239 @@ Serializes a song into een plain object, and deserializes the serialized object
|
|
|
1348
1255
|
<a name="ChordSheetSerializer+serialize"></a>
|
|
1349
1256
|
|
|
1350
1257
|
### chordSheetSerializer.serialize() ⇒
|
|
1351
|
-
Serializes the chord sheet to a plain object, which can be converted to any format like JSON, XML etc
|
|
1352
|
-
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>
|
|
1353
1260
|
|
|
1354
1261
|
**Kind**: instance method of [<code>ChordSheetSerializer</code>](#ChordSheetSerializer)
|
|
1355
|
-
**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>
|
|
1356
1263
|
<a name="ChordSheetSerializer+deserialize"></a>
|
|
1357
1264
|
|
|
1358
1265
|
### chordSheetSerializer.deserialize(serializedSong) ⇒ [<code>Song</code>](#Song)
|
|
1359
|
-
Deserializes a song that has been serialized using [serialize](serialize)
|
|
1266
|
+
<p>Deserializes a song that has been serialized using [serialize](serialize)</p>
|
|
1360
1267
|
|
|
1361
1268
|
**Kind**: instance method of [<code>ChordSheetSerializer</code>](#ChordSheetSerializer)
|
|
1362
|
-
**Returns**: [<code>Song</code>](#Song) - The deserialized song
|
|
1269
|
+
**Returns**: [<code>Song</code>](#Song) - <p>The deserialized song</p>
|
|
1363
1270
|
|
|
1364
1271
|
| Param | Type | Description |
|
|
1365
1272
|
| --- | --- | --- |
|
|
1366
|
-
| serializedSong | <code>object</code> | The serialized song |
|
|
1273
|
+
| serializedSong | <code>object</code> | <p>The serialized song</p> |
|
|
1367
1274
|
|
|
1368
1275
|
<a name="ALBUM"></a>
|
|
1369
1276
|
|
|
1370
1277
|
## ALBUM : <code>string</code>
|
|
1371
|
-
|
|
1278
|
+
<p>Artist meta directive. See https://www.chordpro.org/chordpro/directives-artist/</p>
|
|
1372
1279
|
|
|
1373
|
-
**Kind**: global
|
|
1280
|
+
**Kind**: global variable
|
|
1374
1281
|
<a name="ARTIST"></a>
|
|
1375
1282
|
|
|
1376
1283
|
## ARTIST : <code>string</code>
|
|
1377
|
-
|
|
1284
|
+
<p>Capo meta directive. See https://www.chordpro.org/chordpro/directives-capo/</p>
|
|
1378
1285
|
|
|
1379
|
-
**Kind**: global
|
|
1286
|
+
**Kind**: global variable
|
|
1380
1287
|
<a name="CAPO"></a>
|
|
1381
1288
|
|
|
1382
1289
|
## CAPO : <code>string</code>
|
|
1383
|
-
|
|
1290
|
+
<p>Comment directive. See https://www.chordpro.org/chordpro/directives-comment/</p>
|
|
1384
1291
|
|
|
1385
|
-
**Kind**: global
|
|
1292
|
+
**Kind**: global variable
|
|
1386
1293
|
<a name="COMMENT"></a>
|
|
1387
1294
|
|
|
1388
1295
|
## COMMENT : <code>string</code>
|
|
1389
|
-
|
|
1296
|
+
<p>Composer meta directive. See https://www.chordpro.org/chordpro/directives-composer/</p>
|
|
1390
1297
|
|
|
1391
|
-
**Kind**: global
|
|
1298
|
+
**Kind**: global variable
|
|
1392
1299
|
<a name="COMPOSER"></a>
|
|
1393
1300
|
|
|
1394
1301
|
## COMPOSER : <code>string</code>
|
|
1395
|
-
|
|
1302
|
+
<p>Copyright meta directive. See https://www.chordpro.org/chordpro/directives-copyright/</p>
|
|
1396
1303
|
|
|
1397
|
-
**Kind**: global
|
|
1304
|
+
**Kind**: global variable
|
|
1398
1305
|
<a name="COPYRIGHT"></a>
|
|
1399
1306
|
|
|
1400
1307
|
## COPYRIGHT : <code>string</code>
|
|
1401
|
-
|
|
1308
|
+
<p>Duration meta directive. See https://www.chordpro.org/chordpro/directives-duration/</p>
|
|
1402
1309
|
|
|
1403
|
-
**Kind**: global
|
|
1310
|
+
**Kind**: global variable
|
|
1404
1311
|
<a name="DURATION"></a>
|
|
1405
1312
|
|
|
1406
1313
|
## DURATION : <code>string</code>
|
|
1407
|
-
|
|
1314
|
+
<p>End of chorus directive. See https://www.chordpro.org/chordpro/directives-env_chorus/</p>
|
|
1408
1315
|
|
|
1409
|
-
**Kind**: global
|
|
1316
|
+
**Kind**: global variable
|
|
1410
1317
|
<a name="END_OF_CHORUS"></a>
|
|
1411
1318
|
|
|
1412
1319
|
## END\_OF\_CHORUS : <code>string</code>
|
|
1413
|
-
End of
|
|
1320
|
+
<p>End of tab directive. See https://www.chordpro.org/chordpro/directives-env_tab/</p>
|
|
1414
1321
|
|
|
1415
|
-
**Kind**: global
|
|
1322
|
+
**Kind**: global variable
|
|
1416
1323
|
<a name="END_OF_TAB"></a>
|
|
1417
1324
|
|
|
1418
1325
|
## END\_OF\_TAB : <code>string</code>
|
|
1419
|
-
End of
|
|
1326
|
+
<p>End of verse directive. See https://www.chordpro.org/chordpro/directives-env_verse/</p>
|
|
1420
1327
|
|
|
1421
|
-
**Kind**: global
|
|
1328
|
+
**Kind**: global variable
|
|
1422
1329
|
<a name="END_OF_VERSE"></a>
|
|
1423
1330
|
|
|
1424
1331
|
## END\_OF\_VERSE : <code>string</code>
|
|
1425
|
-
|
|
1332
|
+
<p>Key meta directive. See https://www.chordpro.org/chordpro/directives-key/</p>
|
|
1426
1333
|
|
|
1427
|
-
**Kind**: global
|
|
1334
|
+
**Kind**: global variable
|
|
1428
1335
|
<a name="KEY"></a>
|
|
1429
1336
|
|
|
1430
1337
|
## KEY : <code>string</code>
|
|
1431
|
-
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>
|
|
1432
1339
|
|
|
1433
|
-
**Kind**: global
|
|
1340
|
+
**Kind**: global variable
|
|
1434
1341
|
<a name="_KEY"></a>
|
|
1435
1342
|
|
|
1436
1343
|
## \_KEY : <code>string</code>
|
|
1437
|
-
|
|
1344
|
+
<p>Lyricist meta directive. See https://www.chordpro.org/chordpro/directives-lyricist/</p>
|
|
1438
1345
|
|
|
1439
|
-
**Kind**: global
|
|
1346
|
+
**Kind**: global variable
|
|
1440
1347
|
<a name="LYRICIST"></a>
|
|
1441
1348
|
|
|
1442
1349
|
## LYRICIST : <code>string</code>
|
|
1443
|
-
|
|
1350
|
+
<p>Start of chorus directive. See https://www.chordpro.org/chordpro/directives-env_chorus/</p>
|
|
1444
1351
|
|
|
1445
|
-
**Kind**: global
|
|
1352
|
+
**Kind**: global variable
|
|
1446
1353
|
<a name="START_OF_CHORUS"></a>
|
|
1447
1354
|
|
|
1448
1355
|
## START\_OF\_CHORUS : <code>string</code>
|
|
1449
|
-
Start of
|
|
1356
|
+
<p>Start of tab directive. See https://www.chordpro.org/chordpro/directives-env_tab/</p>
|
|
1450
1357
|
|
|
1451
|
-
**Kind**: global
|
|
1358
|
+
**Kind**: global variable
|
|
1452
1359
|
<a name="START_OF_TAB"></a>
|
|
1453
1360
|
|
|
1454
1361
|
## START\_OF\_TAB : <code>string</code>
|
|
1455
|
-
Start of
|
|
1362
|
+
<p>Start of verse directive. See https://www.chordpro.org/chordpro/directives-env_verse/</p>
|
|
1456
1363
|
|
|
1457
|
-
**Kind**: global
|
|
1364
|
+
**Kind**: global variable
|
|
1458
1365
|
<a name="START_OF_VERSE"></a>
|
|
1459
1366
|
|
|
1460
1367
|
## START\_OF\_VERSE : <code>string</code>
|
|
1461
|
-
|
|
1368
|
+
<p>Subtitle meta directive. See https://www.chordpro.org/chordpro/directives-subtitle/</p>
|
|
1462
1369
|
|
|
1463
|
-
**Kind**: global
|
|
1370
|
+
**Kind**: global variable
|
|
1464
1371
|
<a name="SUBTITLE"></a>
|
|
1465
1372
|
|
|
1466
1373
|
## SUBTITLE : <code>string</code>
|
|
1467
|
-
|
|
1374
|
+
<p>Tempo meta directive. See https://www.chordpro.org/chordpro/directives-tempo/</p>
|
|
1468
1375
|
|
|
1469
|
-
**Kind**: global
|
|
1376
|
+
**Kind**: global variable
|
|
1470
1377
|
<a name="TEMPO"></a>
|
|
1471
1378
|
|
|
1472
1379
|
## TEMPO : <code>string</code>
|
|
1473
|
-
|
|
1380
|
+
<p>Time meta directive. See https://www.chordpro.org/chordpro/directives-time/</p>
|
|
1474
1381
|
|
|
1475
|
-
**Kind**: global
|
|
1382
|
+
**Kind**: global variable
|
|
1476
1383
|
<a name="TIME"></a>
|
|
1477
1384
|
|
|
1478
1385
|
## TIME : <code>string</code>
|
|
1479
|
-
|
|
1386
|
+
<p>Title meta directive. See https://www.chordpro.org/chordpro/directives-title/</p>
|
|
1480
1387
|
|
|
1481
|
-
**Kind**: global
|
|
1388
|
+
**Kind**: global variable
|
|
1482
1389
|
<a name="TITLE"></a>
|
|
1483
1390
|
|
|
1484
1391
|
## TITLE : <code>string</code>
|
|
1485
|
-
|
|
1392
|
+
<p>Transpose meta directive. See: https://www.chordpro.org/chordpro/directives-transpose/</p>
|
|
1486
1393
|
|
|
1487
|
-
**Kind**: global
|
|
1488
|
-
<a name="
|
|
1394
|
+
**Kind**: global variable
|
|
1395
|
+
<a name="TRANSPOSE"></a>
|
|
1489
1396
|
|
|
1490
|
-
##
|
|
1491
|
-
|
|
1397
|
+
## TRANSPOSE : <code>string</code>
|
|
1398
|
+
<p>New Key meta directive. See: https://github.com/PraiseCharts/ChordChartJS/issues/53</p>
|
|
1399
|
+
|
|
1400
|
+
**Kind**: global variable
|
|
1401
|
+
<a name="NEW_KEY"></a>
|
|
1402
|
+
|
|
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> |
|
|
1492
1418
|
|
|
1493
|
-
**Kind**: global constant
|
|
1494
1419
|
<a name="defaultCss"></a>
|
|
1495
1420
|
|
|
1496
1421
|
## defaultCss : <code>Object.<string, Object.<string, string>></code>
|
|
1497
|
-
Basic CSS, in object style à la useStyles, to use with output generated by {@link }HtmlTableFormatter}
|
|
1498
|
-
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>
|
|
1499
1424
|
|
|
1500
1425
|
**Kind**: global constant
|
|
1501
1426
|
<a name="VERSE"></a>
|
|
1502
1427
|
|
|
1503
1428
|
## VERSE : <code>string</code>
|
|
1504
|
-
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>
|
|
1505
1436
|
|
|
1506
1437
|
**Kind**: global constant
|
|
1507
1438
|
<a name="CHORUS"></a>
|
|
1508
1439
|
|
|
1509
1440
|
## CHORUS : <code>string</code>
|
|
1510
|
-
Used to mark a paragraph as
|
|
1441
|
+
<p>Used to mark a paragraph as not containing a line marked with a type</p>
|
|
1511
1442
|
|
|
1512
1443
|
**Kind**: global constant
|
|
1513
1444
|
<a name="NONE"></a>
|
|
1514
1445
|
|
|
1515
1446
|
## NONE : <code>string</code>
|
|
1516
|
-
Used to mark a paragraph as
|
|
1447
|
+
<p>Used to mark a paragraph as containing lines with both verse and chorus type</p>
|
|
1517
1448
|
|
|
1518
1449
|
**Kind**: global constant
|
|
1519
1450
|
<a name="INDETERMINATE"></a>
|
|
1520
1451
|
|
|
1521
1452
|
## INDETERMINATE : <code>string</code>
|
|
1522
|
-
Used to mark a paragraph as
|
|
1453
|
+
<p>Used to mark a paragraph as tab</p>
|
|
1523
1454
|
|
|
1524
1455
|
**Kind**: global constant
|
|
1525
|
-
<a name="
|
|
1526
|
-
|
|
1527
|
-
## TAB : <code>string</code>
|
|
1528
|
-
Used to mark a paragraph as tab
|
|
1456
|
+
<a name="parseChord"></a>
|
|
1529
1457
|
|
|
1530
|
-
|
|
1531
|
-
|
|
1458
|
+
## ~~parseChord(chordString) ⇒ <code>null</code> \| [<code>Chord</code>](#Chord)~~
|
|
1459
|
+
***Deprecated***
|
|
1532
1460
|
|
|
1533
|
-
|
|
1534
|
-
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>
|
|
1535
1462
|
|
|
1536
1463
|
**Kind**: global function
|
|
1537
|
-
**Returns**: <code>string</code> - the CSS string
|
|
1538
1464
|
|
|
1539
1465
|
| Param | Description |
|
|
1540
1466
|
| --- | --- |
|
|
1541
|
-
|
|
|
1467
|
+
| chordString | <p>the chord string, eg Esus4/G# or 1sus4/#3</p> |
|
|
1542
1468
|
|
|
1543
|
-
<a name="
|
|
1469
|
+
<a name="getCapos"></a>
|
|
1544
1470
|
|
|
1545
|
-
##
|
|
1546
|
-
|
|
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> |
|
|
1547
1481
|
|
|
1548
|
-
|
|
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>
|
|
1549
1486
|
|
|
1550
1487
|
**Kind**: global function
|
|
1488
|
+
**Returns**: <code>Array.<string></code> - <p>The available keys</p>
|
|
1551
1489
|
|
|
1552
|
-
| Param | Description |
|
|
1553
|
-
| --- | --- |
|
|
1554
|
-
|
|
|
1490
|
+
| Param | Type | Description |
|
|
1491
|
+
| --- | --- | --- |
|
|
1492
|
+
| key | <code>Key</code> \| <code>string</code> | <p>The key to get keys for</p> |
|
|
1555
1493
|
|