astro-lilypond 0.1.0 → 0.3.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/components/LilyPond.astro +18 -0
- package/components/virtual.d.ts +9 -0
- package/dist/index.d.ts +7 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +22 -3
- package/dist/index.js.map +1 -1
- package/dist/rehype-plugin.d.ts +2 -5
- package/dist/rehype-plugin.d.ts.map +1 -1
- package/dist/rehype-plugin.js +1 -1
- package/dist/rehype-plugin.js.map +1 -1
- package/dist/remark-plugin.d.ts +2 -5
- package/dist/remark-plugin.d.ts.map +1 -1
- package/dist/remark-plugin.js +1 -1
- package/dist/remark-plugin.js.map +1 -1
- package/dist/render.d.ts.map +1 -1
- package/dist/render.js +6 -8
- package/dist/render.js.map +1 -1
- package/dist/satteri-plugin.d.ts +2 -5
- package/dist/satteri-plugin.d.ts.map +1 -1
- package/dist/satteri-plugin.js +1 -1
- package/dist/satteri-plugin.js.map +1 -1
- package/dist/util.d.ts +5 -0
- package/dist/util.d.ts.map +1 -1
- package/dist/util.js.map +1 -1
- package/package.json +17 -26
- package/README.md +0 -45
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
---
|
|
2
|
+
/// <reference path="./virtual.d.ts" />
|
|
3
|
+
import { escapeHtml } from "../src/util.js";
|
|
4
|
+
|
|
5
|
+
interface Props {
|
|
6
|
+
content: string;
|
|
7
|
+
class?: string;
|
|
8
|
+
style?: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const { content, class: className, style } = Astro.props;
|
|
12
|
+
|
|
13
|
+
let html = content;
|
|
14
|
+
if (className) html = html.replace('class="lilypond"', `class="lilypond ${className}"`);
|
|
15
|
+
if (style) html = html.replace(/<(svg|img)\b/, `<$1 style="${escapeHtml(style)}"`);
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
<Fragment set:html={html} />
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { AstroIntegration } from "astro";
|
|
2
|
-
import type { OutputFormat } from "./util.js";
|
|
2
|
+
import type { LilypondPluginOptions, OutputFormat } from "./util.js";
|
|
3
3
|
export type { OutputFormat };
|
|
4
|
-
export
|
|
4
|
+
export type { LilypondPluginOptions };
|
|
5
|
+
export interface LilypondOptions extends LilypondPluginOptions {
|
|
5
6
|
/**
|
|
6
7
|
* LilyPond version string to prepend automatically to every block that
|
|
7
8
|
* doesn't already declare `\version`. Example: `"2.24.0"`.
|
|
@@ -17,6 +18,10 @@ export interface LilypondOptions {
|
|
|
17
18
|
* - `{ type: "png", resolution: number }` — PNG at a specific DPI
|
|
18
19
|
*/
|
|
19
20
|
format?: OutputFormat;
|
|
21
|
+
/**
|
|
22
|
+
* Crop the output tightly to the content bounding box. Defaults to `true`.
|
|
23
|
+
*/
|
|
24
|
+
crop?: boolean;
|
|
20
25
|
}
|
|
21
26
|
export default function lilypond(options?: LilypondOptions): AstroIntegration;
|
|
22
27
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,OAAO,CAAC;AAS9C,OAAO,KAAK,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAIrE,YAAY,EAAE,YAAY,EAAE,CAAC;AAC7B,YAAY,EAAE,qBAAqB,EAAE,CAAC;AAEtC,MAAM,WAAW,eAAgB,SAAQ,qBAAqB;IAC7D;;;;;OAKG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;CACf;AAgBD,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,OAAO,GAAE,eAAoB,GAAG,gBAAgB,CAwFhF"}
|
package/dist/index.js
CHANGED
|
@@ -3,7 +3,23 @@ import { promisify } from "util";
|
|
|
3
3
|
import { remarkLilypondPlugin } from "./remark-plugin.js";
|
|
4
4
|
import { rehypeLilypondPlugin } from "./rehype-plugin.js";
|
|
5
5
|
import { satteriLilypondPlugin } from "./satteri-plugin.js";
|
|
6
|
+
import { render } from "./render.js";
|
|
7
|
+
import { prependVersion, renderToHtml, resolveFormat } from "./util.js";
|
|
6
8
|
const execFileAsync = promisify(execFile);
|
|
9
|
+
function lyFilePlugin(options) {
|
|
10
|
+
return {
|
|
11
|
+
name: "vite-plugin-astro-lilypond-ly",
|
|
12
|
+
enforce: "pre",
|
|
13
|
+
async transform(source, id) {
|
|
14
|
+
if (!id.endsWith(".ly") && !id.endsWith(".lilypond"))
|
|
15
|
+
return;
|
|
16
|
+
const src = options.version ? prependVersion(source, options.version) : source;
|
|
17
|
+
const { format, resolution } = resolveFormat(options.format ?? "svg");
|
|
18
|
+
const buf = await render(src, { format, resolution, crop: options.crop ?? true });
|
|
19
|
+
return { code: `export default ${JSON.stringify(renderToHtml(buf, format))}` };
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
}
|
|
7
23
|
export default function lilypond(options = {}) {
|
|
8
24
|
return {
|
|
9
25
|
name: "astro-lilypond",
|
|
@@ -14,6 +30,9 @@ export default function lilypond(options = {}) {
|
|
|
14
30
|
logger?.warn("astro-lilypond: `lilypond` binary not found — LilyPond blocks will render as errors. Install LilyPond and ensure it is on PATH.");
|
|
15
31
|
}
|
|
16
32
|
});
|
|
33
|
+
updateConfig({
|
|
34
|
+
vite: { plugins: [lyFilePlugin(options)] },
|
|
35
|
+
});
|
|
17
36
|
const existingProcessor = config.markdown?.processor;
|
|
18
37
|
if (existingProcessor?.name === "satteri") {
|
|
19
38
|
const { satteri, isSatteriProcessor } = await import("@astrojs/markdown-satteri");
|
|
@@ -28,7 +47,7 @@ export default function lilypond(options = {}) {
|
|
|
28
47
|
...existingOptions,
|
|
29
48
|
mdastPlugins: [
|
|
30
49
|
...(existingOptions.mdastPlugins ?? []),
|
|
31
|
-
satteriLilypondPlugin({ version: options.version, format: options.format }),
|
|
50
|
+
satteriLilypondPlugin({ version: options.version, format: options.format, crop: options.crop }),
|
|
32
51
|
],
|
|
33
52
|
}),
|
|
34
53
|
},
|
|
@@ -49,11 +68,11 @@ export default function lilypond(options = {}) {
|
|
|
49
68
|
...existingOptions,
|
|
50
69
|
remarkPlugins: [
|
|
51
70
|
...(existingOptions.remarkPlugins ?? []),
|
|
52
|
-
[remarkLilypondPlugin, { version: options.version, format: options.format }],
|
|
71
|
+
[remarkLilypondPlugin, { version: options.version, format: options.format, crop: options.crop }],
|
|
53
72
|
],
|
|
54
73
|
rehypePlugins: [
|
|
55
74
|
...(existingOptions.rehypePlugins ?? []),
|
|
56
|
-
[rehypeLilypondPlugin, { version: options.version, format: options.format }],
|
|
75
|
+
[rehypeLilypondPlugin, { version: options.version, format: options.format, crop: options.crop }],
|
|
57
76
|
],
|
|
58
77
|
}),
|
|
59
78
|
},
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AAEjC,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;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ist/rehype-plugin.d.ts
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export
|
|
3
|
-
version?: string;
|
|
4
|
-
format?: OutputFormat;
|
|
5
|
-
}
|
|
1
|
+
import type { LilypondPluginOptions } from "./util.js";
|
|
2
|
+
export type RehypePluginOptions = LilypondPluginOptions;
|
|
6
3
|
export declare function rehypeLilypondPlugin(options?: RehypePluginOptions): (tree: any) => Promise<void>;
|
|
7
4
|
//# sourceMappingURL=rehype-plugin.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rehype-plugin.d.ts","sourceRoot":"","sources":["../src/rehype-plugin.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"rehype-plugin.d.ts","sourceRoot":"","sources":["../src/rehype-plugin.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAQvD,MAAM,MAAM,mBAAmB,GAAG,qBAAqB,CAAC;AAKxD,wBAAgB,oBAAoB,CACnC,OAAO,GAAE,mBAAwB,GAC/B,CAAC,IAAI,EAAE,GAAG,KAAK,OAAO,CAAC,IAAI,CAAC,CAmD9B"}
|
package/dist/rehype-plugin.js
CHANGED
|
@@ -30,7 +30,7 @@ export function rehypeLilypondPlugin(options = {}) {
|
|
|
30
30
|
? prependVersion(raw, options.version)
|
|
31
31
|
: raw;
|
|
32
32
|
const { format, resolution } = resolveFormat(options.format ?? "svg");
|
|
33
|
-
const promise = render(source, { format, resolution })
|
|
33
|
+
const promise = render(source, { format, resolution, crop: options.crop })
|
|
34
34
|
.then((buf) => {
|
|
35
35
|
const rawNode = {
|
|
36
36
|
type: "raw",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rehype-plugin.js","sourceRoot":"","sources":["../src/rehype-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB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AClC,CAAC,CAAC,CAAC;YAEJ,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACxB,CAAC,CAAC,CAAC;QAEH,MAAM,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IAC7B,CAAC,CAAC;AACH,CAAC"}
|
package/dist/remark-plugin.d.ts
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import type { Root } from "mdast";
|
|
2
2
|
import type { Plugin } from "unified";
|
|
3
|
-
import type {
|
|
4
|
-
export
|
|
5
|
-
version?: string;
|
|
6
|
-
format?: OutputFormat;
|
|
7
|
-
}
|
|
3
|
+
import type { LilypondPluginOptions } from "./util.js";
|
|
4
|
+
export type RemarkPluginOptions = LilypondPluginOptions;
|
|
8
5
|
export declare const remarkLilypondPlugin: Plugin<[RemarkPluginOptions?], Root>;
|
|
9
6
|
//# sourceMappingURL=remark-plugin.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remark-plugin.d.ts","sourceRoot":"","sources":["../src/remark-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,IAAI,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAItC,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"remark-plugin.d.ts","sourceRoot":"","sources":["../src/remark-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,IAAI,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAItC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAEvD,MAAM,MAAM,mBAAmB,GAAG,qBAAqB,CAAC;AAExD,eAAO,MAAM,oBAAoB,EAAE,MAAM,CAAC,CAAC,mBAAmB,CAAC,CAAC,EAAE,IAAI,CAgCrE,CAAC"}
|
package/dist/remark-plugin.js
CHANGED
|
@@ -11,7 +11,7 @@ export const remarkLilypondPlugin = (options = {}) => {
|
|
|
11
11
|
? prependVersion(node.value, options.version)
|
|
12
12
|
: node.value;
|
|
13
13
|
const { format, resolution } = resolveFormat(options.format ?? "svg");
|
|
14
|
-
const promise = render(source, { format, resolution })
|
|
14
|
+
const promise = render(source, { format, resolution, crop: options.crop })
|
|
15
15
|
.then((buf) => {
|
|
16
16
|
const htmlNode = {
|
|
17
17
|
type: "html",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remark-plugin.js","sourceRoot":"","sources":["../src/remark-plugin.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,cAAc,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"remark-plugin.js","sourceRoot":"","sources":["../src/remark-plugin.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,cAAc,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAKnG,MAAM,CAAC,MAAM,oBAAoB,GAAyC,CACzE,OAAO,GAAG,EAAE,EACX,EAAE;IACH,OAAO,KAAK,EAAE,IAAI,EAAE,EAAE;QACrB,MAAM,QAAQ,GAAoB,EAAE,CAAC;QAErC,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE;YAC3C,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,KAAK,KAAK,SAAS,IAAI,CAAC,MAAM;gBAAE,OAAO;YAEzE,MAAM,MAA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,KAAK,CAAC;AAWnE,MAAM,WAAW,aAAa;IAC7B,0CAA0C;IAC1C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,kEAAkE;IAClE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,+DAA+D;IAC/D,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;CACf;AAED,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,aAAa,CAKlD,CAAC;AAEF,wBAAsB,MAAM,CAC3B,MAAM,EAAE,MAAM,EACd,OAAO,GAAE,aAAkB,GACzB,OAAO,CAAC,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../src/render.ts"],"names":[],"mappings":"AAQA,MAAM,MAAM,MAAM,GAAG,MAAM,GAAG,KAAK,GAAG,IAAI,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,CAAC;AAWnE,MAAM,WAAW,aAAa;IAC7B,0CAA0C;IAC1C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,kEAAkE;IAClE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,+DAA+D;IAC/D,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;CACf;AAED,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,aAAa,CAKlD,CAAC;AAEF,wBAAsB,MAAM,CAC3B,MAAM,EAAE,MAAM,EACd,OAAO,GAAE,aAAkB,GACzB,OAAO,CAAC,MAAM,CAAC,CA0CjB"}
|
package/dist/render.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { execFile } from "child_process";
|
|
2
|
-
import { mkdtemp, rm, writeFile } from "fs/promises";
|
|
2
|
+
import { mkdtemp, readFile, rm, writeFile } from "fs/promises";
|
|
3
3
|
import { join } from "path";
|
|
4
4
|
import { tmpdir } from "os";
|
|
5
5
|
import { promisify } from "util";
|
|
@@ -19,7 +19,8 @@ export const defaultOptions = {
|
|
|
19
19
|
crop: true,
|
|
20
20
|
};
|
|
21
21
|
export async function render(source, options = {}) {
|
|
22
|
-
const
|
|
22
|
+
const { format = defaultOptions.format, resolution = defaultOptions.resolution, binaryPath = defaultOptions.binaryPath, crop = defaultOptions.crop, } = options;
|
|
23
|
+
const opts = { format, resolution, binaryPath, crop };
|
|
23
24
|
if (!(opts.format in FORMAT_FLAGS)) {
|
|
24
25
|
throw new Error(`${opts.format} is not a supported format`);
|
|
25
26
|
}
|
|
@@ -30,11 +31,9 @@ export async function render(source, options = {}) {
|
|
|
30
31
|
await writeFile(inputPath, source, "utf8");
|
|
31
32
|
const args = [
|
|
32
33
|
FORMAT_FLAGS[opts.format],
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
"--define-default",
|
|
36
|
-
"no-point-and-click",
|
|
37
|
-
...(opts.crop ? ["--define-default", "crop"] : []),
|
|
34
|
+
`--define-default=resolution=${opts.resolution ?? 144}`,
|
|
35
|
+
"--define-default=no-point-and-click",
|
|
36
|
+
...(opts.crop ? ["--define-default=crop"] : []),
|
|
38
37
|
"--silent",
|
|
39
38
|
"--output",
|
|
40
39
|
outputBase,
|
|
@@ -50,7 +49,6 @@ export async function render(source, options = {}) {
|
|
|
50
49
|
}
|
|
51
50
|
}
|
|
52
51
|
async function readOutputFile(base, format, crop) {
|
|
53
|
-
const { readFile } = await import("fs/promises");
|
|
54
52
|
// --define-default crop writes <base>.cropped.<format> alongside <base>.<format>
|
|
55
53
|
if (crop) {
|
|
56
54
|
try {
|
package/dist/render.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render.js","sourceRoot":"","sources":["../src/render.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"render.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GAAG,IAAI,YAAY,MAAM,EAAE,CAAC,CAAC;QACpD,CAAC;QAAC,MAAM,CAAC;YACR,4DAA4D;QAC7D,CAAC;IACF,CAAC;IAED,gFAAgF;IAChF,IAAI,CAAC;QACJ,OAAO,MAAM,QAAQ,CAAC,GAAG,IAAI,IAAI,MAAM,EAAE,CAAC,CAAC;IAC5C,CAAC;IAAC,MAAM,CAAC;QACR,OAAO,MAAM,QAAQ,CAAC,GAAG,IAAI,MAAM,MAAM,EAAE,CAAC,CAAC;IAC9C,CAAC;AACF,CAAC"}
|
package/dist/satteri-plugin.d.ts
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import type { MdastPluginDefinition } from "satteri";
|
|
2
|
-
import type {
|
|
3
|
-
export
|
|
4
|
-
version?: string;
|
|
5
|
-
format?: OutputFormat;
|
|
6
|
-
}
|
|
2
|
+
import type { LilypondPluginOptions } from "./util.js";
|
|
3
|
+
export type SatteriPluginOptions = LilypondPluginOptions;
|
|
7
4
|
export declare function satteriLilypondPlugin(options?: SatteriPluginOptions): MdastPluginDefinition;
|
|
8
5
|
//# sourceMappingURL=satteri-plugin.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"satteri-plugin.d.ts","sourceRoot":"","sources":["../src/satteri-plugin.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACX,qBAAqB,EAErB,MAAM,SAAS,CAAC;AAGjB,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"satteri-plugin.d.ts","sourceRoot":"","sources":["../src/satteri-plugin.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACX,qBAAqB,EAErB,MAAM,SAAS,CAAC;AAGjB,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAEvD,MAAM,MAAM,oBAAoB,GAAG,qBAAqB,CAAC;AAEzD,wBAAgB,qBAAqB,CACpC,OAAO,GAAE,oBAAyB,GAChC,qBAAqB,CAuBvB"}
|
package/dist/satteri-plugin.js
CHANGED
|
@@ -14,7 +14,7 @@ export function satteriLilypondPlugin(options = {}) {
|
|
|
14
14
|
: node.value;
|
|
15
15
|
const { format, resolution } = resolveFormat(options.format ?? "svg");
|
|
16
16
|
try {
|
|
17
|
-
const buf = await render(source, { format, resolution });
|
|
17
|
+
const buf = await render(source, { format, resolution, crop: options.crop });
|
|
18
18
|
return { type: "html", value: renderToHtml(buf, format) };
|
|
19
19
|
}
|
|
20
20
|
catch (err) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"satteri-plugin.js","sourceRoot":"","sources":["../src/satteri-plugin.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,cAAc,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"satteri-plugin.js","sourceRoot":"","sources":["../src/satteri-plugin.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,cAAc,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAKnG,MAAM,UAAU,qBAAqB,CACpC,OAAO,GAAyB,EAAE;IAElC,OAAO;QACN,IAAI,EAAE,gBAAgB;QACtB,wEAAwE;QACxE,sEAAsE;QACtE,yEAAyE;QACzE,KAAK,CAAC,IAAI,CACT,IAAoB,EACpB,IAAyB;YAEzB,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC;gBAAE,OAAO,SAAS,CAAC;YACjD,MAAM,MAAM,GAAG,OAAO,CAAC,OAAO;gBAC7B,CAAC,CAAC,cAAc,CAAC,IAAI,CAAC,KAAK,EAAE,OAAO,CAAC,OAAO,CAAC;gBAC7C,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC;YACd,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,aAAa,CAAC,OAAO,CAAC,MAAM,IAAI,KAAK,CAAC,CAAC;YACtE,IAAI,CAAC;gBACJ,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;gBAC7E,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,EAAE,CAAC;YAC3D,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACd,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,CAAC,GAAG,CAAC,EAAE,CAAC;YAChD,CAAC;QACF,CAAC;KACD,CAAC;AACH,CAAC"}
|
package/dist/util.d.ts
CHANGED
|
@@ -2,6 +2,11 @@ export type OutputFormat = "svg" | "png" | {
|
|
|
2
2
|
type: "png";
|
|
3
3
|
resolution: number;
|
|
4
4
|
};
|
|
5
|
+
export interface LilypondPluginOptions {
|
|
6
|
+
version?: string;
|
|
7
|
+
format?: OutputFormat;
|
|
8
|
+
crop?: boolean;
|
|
9
|
+
}
|
|
5
10
|
/** Returns true for both accepted fenced-block language identifiers: `lilypond` and `ly`. */
|
|
6
11
|
export declare function isLilypondLang(lang: string | null | undefined): boolean;
|
|
7
12
|
/** Normalises an OutputFormat value into a plain format string and optional resolution (DPI). */
|
package/dist/util.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../src/util.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,GAAG,KAAK,GAAG,KAAK,GAAG;IAAE,IAAI,EAAE,KAAK,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,CAAC;AAE/E,6FAA6F;AAC7F,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS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AM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAGtE;AAED,2FAA2F;AAC3F,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,GAAG,KAAK,GAAG,MAAM,CAMvE;AAED,wEAAwE;AACxE,wBAAgB,SAAS,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,CAG9C"}
|
package/dist/util.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"util.js","sourceRoot":"","sources":["../src/util.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"util.js","sourceRoot":"","sources":["../src/util.ts"],"names":[],"mappings":"AAQA,6FAA6F;AAC7F,MAAM,UAAU,cAAc,CAAC,IAA+B;IAC7D,OAAO,IAAI,KAAK,UAAU,IAAI,IAAI,KAAK,IAAI,CAAC;AAC7C,CAAC;AAED,iGAAiG;AACjG,MAAM,UAAU,aAAa,CAAC,MAAoB;IAIjD,IAAI,OAAO,MAAM,KAAK,QAAQ;QAAE,OAAO,EAAE,MAAM,EAAE,CAAC;IAClD,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,IAAI,EAAE,UAAU,EAAE,MAAM,CAAC,UAAU,EAAE,CAAC;AAC/D,CAAC;AAED,MAAM,aAAa,GAA2B;IAC7C,GAAG,EAAE,OAAO;IACZ,GAAG,EAAE,MAAM;IACX,GAAG,EAAE,MAAM;IACX,GAAG,EAAE,QAAQ;IACb,GAAG,EAAE,OAAO;CACZ,CAAC;AAEF,MAAM,UAAU,UAAU,CAAC,IAAa;IACvC,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;AACvE,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,cAAc,CAAC,MAAc,EAAE,OAAe;IAC7D,IAAI,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC;QAAE,OAAO,MAAM,CAAC;IAC9C,OAAO,cAAc,OAAO,MAAM,MAAM,EAAE,CAAC;AAC5C,CAAC;AAED,2FAA2F;AAC3F,MAAM,UAAU,YAAY,CAAC,GAAW,EAAE,MAAqB;IAC9D,IAAI,MAAM,KAAK,KAAK,EAAE,CAAC;QACtB,MAAM,GAAG,GAAG,GAAG,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;QACnC,OAAO,oDAAoD,GAAG,4BAA4B,CAAC;IAC5F,CAAC;IACD,OAAO,GAAG,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,QAAQ,EAAE,uBAAuB,CAAC,CAAC;AACzE,CAAC;AAED,wEAAwE;AACxE,MAAM,UAAU,SAAS,CAAC,GAAY;IACrC,MAAM,GAAG,GAAG,UAAU,CAAC,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;IACzE,OAAO,+JAA+J,GAAG,QAAQ,CAAC;AACnL,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "astro-lilypond",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "An Astro integration for rendering Lilypond scores to images in Markdown.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -9,10 +9,12 @@
|
|
|
9
9
|
".": {
|
|
10
10
|
"types": "./dist/index.d.ts",
|
|
11
11
|
"import": "./dist/index.js"
|
|
12
|
-
}
|
|
12
|
+
},
|
|
13
|
+
"./component": "./components/LilyPond.astro"
|
|
13
14
|
},
|
|
14
15
|
"files": [
|
|
15
|
-
"dist"
|
|
16
|
+
"dist",
|
|
17
|
+
"components"
|
|
16
18
|
],
|
|
17
19
|
"keywords": [
|
|
18
20
|
"astro",
|
|
@@ -23,43 +25,32 @@
|
|
|
23
25
|
"score",
|
|
24
26
|
"engraving"
|
|
25
27
|
],
|
|
28
|
+
"repository": {
|
|
29
|
+
"type": "git",
|
|
30
|
+
"url": "https://github.com/kydecker/astro-lilypond"
|
|
31
|
+
},
|
|
26
32
|
"author": "Ky Decker",
|
|
27
33
|
"license": "MIT",
|
|
34
|
+
"peerDependencies": {
|
|
35
|
+
"astro": ">=7.0.0"
|
|
36
|
+
},
|
|
37
|
+
"dependencies": {
|
|
38
|
+
"unist-util-visit": "^5.1.0"
|
|
39
|
+
},
|
|
28
40
|
"devDependencies": {
|
|
29
41
|
"@astrojs/markdown-remark": "^7.2.1",
|
|
30
42
|
"@astrojs/markdown-satteri": "^0.3.4",
|
|
31
|
-
"@changesets/cli": "^2.31.0",
|
|
32
43
|
"@types/mdast": "^4.0.4",
|
|
33
44
|
"@types/node": "^26.1.1",
|
|
34
45
|
"astro": "^7.0.8",
|
|
35
|
-
"biome": "^0.3.3",
|
|
36
|
-
"nano-staged": "^1.0.2",
|
|
37
46
|
"satteri": "^0.9.5",
|
|
38
|
-
"simple-git-hooks": "^2.13.1",
|
|
39
47
|
"typescript": "^7.0.2",
|
|
40
48
|
"unified": "^11.0.5",
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
},
|
|
44
|
-
"peerDependencies": {
|
|
45
|
-
"astro": ">=7.0.0"
|
|
46
|
-
},
|
|
47
|
-
"dependencies": {
|
|
48
|
-
"unist-util-visit": "^5.1.0"
|
|
49
|
-
},
|
|
50
|
-
"simple-git-hooks": {
|
|
51
|
-
"pre-commit": "./node_modules/.bin/nano-staged"
|
|
52
|
-
},
|
|
53
|
-
"nano-staged": {
|
|
54
|
-
"*.{js,mjs,cjs,jsx,ts,mts,cts,tsx,json,jsonc,css,astro}": [
|
|
55
|
-
"biome check --write"
|
|
56
|
-
]
|
|
49
|
+
"vite": "^8.0.0",
|
|
50
|
+
"vitest": "^4.1.10"
|
|
57
51
|
},
|
|
58
52
|
"scripts": {
|
|
59
53
|
"build": "tsc --project tsconfig.json",
|
|
60
|
-
"release": "changeset publish",
|
|
61
|
-
"check": "biome check",
|
|
62
|
-
"check:fix": "biome check --write",
|
|
63
54
|
"test": "vitest"
|
|
64
55
|
}
|
|
65
56
|
}
|
package/README.md
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
# astro-lilypond
|
|
2
|
-
|
|
3
|
-
An [Astro](https://astro.build) integration for rendering [LilyPond](https://lilypond.org) music notation to images.
|
|
4
|
-
|
|
5
|
-
## Quick Start
|
|
6
|
-
|
|
7
|
-
### Prerequisites
|
|
8
|
-
|
|
9
|
-
Install the LilyPond binary directly from [lilypond.org](https://lilypond.org/download.html) or with a package manager like [Homebrew](https://formulae.brew.sh/formula/lilypond).
|
|
10
|
-
|
|
11
|
-
```sh
|
|
12
|
-
brew install lilypond
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
### Installation
|
|
16
|
-
|
|
17
|
-
#### 1. Install `astro-lilypond`:
|
|
18
|
-
|
|
19
|
-
```sh
|
|
20
|
-
pnpm add astro-lilypond
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
#### 2. Add the integration to your Astro config:
|
|
24
|
-
|
|
25
|
-
```js
|
|
26
|
-
// astro.config.mjs
|
|
27
|
-
import { defineConfig } from 'astro/config';
|
|
28
|
-
import lilypond from 'astro-lilypond';
|
|
29
|
-
|
|
30
|
-
export default defineConfig({
|
|
31
|
-
integrations: [lilypond()]
|
|
32
|
-
});
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
#### 3. Use in Markdown:
|
|
36
|
-
|
|
37
|
-
````md
|
|
38
|
-
```lilypond
|
|
39
|
-
\\score ...
|
|
40
|
-
```
|
|
41
|
-
````
|
|
42
|
-
|
|
43
|
-
## Docs
|
|
44
|
-
|
|
45
|
-
Learn more at the [`astro-lilypond` docs](https://lilypond.ky.fyi).
|