@barmark/cli 0.11.3 → 0.12.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/CHANGELOG.md CHANGED
@@ -6,6 +6,19 @@ package uses [semantic versioning](https://semver.org/).
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.12.0] - 2026-11-13
10
+
11
+ ### Added
12
+
13
+ - **`render --diagrams guitar`** draws a strip of guitar chord diagrams
14
+ above the grid, and **`--left-handed`** mirrors them (it needs
15
+ `--diagrams`). Both are grid flags, refused with `--score`.
16
+
17
+ ### Changed
18
+
19
+ - **Uses** @barmark/render 0.20.0 and @barmark/score 0.6.0, and through
20
+ render @barmark/fretboard 0.1.0, whose shapes the diagrams draw.
21
+
9
22
  ## [0.11.3] - 2026-11-12
10
23
 
11
24
  ### Changed
@@ -381,7 +394,8 @@ The first release of the `barmark` command. Uses `barmark` 0.8.0 and
381
394
  - **The `barmark` command:** `check`, `format`, `render` and `transpose`
382
395
  for `.chart.md` files, on npm and as standalone binaries.
383
396
 
384
- [Unreleased]: https://github.com/kevinpeckham/barmark/compare/cli-v0.11.3...HEAD
397
+ [Unreleased]: https://github.com/kevinpeckham/barmark/compare/cli-v0.12.0...HEAD
398
+ [0.12.0]: https://github.com/kevinpeckham/barmark/compare/cli-v0.11.3...cli-v0.12.0
385
399
  [0.11.3]: https://github.com/kevinpeckham/barmark/compare/cli-v0.11.2...cli-v0.11.3
386
400
  [0.11.2]: https://github.com/kevinpeckham/barmark/compare/cli-v0.11.1...cli-v0.11.2
387
401
  [0.11.1]: https://github.com/kevinpeckham/barmark/compare/cli-v0.11.0...cli-v0.11.1
package/README.md CHANGED
@@ -45,13 +45,16 @@ barmark format --check songs # list them and fail, for CI
45
45
  barmark part Bass song.chart.md # one part of a chart of several
46
46
  barmark render song.chart.md --out song.html # a standalone page, font included
47
47
  barmark render --score song.chart.md --out song.html # the full engraved score
48
+ barmark render song.chart.md --diagrams guitar --left-handed --out song.html # with chord diagrams
48
49
  barmark transpose song.chart.md --to E # or --semitones -2
49
50
  ```
50
51
 
51
52
  `check --format json` prints the diagnostics for other tools. `render`
52
53
  takes the renderer's options as flags: `--theme auto|light|dark`,
53
54
  `--numerals nashville|roman`, `--no-bar-numbers`, `--rehearsal-letters`,
54
- `--no-wrap`, `--columns shared|row`, `--diagnostics`, `--part <label>` to draw one part, and `--font-url <url>` to link the font
55
+ `--no-wrap`, `--columns shared|row`, `--diagrams guitar` (a strip of guitar
56
+ chord diagrams above the grid; `--left-handed` mirrors them),
57
+ `--diagnostics`, `--part <label>` to draw one part, and `--font-url <url>` to link the font
55
58
  instead of embedding it. `barmark <command> --help` lists each command's
56
59
  flags; `barmark --version` prints the versions of the CLI, its
57
60
  libraries and Verovio.
@@ -67,7 +70,7 @@ it does the grid, `--part <label>` engraves that part alone, and
67
70
  window or the paper, so the width decides how many bars go on a line,
68
71
  not how big the page is). The grid's own flags (`--numerals`,
69
72
  `--no-bar-numbers`, `--rehearsal-letters`, `--no-wrap`, `--columns`,
70
- `--diagnostics`, `--font-url`) are usage errors with `--score`, and `--width` is one
73
+ `--diagrams`, `--left-handed`, `--diagnostics`, `--font-url`) are usage errors with `--score`, and `--width` is one
71
74
  without it. A chart that won't engrave (one with errors, or no bars)
72
75
  writes nothing: the reason goes to stderr as `song.chart.md: Line 5:
