chordsheetjs 4.9.0 → 4.10.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 CHANGED
@@ -1,4 +1,4 @@
1
- # ChordSheetJS [![Build Status](https://travis-ci.org/martijnversluis/ChordSheetJS.svg?branch=master)](https://travis-ci.org/martijnversluis/ChordSheetJS) [![npm version](https://badge.fury.io/js/chordsheetjs.svg)](https://badge.fury.io/js/chordsheetjs) [![Code Climate](https://codeclimate.com/github/martijnversluis/ChordSheetJS/badges/gpa.svg)](https://codeclimate.com/github/martijnversluis/ChordSheetJS)
1
+ # ChordSheetJS ![example branch parameter](https://github.com/martijnversluis/ChordSheetJS/actions/workflows/ci.yml/badge.svg?branch=master) [![npm version](https://badge.fury.io/js/chordsheetjs.svg)](https://badge.fury.io/js/chordsheetjs) [![Code Climate](https://codeclimate.com/github/martijnversluis/ChordSheetJS/badges/gpa.svg)](https://codeclimate.com/github/martijnversluis/ChordSheetJS)
2
2
 
3
3
  A JavaScript library for parsing and formatting chord sheets
4
4
 
@@ -228,6 +228,14 @@ var Song = /*#__PURE__*/function () {
228
228
  this.endSection(_constants.CHORUS, tag);
229
229
  break;
230
230
 
231
+ case _tag.START_OF_TAB:
232
+ this.startSection(_constants.TAB, tag);
233
+ break;
234
+
235
+ case _tag.END_OF_TAB:
236
+ this.endSection(_constants.TAB, tag);
237
+ break;
238
+
231
239
  case _tag.START_OF_VERSE:
232
240
  this.startSection(_constants.VERSE, tag);
233
241
  break;
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports["default"] = exports._KEY = exports.YEAR = exports.TITLE = exports.TIME = exports.TEMPO = exports.SUBTITLE = exports.START_OF_VERSE = exports.START_OF_CHORUS = exports.READ_ONLY_TAGS = exports.META_TAGS = exports.LYRICIST = exports.KEY = exports.END_OF_VERSE = exports.END_OF_CHORUS = exports.DURATION = exports.COPYRIGHT = exports.COMPOSER = exports.COMMENT = exports.CAPO = exports.ARTIST = exports.ALBUM = void 0;
6
+ exports["default"] = exports._KEY = exports.YEAR = exports.TITLE = exports.TIME = exports.TEMPO = exports.SUBTITLE = exports.START_OF_VERSE = exports.START_OF_TAB = exports.START_OF_CHORUS = exports.READ_ONLY_TAGS = exports.META_TAGS = exports.LYRICIST = exports.KEY = exports.END_OF_VERSE = exports.END_OF_TAB = exports.END_OF_CHORUS = exports.DURATION = exports.COPYRIGHT = exports.COMPOSER = exports.COMMENT = exports.CAPO = exports.ARTIST = exports.ALBUM = void 0;
7
7
  exports.isReadonlyTag = isReadonlyTag;
8
8
 
9
9
  var _ALIASES;
@@ -71,11 +71,18 @@ var DURATION = 'duration';
71
71
  exports.DURATION = DURATION;
72
72
  var END_OF_CHORUS = 'end_of_chorus';
73
73
  /**
74
- * End of verse directive. See https://www.chordpro.org/chordpro/directives-env_verse/
74
+ * End of tab directive. See https://www.chordpro.org/chordpro/directives-env_tab/
75
75
  * @type {string}
76
76
  */
77
77
 
78
78
  exports.END_OF_CHORUS = END_OF_CHORUS;
79
+ var END_OF_TAB = 'end_of_tab';
80
+ /**
81
+ * End of verse directive. See https://www.chordpro.org/chordpro/directives-env_verse/
82
+ * @type {string}
83
+ */
84
+
85
+ exports.END_OF_TAB = END_OF_TAB;
79
86
  var END_OF_VERSE = 'end_of_verse';
80
87
  /**
81
88
  * Key meta directive. See https://www.chordpro.org/chordpro/directives-key/
@@ -106,11 +113,18 @@ var LYRICIST = 'lyricist';
106
113
  exports.LYRICIST = LYRICIST;
107
114
  var START_OF_CHORUS = 'start_of_chorus';
108
115
  /**
109
- * Start of verse directive. See https://www.chordpro.org/chordpro/directives-env_verse/
116
+ * Start of tab directive. See https://www.chordpro.org/chordpro/directives-env_tab/
110
117
  * @type {string}
111
118
  */
112
119
 
113
120
  exports.START_OF_CHORUS = START_OF_CHORUS;
121
+ var START_OF_TAB = 'start_of_tab';
122
+ /**
123
+ * Start of verse directive. See https://www.chordpro.org/chordpro/directives-env_verse/
124
+ * @type {string}
125
+ */
126
+
127
+ exports.START_OF_TAB = START_OF_TAB;
114
128
  var START_OF_VERSE = 'start_of_verse';
115
129
  /**
116
130
  * Subtitle meta directive. See https://www.chordpro.org/chordpro/directives-subtitle/
@@ -153,12 +167,14 @@ var SUBTITLE_SHORT = 'st';
153
167
  var COMMENT_SHORT = 'c';
154
168
  var START_OF_CHORUS_SHORT = 'soc';
155
169
  var END_OF_CHORUS_SHORT = 'eoc';
170
+ var START_OF_TAB_SHORT = 'sot';
171
+ var END_OF_TAB_SHORT = 'eot';
156
172
  var RENDERABLE_TAGS = [COMMENT];
157
173
  var META_TAGS = [ALBUM, ARTIST, CAPO, COMPOSER, COPYRIGHT, DURATION, KEY, LYRICIST, TEMPO, TIME, TITLE, SUBTITLE, YEAR];
158
174
  exports.META_TAGS = META_TAGS;
159
175
  var READ_ONLY_TAGS = [_KEY];
160
176
  exports.READ_ONLY_TAGS = READ_ONLY_TAGS;
161
- var ALIASES = (_ALIASES = {}, _defineProperty(_ALIASES, TITLE_SHORT, TITLE), _defineProperty(_ALIASES, SUBTITLE_SHORT, SUBTITLE), _defineProperty(_ALIASES, COMMENT_SHORT, COMMENT), _defineProperty(_ALIASES, START_OF_CHORUS_SHORT, START_OF_CHORUS), _defineProperty(_ALIASES, END_OF_CHORUS_SHORT, END_OF_CHORUS), _ALIASES);
177
+ var ALIASES = (_ALIASES = {}, _defineProperty(_ALIASES, TITLE_SHORT, TITLE), _defineProperty(_ALIASES, SUBTITLE_SHORT, SUBTITLE), _defineProperty(_ALIASES, COMMENT_SHORT, COMMENT), _defineProperty(_ALIASES, START_OF_CHORUS_SHORT, START_OF_CHORUS), _defineProperty(_ALIASES, END_OF_CHORUS_SHORT, END_OF_CHORUS), _defineProperty(_ALIASES, START_OF_TAB_SHORT, START_OF_TAB), _defineProperty(_ALIASES, END_OF_TAB_SHORT, END_OF_TAB), _ALIASES);
162
178
  var META_TAG_REGEX = /^meta:\s*([^:\s]+)(\s*(.+))?$/;
163
179
  var TAG_REGEX = /^([^:\s]+)(:?\s*(.+))?$/;
164
180
  var CUSTOM_META_TAG_NAME_REGEX = /^x_(.+)$/;
package/lib/constants.js CHANGED
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.VERSE = exports.NONE = exports.INDETERMINATE = exports.CHORUS = void 0;
6
+ exports.VERSE = exports.TAB = exports.NONE = exports.INDETERMINATE = exports.CHORUS = void 0;
7
7
 
8
8
  /**
9
9
  * Used to mark a paragraph as verse
@@ -35,4 +35,12 @@ var NONE = 'none';
35
35
 
36
36
  exports.NONE = NONE;
37
37
  var INDETERMINATE = 'indeterminate';
38
- exports.INDETERMINATE = INDETERMINATE;
38
+ /**
39
+ * Used to mark a paragraph as tab
40
+ * @constant
41
+ * @type {string}
42
+ */
43
+
44
+ exports.INDETERMINATE = INDETERMINATE;
45
+ var TAB = 'tab';
46
+ exports.TAB = TAB;
package/lib/index.js CHANGED
@@ -111,6 +111,12 @@ Object.defineProperty(exports, "Song", {
111
111
  return _song["default"];
112
112
  }
113
113
  });
