0.16.2 • Published 3 months ago

chord-mark v0.16.2

Weekly downloads
3
License
MIT
Repository
github
Last release
3 months ago

ChordMark

Installation

yarn add chord-mark chord-mark-themes

Usage

import { parseSong, renderSong } from 'chord-mark/lib/chord-mark.js';

const song = 'C.. G..\n' + 'When I _find myself in _times of trouble';

const parsed = parseSong(song);
const rendered = renderSong(parsed);

ChordMark's default renderer produces a string containing an HTML markup.

<div class="cmSong">
	<p class="cmLine">
		<span class="cmChordLine"
			><span class="cmChordLineOffset"> </span
			><span class="cmBarSeparator">|</span
			><span class="cmChordSymbol">C</span>
			<span class="cmChordSymbol">G</span>
			<span class="cmBarSeparator">|</span></span
		>
	</p>
	<p class="cmLine">
		<span class="cmLyricLine">When I find myself in times of trouble</span>
	</p>
</div>

Configuration

The renderer function can be configured. Until proper documentation is available, the list of parameters can be checked here: https://github.com/no-chris/chord-mark/blob/master/packages/chord-mark/src/renderer/components/renderSong.js#L27

Documentation

Check the User Guide.

CSS Classes

By default, ChordMark does not come with any CSS styling. You can either use the chord-mark-themes module or design your own themes. The following list of CSS classes are available:

  • cmSong
  • cmSection
  • cmSection-xxx, where xxx is the section name
  • cmLine
  • cmLine--isFromAutoRepeatChords
  • cmLine--isFromChordLineRepeater
  • cmLine--isFromSectionCopy
  • cmLine--isFromSectionMultiply
  • cmChordLine
  • cmChordLineOffset
  • cmBarSeparator
  • cmChordSymbol
  • cmChordDuration
  • cmEmptyLine
  • cmLyricLine
  • cmSectionLabel
  • cmSectionMultiplier
  • cmTimeSignature
  • cmSubBeatGroupOpener
  • cmSubBeatGroupCloser

Breaking changes

While I don't foresee the public API to change drastically in the future, it is to be considered unstable until v1.0.0 is published. Breaking changes might happen until then and will be documented in the release notes.

0.16.1

3 months ago

0.16.2

3 months ago

0.16.0

5 months ago

0.15.0

5 months ago

0.14.0

1 year ago

0.13.0

1 year ago

0.13.0-beta.5

1 year ago

0.13.0-beta.6

1 year ago

0.13.0-beta.4

1 year ago

0.13.0-beta.3

1 year ago

0.13.0-beta.1

1 year ago

0.13.0-beta.2

1 year ago

0.13.0-beta.0

1 year ago

0.12.0

2 years ago

0.11.0-beta.0

2 years ago

0.11.0

2 years ago

0.10.0-beta.3

2 years ago

0.10.0-beta.6

2 years ago

0.10.0-beta.5

2 years ago

0.10.0

2 years ago

0.8.0-beta.0

2 years ago

0.8.0-alpha.1

2 years ago

0.8.0-beta.1

2 years ago

0.8.0-beta.2

2 years ago

0.11.0-beta.1

2 years ago

0.8.0-alpha.0

2 years ago

0.9.0

2 years ago

0.8.0

2 years ago

0.7.0

2 years ago

0.6.1

2 years ago

0.6.0

2 years ago

0.5.5

3 years ago

0.5.4

4 years ago

0.5.3

5 years ago

0.5.2

5 years ago

0.5.1

5 years ago

0.5.0

5 years ago

0.4.0

5 years ago