73
76
  message`, and the exit code is 1. The score's text is set in Verovio's own
package/dist/args.js CHANGED
@@ -17,7 +17,7 @@ export function parseFlags(args, options) {
17
17
  export function oneOf(flag, value, allowed) {
18
18
  if (allowed.includes(value))
19
19
  return value;
20
- const list = `${allowed.slice(0, -1).join(", ")} or ${allowed.at(-1)}`;
20
+ const list = allowed.length === 1 ? allowed[0] : `${allowed.slice(0, -1).join(", ")} or ${allowed.at(-1)}`;
21
21
  throw new UsageError(`--${flag} must be ${list}, not "${value}"`);
22
22
  }
23
23
  /** `--semitones -2`: join a negative number to its flag, which parseArgs would read as a flag. */
package/dist/help.js CHANGED
@@ -72,6 +72,8 @@ The grid only:
72
72
  --columns shared|row row: each row sizes its own bars, so a busy bar widens
73
73
  only its own row (default shared: bar lines line up
74
74
  down each section)
75
+ --diagrams guitar Show a strip of guitar chord diagrams above the grid
76
+ --left-handed With --diagrams: mirror the diagrams for a left hand
75
77
  --diagnostics List the chart's problems below it
76
78
  --font-url <url> Link the font instead of embedding it
77
79
  `,
package/dist/render.js CHANGED
@@ -13,6 +13,7 @@ import { DEFAULT_WIDTH, MAX_WIDTH, MIN_WIDTH, scoreBody } from "./score.js";
13
13
  const THEMES = ["auto", "light", "dark"];
14
14
  const NUMERALS = ["nashville", "roman"];
15
15
  const COLUMNS = ["shared", "row"];
16
+ const DIAGRAMS = ["guitar"];
16
17
  const escapeHtml = (text) => text.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
17
18
  function htmlDocument(title, body) {
18
19
  return `<!doctype html>
@@ -36,6 +37,8 @@ const FLAGS = {
36
37
  "rehearsal-letters": { type: "boolean", default: false },
37
38
  "no-wrap": { type: "boolean", default: false },
38
39
  columns: { type: "string" },
40
+ diagrams: { type: "string" },
41
+ "left-handed": { type: "boolean", default: false },
39
42
  diagnostics: { type: "boolean", default: false },
40
43
  "font-url": { type: "string" },
41
44
  part: { type: "string" },
@@ -49,6 +52,8 @@ const GRID_ONLY = [
49
52
  "rehearsal-letters",
50
53
  "no-wrap",
51
54
  "columns",
55
+ "diagrams",
56
+ "left-handed",
52
57
  "diagnostics",
53
58
  "font-url",
54
59
  ];
@@ -80,8 +85,19 @@ function gridOptions(values, theme, io) {
80
85
  options.wrap = false;
81
86
  if (values.diagnostics)
82
87
  options.diagnostics = true;
88
+ Object.assign(options, diagramOptions(values));
83
89
  return Object.assign(options, columnsOption(values.columns));
84
90
  }
91
+ /** `--diagrams guitar` as the strip, `--left-handed` as its hand; the hand alone has nothing to turn. */
92
+ function diagramOptions(values) {
93
+ if (values.diagrams === undefined) {
94
+ if (values["left-handed"])
95
+ throw new UsageError("--left-handed needs --diagrams");
96
+ return {};
97
+ }
98
+ const chordDiagrams = oneOf("diagrams", values.diagrams, DIAGRAMS);
99
+ return values["left-handed"] ? { chordDiagrams, diagramHand: "left" } : { chordDiagrams };
100
+ }
85
101
  /** `--columns row` as the option; `shared`, the default, as none, so the page is the default's. */
86
102
  function columnsOption(value) {
87
103
  if (value === undefined)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@barmark/cli",
3
- "version": "0.11.3",
3
+ "version": "0.12.0",
4
4
  "description": "The barmark command: check, format, render, transpose and export barmark chord charts (.chart.md) from the terminal and in CI.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -38,10 +38,10 @@
38
38
  },
39
39
  "dependencies": {
40
40
  "barmark": "0.23.1",
41
- "@barmark/render": "0.19.1",
41
+ "@barmark/render": "0.20.0",
42
42
  "@barmark/musicxml": "0.9.1",
43
43
  "@barmark/midi": "0.3.3",
44
- "@barmark/score": "0.5.0",
44
+ "@barmark/score": "0.6.0",
45
45
  "verovio": "6.4.1"
46
46
  },
47
47
  "scripts": {