chordsheetjs 7.7.0 → 7.8.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 +124 -119
- package/lib/bundle.js +7087 -4221
- package/lib/index.js +7087 -4221
- package/lib/index.js.map +1 -1
- package/lib/main.d.ts +581 -527
- package/lib/main.d.ts.map +1 -1
- package/lib/module.js +7087 -4222
- package/lib/module.js.map +1 -1
- package/package.json +10 -5
package/README.md
CHANGED
|
@@ -379,7 +379,7 @@ metadata.get('author') // => 'John'</p>
|
|
|
379
379
|
<dt><a href="#HtmlDivFormatter">HtmlDivFormatter</a></dt>
|
|
380
380
|
<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>
|
|
381
381
|
<dt><a href="#HtmlFormatter">HtmlFormatter</a></dt>
|
|
382
|
-
<dd><p>Acts as a base class for HTML formatters
|
|
382
|
+
<dd><p>Acts as a base class for HTML formatters</p></dd>
|
|
383
383
|
<dt><a href="#HtmlTableFormatter">HtmlTableFormatter</a></dt>
|
|
384
384
|
<dd><p>Formats a song into HTML. It uses TABLEs to align lyrics with chords, which makes the HTML for things like
|
|
385
385
|
PDF conversion.</p></dd>
|
|
@@ -389,8 +389,12 @@ PDF conversion.</p></dd>
|
|
|
389
389
|
<dd><p>Parses a ChordPro chord sheet</p></dd>
|
|
390
390
|
<dt><a href="#ChordSheetParser">ChordSheetParser</a></dt>
|
|
391
391
|
<dd><p>Parses a normal chord sheet</p></dd>
|
|
392
|
+
<dt><a href="#ChordsOverWordsParser">ChordsOverWordsParser</a></dt>
|
|
393
|
+
<dd><p>Parses a chords over words sheet</p></dd>
|
|
392
394
|
<dt><a href="#ParserWarning">ParserWarning</a></dt>
|
|
393
395
|
<dd><p>Represents a parser warning, currently only used by ChordProParser.</p></dd>
|
|
396
|
+
<dt><a href="#PegBasedParser">PegBasedParser</a></dt>
|
|
397
|
+
<dd><p>Parses a chords over words sheet</p></dd>
|
|
394
398
|
<dt><a href="#UltimateGuitarParser">UltimateGuitarParser</a></dt>
|
|
395
399
|
<dd><p>Parses an Ultimate Guitar chord sheet with metadata
|
|
396
400
|
Inherits from [ChordSheetParser](#ChordSheetParser)</p></dd>
|
|
@@ -453,6 +457,8 @@ See https://www.chordpro.org/chordpro/directives-key/</p></dd>
|
|
|
453
457
|
<dd><p>Year meta directive. See https://www.chordpro.org/chordpro/directives-year/</p></dd>
|
|
454
458
|
<dt><a href="#defaultCss">defaultCss</a> ⇒ <code>string</code></dt>
|
|
455
459
|
<dd><p>Generates basic CSS, scoped within the provided selector, to use with output generated by [HtmlTableFormatter](#HtmlTableFormatter)</p></dd>
|
|
460
|
+
<dt><a href="#defaultCss">defaultCss</a> ⇒ <code>string</code></dt>
|
|
461
|
+
<dd><p>Generates basic CSS, scoped within the provided selector, to use with output generated by [HtmlTableFormatter](#HtmlTableFormatter)</p></dd>
|
|
456
462
|
</dl>
|
|
457
463
|
|
|
458
464
|
## Constants
|
|
@@ -476,7 +482,7 @@ For a CSS string see [scopedCss](scopedCss)</p></dd>
|
|
|
476
482
|
## Functions
|
|
477
483
|
|
|
478
484
|
<dl>
|
|
479
|
-
<dt><del><a href="#parseChord">parseChord(chordString)</a> ⇒ <code
|
|
485
|
+
<dt><del><a href="#parseChord">parseChord(chordString)</a> ⇒ <code><a href="#Chord">Chord</a></code> | <code>null</code></del></dt>
|
|
480
486
|
<dd><p>Tries to parse a chord string into a chord</p></dd>
|
|
481
487
|
<dt><a href="#getCapos">getCapos(key)</a> ⇒ <code>Object.<string, string></code></dt>
|
|
482
488
|
<dd><p>Returns applicable capos for the provided key</p></dd>
|
|
@@ -504,10 +510,10 @@ For a CSS string see [scopedCss](scopedCss)</p></dd>
|
|
|
504
510
|
<p>Initialises a ChordLyricsPair</p>
|
|
505
511
|
|
|
506
512
|
|
|
507
|
-
| Param | Type | Description |
|
|
508
|
-
| --- | --- | --- |
|
|
509
|
-
| chords | <code>string</code> | <p>The chords</p> |
|
|
510
|
-
| lyrics | <code>string</code> | <p>The lyrics</p> |
|
|
513
|
+
| Param | Type | Default | Description |
|
|
514
|
+
| --- | --- | --- | --- |
|
|
515
|
+
| chords | <code>string</code> | | <p>The chords</p> |
|
|
516
|
+
| lyrics | <code>string</code> | <code>null</code> | <p>The lyrics</p> |
|
|
511
517
|
|
|
512
518
|
<a name="ChordLyricsPair+chords"></a>
|
|
513
519
|
|
|
@@ -573,7 +579,7 @@ metadata.get('author') // => 'John'</p>
|
|
|
573
579
|
<a name="Metadata+get"></a>
|
|
574
580
|
|
|
575
581
|
### metadata.get(prop) ⇒ <code>Array.<String></code> \| <code>String</code>
|
|
576
|
-
<p>Reads a metadata value by key. This method supports simple value lookup, as fetching single array values.</p>
|
|
582
|
+
<p>Reads a metadata value by key. This method supports simple value lookup, as well as fetching single array values.</p>
|
|
577
583
|
<p>This method deprecates direct property access, eg: metadata['author']</p>
|
|
578
584
|
<p>Examples:</p>
|
|
579
585
|
<p>const metadata = new Metadata({ lyricist: 'Pete', author: ['John', 'Mary'] });
|
|
@@ -875,7 +881,7 @@ song.mapLines((line) => {
|
|
|
875
881
|
* [Tag](#Tag)
|
|
876
882
|
* [.name](#Tag+name) : <code>string</code>
|
|
877
883
|
* [.originalName](#Tag+originalName) : <code>string</code>
|
|
878
|
-
* [.value](#Tag+value) : <code>string</code>
|
|
884
|
+
* [.value](#Tag+value) : <code>string</code>
|
|
879
885
|
* [.hasValue()](#Tag+hasValue) ⇒ <code>boolean</code>
|
|
880
886
|
* [.isRenderable()](#Tag+isRenderable) ⇒ <code>boolean</code>
|
|
881
887
|
* [.isMetaTag()](#Tag+isMetaTag) ⇒ <code>boolean</code>
|
|
@@ -895,7 +901,7 @@ song.mapLines((line) => {
|
|
|
895
901
|
**Kind**: instance property of [<code>Tag</code>](#Tag)
|
|
896
902
|
<a name="Tag+value"></a>
|
|
897
903
|
|
|
898
|
-
### tag.value : <code>string</code>
|
|
904
|
+
### tag.value : <code>string</code>
|
|
899
905
|
<p>The tag value</p>
|
|
900
906
|
|
|
901
907
|
**Kind**: instance property of [<code>Tag</code>](#Tag)
|
|
@@ -967,63 +973,80 @@ song.mapLines((line) => {
|
|
|
967
973
|
<p>Formats a song into HTML. It uses DIVs to align lyrics with chords, which makes it useful for responsive web pages.</p>
|
|
968
974
|
|
|
969
975
|
**Kind**: global class
|
|
976
|
+
<a name="HtmlFormatter"></a>
|
|
970
977
|
|
|
971
|
-
|
|
978
|
+
## HtmlFormatter
|
|
979
|
+
<p>Acts as a base class for HTML formatters</p>
|
|
980
|
+
|
|
981
|
+
**Kind**: global class
|
|
982
|
+
|
|
983
|
+
* [HtmlFormatter](#HtmlFormatter)
|
|
972
984
|
* _instance_
|
|
973
|
-
* [.
|
|
985
|
+
* [.cssObject](#HtmlFormatter+cssObject) ⇒ <code>Object.<string, Object.<string, string>></code>
|
|
986
|
+
* [.format(song)](#HtmlFormatter+format) ⇒ <code>string</code>
|
|
987
|
+
* [.cssString(scope)](#HtmlFormatter+cssString) ⇒ <code>string</code>
|
|
974
988
|
* _static_
|
|
975
|
-
* [.cssString(
|
|
976
|
-
* [.cssObject()](#
|
|
989
|
+
* ~~[.cssString()](#HtmlFormatter.cssString)~~
|
|
990
|
+
* ~~[.cssObject()](#HtmlFormatter.cssObject)~~
|
|
977
991
|
|
|
978
|
-
<a name="
|
|
992
|
+
<a name="HtmlFormatter+cssObject"></a>
|
|
979
993
|
|
|
980
|
-
###
|
|
994
|
+
### htmlFormatter.cssObject ⇒ <code>Object.<string, Object.<string, string>></code>
|
|
995
|
+
<p>Basic CSS, in object style à la useStyles, to use with the HTML output
|
|
996
|
+
For a CSS string see [cssString](cssString)</p>
|
|
997
|
+
<p>Example:</p>
|
|
998
|
+
<pre><code>'.paragraph': {
|
|
999
|
+
marginBottom: '1em'
|
|
1000
|
+
}
|
|
1001
|
+
</code></pre>
|
|
1002
|
+
|
|
1003
|
+
**Kind**: instance property of [<code>HtmlFormatter</code>](#HtmlFormatter)
|
|
1004
|
+
**Returns**: <code>Object.<string, Object.<string, string>></code> - <p>the CSS object</p>
|
|
1005
|
+
<a name="HtmlFormatter+format"></a>
|
|
1006
|
+
|
|
1007
|
+
### htmlFormatter.format(song) ⇒ <code>string</code>
|
|
981
1008
|
<p>Formats a song into HTML.</p>
|
|
982
1009
|
|
|
983
|
-
**Kind**: instance method of [<code>
|
|
1010
|
+
**Kind**: instance method of [<code>HtmlFormatter</code>](#HtmlFormatter)
|
|
984
1011
|
**Returns**: <code>string</code> - <p>The HTML string</p>
|
|
985
1012
|
|
|
986
1013
|
| Param | Type | Description |
|
|
987
1014
|
| --- | --- | --- |
|
|
988
1015
|
| song | [<code>Song</code>](#Song) | <p>The song to be formatted</p> |
|
|
989
1016
|
|
|
990
|
-
<a name="
|
|
1017
|
+
<a name="HtmlFormatter+cssString"></a>
|
|
991
1018
|
|
|
992
|
-
###
|
|
993
|
-
<p>Generates basic CSS, optionally scoped within the provided selector, to use with
|
|
994
|
-
[HtmlDivFormatter](#HtmlDivFormatter)</p>
|
|
1019
|
+
### htmlFormatter.cssString(scope) ⇒ <code>string</code>
|
|
1020
|
+
<p>Generates basic CSS, optionally scoped within the provided selector, to use with the HTML output</p>
|
|
995
1021
|
<p>For example, execute cssString('.chordSheetViewer') will result in CSS like:</p>
|
|
996
1022
|
<pre><code>.chordSheetViewer .paragraph {
|
|
997
1023
|
margin-bottom: 1em;
|
|
998
1024
|
}
|
|
999
1025
|
</code></pre>
|
|
1000
1026
|
|
|
1001
|
-
**Kind**:
|
|
1027
|
+
**Kind**: instance method of [<code>HtmlFormatter</code>](#HtmlFormatter)
|
|
1002
1028
|
**Returns**: <code>string</code> - <p>the CSS string</p>
|
|
1003
1029
|
|
|
1004
1030
|
| Param | Description |
|
|
1005
1031
|
| --- | --- |
|
|
1006
1032
|
| scope | <p>the CSS scope to use, for example <code>.chordSheetViewer</code></p> |
|
|
1007
1033
|
|
|
1008
|
-
<a name="
|
|
1034
|
+
<a name="HtmlFormatter.cssString"></a>
|
|
1009
1035
|
|
|
1010
|
-
###
|
|
1011
|
-
|
|
1012
|
-
<p>Example:</p>
|
|
1013
|
-
<pre><code>'.paragraph': {
|
|
1014
|
-
marginBottom: '1em'
|
|
1015
|
-
}
|
|
1016
|
-
</code></pre>
|
|
1017
|
-
<p>For a CSS string see [cssString](cssString)</p>
|
|
1036
|
+
### ~~HtmlFormatter.cssString()~~
|
|
1037
|
+
***Deprecated***
|
|
1018
1038
|
|
|
1019
|
-
|
|
1020
|
-
**Returns**: <code>Object.<string, Object.<string, string>></code> - <p>the CSS object</p>
|
|
1021
|
-
<a name="HtmlFormatter"></a>
|
|
1039
|
+
<p>Generates basic CSS, optionally scoped within the provided selector, to use with the HTML output</p>
|
|
1022
1040
|
|
|
1023
|
-
|
|
1024
|
-
<
|
|
1041
|
+
**Kind**: static method of [<code>HtmlFormatter</code>](#HtmlFormatter)
|
|
1042
|
+
<a name="HtmlFormatter.cssObject"></a>
|
|
1025
1043
|
|
|
1026
|
-
|
|
1044
|
+
### ~~HtmlFormatter.cssObject()~~
|
|
1045
|
+
***Deprecated***
|
|
1046
|
+
|
|
1047
|
+
<p>Basic CSS, in object style à la useStyles, to use with the HTML output</p>
|
|
1048
|
+
|
|
1049
|
+
**Kind**: static method of [<code>HtmlFormatter</code>](#HtmlFormatter)
|
|
1027
1050
|
<a name="HtmlTableFormatter"></a>
|
|
1028
1051
|
|
|
1029
1052
|
## HtmlTableFormatter
|
|
@@ -1031,57 +1054,6 @@ song.mapLines((line) => {
|
|
|
1031
1054
|
PDF conversion.</p>
|
|
1032
1055
|
|
|
1033
1056
|
**Kind**: global class
|
|
1034
|
-
|
|
1035
|
-
* [HtmlTableFormatter](#HtmlTableFormatter)
|
|
1036
|
-
* _instance_
|
|
1037
|
-
* [.format(song)](#HtmlTableFormatter+format) ⇒ <code>string</code>
|
|
1038
|
-
* _static_
|
|
1039
|
-
* [.cssString(scope)](#HtmlTableFormatter.cssString) ⇒ <code>string</code>
|
|
1040
|
-
* [.cssObject()](#HtmlTableFormatter.cssObject) ⇒ <code>Object.<string, Object.<string, string>></code>
|
|
1041
|
-
|
|
1042
|
-
<a name="HtmlTableFormatter+format"></a>
|
|
1043
|
-
|
|
1044
|
-
### htmlTableFormatter.format(song) ⇒ <code>string</code>
|
|
1045
|
-
<p>Formats a song into HTML.</p>
|
|
1046
|
-
|
|
1047
|
-
**Kind**: instance method of [<code>HtmlTableFormatter</code>](#HtmlTableFormatter)
|
|
1048
|
-
**Returns**: <code>string</code> - <p>The HTML string</p>
|
|
1049
|
-
|
|
1050
|
-
| Param | Type | Description |
|
|
1051
|
-
| --- | --- | --- |
|
|
1052
|
-
| song | [<code>Song</code>](#Song) | <p>The song to be formatted</p> |
|
|
1053
|
-
|
|
1054
|
-
<a name="HtmlTableFormatter.cssString"></a>
|
|
1055
|
-
|
|
1056
|
-
### HtmlTableFormatter.cssString(scope) ⇒ <code>string</code>
|
|
1057
|
-
<p>Generates basic CSS, optionally scoped within the provided selector, to use with output generated by
|
|
1058
|
-
[HtmlTableFormatter](#HtmlTableFormatter)</p>
|
|
1059
|
-
<p>For example, execute cssString('.chordSheetViewer') will result in CSS like:</p>
|
|
1060
|
-
<pre><code>.chordSheetViewer .paragraph {
|
|
1061
|
-
margin-bottom: 1em;
|
|
1062
|
-
}
|
|
1063
|
-
</code></pre>
|
|
1064
|
-
|
|
1065
|
-
**Kind**: static method of [<code>HtmlTableFormatter</code>](#HtmlTableFormatter)
|
|
1066
|
-
**Returns**: <code>string</code> - <p>the CSS string</p>
|
|
1067
|
-
|
|
1068
|
-
| Param | Description |
|
|
1069
|
-
| --- | --- |
|
|
1070
|
-
| scope | <p>the CSS scope to use, for example <code>.chordSheetViewer</code></p> |
|
|
1071
|
-
|
|
1072
|
-
<a name="HtmlTableFormatter.cssObject"></a>
|
|
1073
|
-
|
|
1074
|
-
### HtmlTableFormatter.cssObject() ⇒ <code>Object.<string, Object.<string, string>></code>
|
|
1075
|
-
<p>Basic CSS, in object style à la useStyles, to use with output generated by [HtmlTableFormatter](#HtmlTableFormatter)
|
|
1076
|
-
For a CSS string see [cssString](cssString)</p>
|
|
1077
|
-
<p>Example:</p>
|
|
1078
|
-
<pre><code>'.paragraph': {
|
|
1079
|
-
marginBottom: '1em'
|
|
1080
|
-
}
|
|
1081
|
-
</code></pre>
|
|
1082
|
-
|
|
1083
|
-
**Kind**: static method of [<code>HtmlTableFormatter</code>](#HtmlTableFormatter)
|
|
1084
|
-
**Returns**: <code>Object.<string, Object.<string, string>></code> - <p>the CSS object</p>
|
|
1085
1057
|
<a name="TextFormatter"></a>
|
|
1086
1058
|
|
|
1087
1059
|
## TextFormatter
|
|
@@ -1106,17 +1078,6 @@ For a CSS string see [cssString](cssString)</p>
|
|
|
1106
1078
|
<p>Parses a ChordPro chord sheet</p>
|
|
1107
1079
|
|
|
1108
1080
|
**Kind**: global class
|
|
1109
|
-
|
|
1110
|
-
* [ChordProParser](#ChordProParser)
|
|
1111
|
-
* [.warnings](#ChordProParser+warnings) : [<code>Array.<ParserWarning></code>](#ParserWarning)
|
|
1112
|
-
* [.parse(chordProChordSheet)](#ChordProParser+parse) ⇒ [<code>Song</code>](#Song)
|
|
1113
|
-
|
|
1114
|
-
<a name="ChordProParser+warnings"></a>
|
|
1115
|
-
|
|
1116
|
-
### chordProParser.warnings : [<code>Array.<ParserWarning></code>](#ParserWarning)
|
|
1117
|
-
<p>All warnings raised during parsing the ChordPro chord sheet</p>
|
|
1118
|
-
|
|
1119
|
-
**Kind**: instance property of [<code>ChordProParser</code>](#ChordProParser)
|
|
1120
1081
|
<a name="ChordProParser+parse"></a>
|
|
1121
1082
|
|
|
1122
1083
|
### chordProParser.parse(chordProChordSheet) ⇒ [<code>Song</code>](#Song)
|
|
@@ -1165,6 +1126,24 @@ For a CSS string see [cssString](cssString)</p>
|
|
|
1165
1126
|
| [options] | <code>Object</code> | <code>{}</code> | <p>Optional parser options</p> |
|
|
1166
1127
|
| [options.song] | [<code>Song</code>](#Song) | <code></code> | <p>The [Song](#Song) to store the song data in</p> |
|
|
1167
1128
|
|
|
1129
|
+
<a name="ChordsOverWordsParser"></a>
|
|
1130
|
+
|
|
1131
|
+
## ChordsOverWordsParser
|
|
1132
|
+
<p>Parses a chords over words sheet</p>
|
|
1133
|
+
|
|
1134
|
+
**Kind**: global class
|
|
1135
|
+
<a name="ChordsOverWordsParser+parse"></a>
|
|
1136
|
+
|
|
1137
|
+
### chordsOverWordsParser.parse(chordsOverWordsSheet) ⇒ [<code>Song</code>](#Song)
|
|
1138
|
+
<p>Parses a chords over words sheet into a song</p>
|
|
1139
|
+
|
|
1140
|
+
**Kind**: instance method of [<code>ChordsOverWordsParser</code>](#ChordsOverWordsParser)
|
|
1141
|
+
**Returns**: [<code>Song</code>](#Song) - <p>The parsed song</p>
|
|
1142
|
+
|
|
1143
|
+
| Param | Type | Description |
|
|
1144
|
+
| --- | --- | --- |
|
|
1145
|
+
| chordsOverWordsSheet | <code>string</code> | <p>the chords over words sheet</p> |
|
|
1146
|
+
|
|
1168
1147
|
<a name="ParserWarning"></a>
|
|
1169
1148
|
|
|
1170
1149
|
## ParserWarning
|
|
@@ -1178,6 +1157,18 @@ For a CSS string see [cssString](cssString)</p>
|
|
|
1178
1157
|
|
|
1179
1158
|
**Kind**: instance method of [<code>ParserWarning</code>](#ParserWarning)
|
|
1180
1159
|
**Returns**: <code>string</code> - <p>The string warning</p>
|
|
1160
|
+
<a name="PegBasedParser"></a>
|
|
1161
|
+
|
|
1162
|
+
## PegBasedParser
|
|
1163
|
+
<p>Parses a chords over words sheet</p>
|
|
1164
|
+
|
|
1165
|
+
**Kind**: global class
|
|
1166
|
+
<a name="PegBasedParser+warnings"></a>
|
|
1167
|
+
|
|
1168
|
+
### pegBasedParser.warnings : [<code>Array.<ParserWarning></code>](#ParserWarning)
|
|
1169
|
+
<p>All warnings raised during parsing the chord sheet</p>
|
|
1170
|
+
|
|
1171
|
+
**Kind**: instance property of [<code>PegBasedParser</code>](#PegBasedParser)
|
|
1181
1172
|
<a name="UltimateGuitarParser"></a>
|
|
1182
1173
|
|
|
1183
1174
|
## UltimateGuitarParser
|
|
@@ -1195,14 +1186,14 @@ Inherits from [ChordSheetParser](#ChordSheetParser)</p>
|
|
|
1195
1186
|
* [Chord](#Chord)
|
|
1196
1187
|
* _instance_
|
|
1197
1188
|
* [.clone()](#Chord+clone) ⇒ [<code>Chord</code>](#Chord)
|
|
1198
|
-
* [.toChordSymbol([
|
|
1199
|
-
* [.toChordSymbolString([
|
|
1189
|
+
* [.toChordSymbol([referenceKey])](#Chord+toChordSymbol) ⇒ [<code>Chord</code>](#Chord)
|
|
1190
|
+
* [.toChordSymbolString([referenceKey])](#Chord+toChordSymbolString) ⇒ <code>string</code>
|
|
1200
1191
|
* [.isChordSymbol()](#Chord+isChordSymbol) ⇒ <code>boolean</code>
|
|
1201
|
-
* [.toNumeric([
|
|
1202
|
-
* [.toNumeral(
|
|
1203
|
-
* [.toNumeralString([
|
|
1192
|
+
* [.toNumeric([referenceKey])](#Chord+toNumeric) ⇒ [<code>Chord</code>](#Chord)
|
|
1193
|
+
* [.toNumeral([referenceKey])](#Chord+toNumeral) ⇒ [<code>Chord</code>](#Chord)
|
|
1194
|
+
* [.toNumeralString([referenceKey])](#Chord+toNumeralString) ⇒ <code>string</code>
|
|
1204
1195
|
* [.isNumeric()](#Chord+isNumeric) ⇒ <code>boolean</code>
|
|
1205
|
-
* [.toNumericString([
|
|
1196
|
+
* [.toNumericString([referenceKey])](#Chord+toNumericString) ⇒ <code>string</code>
|
|
1206
1197
|
* [.isNumeral()](#Chord+isNumeral) ⇒ <code>boolean</code>
|
|
1207
1198
|
* [.toString()](#Chord+toString) ⇒ <code>string</code>
|
|
1208
1199
|
* [.normalize([key], [options])](#Chord+normalize) ⇒ [<code>Chord</code>](#Chord)
|
|
@@ -1211,7 +1202,7 @@ Inherits from [ChordSheetParser](#ChordSheetParser)</p>
|
|
|
1211
1202
|
* [.transposeDown()](#Chord+transposeDown) ⇒ [<code>Chord</code>](#Chord)
|
|
1212
1203
|
* [.transpose(delta)](#Chord+transpose) ⇒ [<code>Chord</code>](#Chord)
|
|
1213
1204
|
* _static_
|
|
1214
|
-
* [.parse(chordString)](#Chord.parse) ⇒ <code>
|
|
1205
|
+
* [.parse(chordString)](#Chord.parse) ⇒ [<code>Chord</code>](#Chord) \| <code>null</code>
|
|
1215
1206
|
|
|
1216
1207
|
<a name="Chord+clone"></a>
|
|
1217
1208
|
|
|
@@ -1221,7 +1212,7 @@ Inherits from [ChordSheetParser](#ChordSheetParser)</p>
|
|
|
1221
1212
|
**Kind**: instance method of [<code>Chord</code>](#Chord)
|
|
1222
1213
|
<a name="Chord+toChordSymbol"></a>
|
|
1223
1214
|
|
|
1224
|
-
### chord.toChordSymbol([
|
|
1215
|
+
### chord.toChordSymbol([referenceKey]) ⇒ [<code>Chord</code>](#Chord)
|
|
1225
1216
|
<p>Converts the chord to a chord symbol, using the supplied key as a reference.
|
|
1226
1217
|
For example, a numeric chord <code>#4</code> with reference key <code>E</code> will return the chord symbol <code>A#</code>.
|
|
1227
1218
|
When the chord is already a chord symbol, it will return a clone of the object.</p>
|
|
@@ -1231,11 +1222,11 @@ When the chord is already a chord symbol, it will return a clone of the object.<
|
|
|
1231
1222
|
|
|
1232
1223
|
| Param | Type | Default | Description |
|
|
1233
1224
|
| --- | --- | --- | --- |
|
|
1234
|
-
| [
|
|
1225
|
+
| [referenceKey] | [<code>Key</code>](#Key) \| <code>string</code> \| <code>null</code> | <code></code> | <p>the reference key. The key is required when converting a numeric or numeral.</p> |
|
|
1235
1226
|
|
|
1236
1227
|
<a name="Chord+toChordSymbolString"></a>
|
|
1237
1228
|
|
|
1238
|
-
### chord.toChordSymbolString([
|
|
1229
|
+
### chord.toChordSymbolString([referenceKey]) ⇒ <code>string</code>
|
|
1239
1230
|
<p>Converts the chord to a chord symbol string, using the supplied key as a reference.
|
|
1240
1231
|
For example, a numeric chord <code>#4</code> with reference key <code>E</code> will return the chord symbol <code>A#</code>.
|
|
1241
1232
|
When the chord is already a chord symbol, it will return a string version of the chord.</p>
|
|
@@ -1246,7 +1237,7 @@ When the chord is already a chord symbol, it will return a string version of the
|
|
|
1246
1237
|
|
|
1247
1238
|
| Param | Type | Default | Description |
|
|
1248
1239
|
| --- | --- | --- | --- |
|
|
1249
|
-
| [
|
|
1240
|
+
| [referenceKey] | [<code>Key</code>](#Key) \| <code>string</code> \| <code>null</code> | <code></code> | <p>the reference key. The key is required when converting a numeric or numeral.</p> |
|
|
1250
1241
|
|
|
1251
1242
|
<a name="Chord+isChordSymbol"></a>
|
|
1252
1243
|
|
|
@@ -1256,7 +1247,7 @@ When the chord is already a chord symbol, it will return a string version of the
|
|
|
1256
1247
|
**Kind**: instance method of [<code>Chord</code>](#Chord)
|
|
1257
1248
|
<a name="Chord+toNumeric"></a>
|
|
1258
1249
|
|
|
1259
|
-
### chord.toNumeric([
|
|
1250
|
+
### chord.toNumeric([referenceKey]) ⇒ [<code>Chord</code>](#Chord)
|
|
1260
1251
|
<p>Converts the chord to a numeric chord, using the supplied key as a reference.
|
|
1261
1252
|
For example, a chord symbol A# with reference key E will return the numeric chord #4.</p>
|
|
1262
1253
|
|
|
@@ -1265,11 +1256,11 @@ For example, a chord symbol A# with reference key E will return the numeric chor
|
|
|
1265
1256
|
|
|
1266
1257
|
| Param | Type | Default | Description |
|
|
1267
1258
|
| --- | --- | --- | --- |
|
|
1268
|
-
| [
|
|
1259
|
+
| [referenceKey] | [<code>Key</code>](#Key) \| <code>string</code> \| <code>null</code> | <code></code> | <p>the reference key. The key is required when converting a chord symbol</p> |
|
|
1269
1260
|
|
|
1270
1261
|
<a name="Chord+toNumeral"></a>
|
|
1271
1262
|
|
|
1272
|
-
### chord.toNumeral(
|
|
1263
|
+
### chord.toNumeral([referenceKey]) ⇒ [<code>Chord</code>](#Chord)
|
|
1273
1264
|
<p>Converts the chord to a numeral chord, using the supplied key as a reference.
|
|
1274
1265
|
For example, a chord symbol A# with reference key E will return the numeral chord #IV.</p>
|
|
1275
1266
|
|
|
@@ -1278,11 +1269,11 @@ For example, a chord symbol A# with reference key E will return the numeral chor
|
|
|
1278
1269
|
|
|
1279
1270
|
| Param | Type | Default | Description |
|
|
1280
1271
|
| --- | --- | --- | --- |
|
|
1281
|
-
|
|
|
1272
|
+
| [referenceKey] | [<code>Key</code>](#Key) \| <code>string</code> \| <code>null</code> | <code></code> | <p>the reference key. The key is required when converting a chord symbol</p> |
|
|
1282
1273
|
|
|
1283
1274
|
<a name="Chord+toNumeralString"></a>
|
|
1284
1275
|
|
|
1285
|
-
### chord.toNumeralString([
|
|
1276
|
+
### chord.toNumeralString([referenceKey]) ⇒ <code>string</code>
|
|
1286
1277
|
<p>Converts the chord to a numeral chord string, using the supplied kye as a reference.
|
|
1287
1278
|
For example, a chord symbol A# with reference key E will return the numeral chord #4.</p>
|
|
1288
1279
|
|
|
@@ -1292,7 +1283,7 @@ For example, a chord symbol A# with reference key E will return the numeral chor
|
|
|
1292
1283
|
|
|
1293
1284
|
| Param | Type | Default | Description |
|
|
1294
1285
|
| --- | --- | --- | --- |
|
|
1295
|
-
| [
|
|
1286
|
+
| [referenceKey] | [<code>Key</code>](#Key) \| <code>string</code> \| <code>null</code> | <code></code> | <p>the reference key. The key is required when converting a chord symbol</p> |
|
|
1296
1287
|
|
|
1297
1288
|
<a name="Chord+isNumeric"></a>
|
|
1298
1289
|
|
|
@@ -1302,7 +1293,7 @@ For example, a chord symbol A# with reference key E will return the numeral chor
|
|
|
1302
1293
|
**Kind**: instance method of [<code>Chord</code>](#Chord)
|
|
1303
1294
|
<a name="Chord+toNumericString"></a>
|
|
1304
1295
|
|
|
1305
|
-
### chord.toNumericString([
|
|
1296
|
+
### chord.toNumericString([referenceKey]) ⇒ <code>string</code>
|
|
1306
1297
|
<p>Converts the chord to a numeric chord string, using the supplied kye as a reference.
|
|
1307
1298
|
For example, a chord symbol A# with reference key E will return the numeric chord #4.</p>
|
|
1308
1299
|
|
|
@@ -1312,7 +1303,7 @@ For example, a chord symbol A# with reference key E will return the numeric chor
|
|
|
1312
1303
|
|
|
1313
1304
|
| Param | Type | Default | Description |
|
|
1314
1305
|
| --- | --- | --- | --- |
|
|
1315
|
-
| [
|
|
1306
|
+
| [referenceKey] | [<code>Key</code>](#Key) \| <code>string</code> \| <code>null</code> | <code></code> | <p>the reference key. The key is required when converting a chord symbol</p> |
|
|
1316
1307
|
|
|
1317
1308
|
<a name="Chord+isNumeral"></a>
|
|
1318
1309
|
|
|
@@ -1344,6 +1335,8 @@ For example, a chord symbol A# with reference key E will return the numeric chor
|
|
|
1344
1335
|
<p>Besides that it normalizes the suffix if <code>normalizeSuffix</code> is <code>true</code>.
|
|
1345
1336
|
For example, <code>sus2</code> becomes <code>2</code>, <code>sus4</code> becomes <code>sus</code>.
|
|
1346
1337
|
All suffix normalizations can be found in <code>src/normalize_mappings/suffix-mapping.txt</code>.</p>
|
|
1338
|
+
<p>When the chord is minor, bass notes are normalized off of the relative major
|
|
1339
|
+
of the root note. For example, <code>Em/A#</code> becomes <code>Em/Bb</code>.</p>
|
|
1347
1340
|
|
|
1348
1341
|
**Kind**: instance method of [<code>Chord</code>](#Chord)
|
|
1349
1342
|
**Returns**: [<code>Chord</code>](#Chord) - <p>the normalized chord</p>
|
|
@@ -1394,7 +1387,7 @@ All suffix normalizations can be found in <code>src/normalize_mappings/suffix-ma
|
|
|
1394
1387
|
|
|
1395
1388
|
<a name="Chord.parse"></a>
|
|
1396
1389
|
|
|
1397
|
-
### Chord.parse(chordString) ⇒ <code>
|
|
1390
|
+
### Chord.parse(chordString) ⇒ [<code>Chord</code>](#Chord) \| <code>null</code>
|
|
1398
1391
|
<p>Tries to parse a chord string into a chord</p>
|
|
1399
1392
|
|
|
1400
1393
|
**Kind**: static method of [<code>Chord</code>](#Chord)
|
|
@@ -1601,6 +1594,18 @@ See https://www.chordpro.org/chordpro/directives-key/</p>
|
|
|
1601
1594
|
|
|
1602
1595
|
<a name="defaultCss"></a>
|
|
1603
1596
|
|
|
1597
|
+
## defaultCss ⇒ <code>string</code>
|
|
1598
|
+
<p>Generates basic CSS, scoped within the provided selector, to use with output generated by [HtmlTableFormatter](#HtmlTableFormatter)</p>
|
|
1599
|
+
|
|
1600
|
+
**Kind**: global variable
|
|
1601
|
+
**Returns**: <code>string</code> - <p>the CSS string</p>
|
|
1602
|
+
|
|
1603
|
+
| Param | Description |
|
|
1604
|
+
| --- | --- |
|
|
1605
|
+
| scope | <p>the CSS scope to use, for example <code>.chordSheetViewer</code></p> |
|
|
1606
|
+
|
|
1607
|
+
<a name="defaultCss"></a>
|
|
1608
|
+
|
|
1604
1609
|
## defaultCss : <code>Object.<string, Object.<string, string>></code>
|
|
1605
1610
|
<p>Basic CSS, in object style à la useStyles, to use with output generated by {@link }HtmlTableFormatter}
|
|
1606
1611
|
For a CSS string see [scopedCss](scopedCss)</p>
|
|
@@ -1638,7 +1643,7 @@ For a CSS string see [scopedCss](scopedCss)</p>
|
|
|
1638
1643
|
**Kind**: global constant
|
|
1639
1644
|
<a name="parseChord"></a>
|
|
1640
1645
|
|
|
1641
|
-
## ~~parseChord(chordString) ⇒ <code>
|
|
1646
|
+
## ~~parseChord(chordString) ⇒ [<code>Chord</code>](#Chord) \| <code>null</code>~~
|
|
1642
1647
|
***Deprecated***
|
|
1643
1648
|
|
|
1644
1649
|
<p>Tries to parse a chord string into a chord</p>
|