114
+ Object.defineProperty(exports, "TAB", {
115
+ enumerable: true,
116
+ get: function get() {
117
+ return _constants.TAB;
118
+ }
119
+ });
114
120
  Object.defineProperty(exports, "Tag", {
115
121
  enumerable: true,
116
122
  get: function get() {
@@ -222,6 +228,7 @@ var _default = {
222
228
  ChordSheetSerializer: _chord_sheet_serializer["default"],
223
229
  CHORUS: _constants.CHORUS,
224
230
  INDETERMINATE: _constants.INDETERMINATE,
231
+ TAB: _constants.TAB,
225
232
  VERSE: _constants.VERSE,
226
233
  NONE: _constants.NONE
227
234
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "chordsheetjs",
3
3
  "author": "Martijn Versluis",
4
- "version": "4.9.0",
4
+ "version": "4.10.0",
5
5
  "description": "A JavaScript library for parsing and formatting chord sheets",
6
6
  "main": "lib/index.js",
7
7
  "repository": {
@@ -29,7 +29,7 @@
29
29
  "scripts": {
30
30
  "jest": "jest",
31
31
  "test": "yarn lint && yarn jest",
32
- "lint": "yarn build:pegjs && node_modules/.bin/eslint --ext .js .",
32
+ "lint": "yarn build:templates && yarn build:pegjs && node_modules/.bin/eslint --ext .js .",
33
33
  "lint:fix": "node_modules/.bin/eslint --fix --ext .js .",
34
34
  "build:template": "handlebars \"src/formatter/templates/$TEMPLATE.handlebars\" -f \"src/formatter/templates/$TEMPLATE.js\" --known each --known if --known with --known paragraphClasses --known isChordLyricsPair --known isTag --known isComment --known shouldRenderLine --known hasChordContents --known lineHasContents --known lineClasses --known toUpperCase --known paragraphClasses --commonjs handlebars",
35
35
  "build:templates": "TEMPLATE=html_div_formatter yarn build:template && TEMPLATE=html_table_formatter yarn build:template",