marked-abc 0.0.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 MaddyGuthridge
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,40 @@
1
+ # Marked ABC
2
+
3
+ Render sheet music with [ABCjs](https://www.abcjs.net/) in Markdown documents
4
+ using [Marked](https://marked.js.org/).
5
+
6
+ ## Usage
7
+
8
+ This only renders in the browser.
9
+
10
+ ```js
11
+ import {Marked} from "marked";
12
+ import markedAbc from "marked-abc";
13
+
14
+ const marked = new Marked();
15
+
16
+ marked.use(markedAbc());
17
+
18
+ marked.parse(`
19
+ <score lang="ABC">
20
+ X: 1
21
+ T: Epitome of an Enigma
22
+ C: Zarhym Raider
23
+ M: 2/2
24
+ L: 1/8
25
+ K: C#min
26
+ G2|g2 fe d2 c2 | B2 F2 G2 EF | G2 AB A2 G2 | F2 D2 E2 |]
27
+ </score>
28
+ `);
29
+ // Beautifully formatted sheet music as the output
30
+ ```
31
+
32
+ ## Options
33
+
34
+ * `abcOptions`: [options for `abcjs.renderAbc`](https://docs.abcjs.net/visual/render-abc-options.html)
35
+ * `sanitizer`: function to sanitize abcJS score. To minimize dependencies, this
36
+ library only performs basic escaping to HTML, meaning that maliciously-crafted
37
+ scores could perform an [XSS](https://en.wikipedia.org/wiki/Cross-site_scripting)
38
+ attack. If your scores are user-generated and can be shared, you should use a
39
+ library such as [`DOMPurify`](https://www.npmjs.com/package/dompurify) to
40
+ maximize the safety of the rendering.
package/lib/index.d.ts ADDED
@@ -0,0 +1,18 @@
1
+ // Generated by dts-bundle-generator v9.5.1
2
+
3
+ import * as abcjs from 'abcjs';
4
+ import { MarkedExtension } from 'marked';
5
+
6
+ export type MarkedAbcOptions = {
7
+ /** Options to pass to ABCjs */
8
+ abcOptions?: abcjs.AbcVisualParams;
9
+ /** Sanitizer function */
10
+ sanitizer?: (text: string) => string;
11
+ };
12
+ declare function _default(options?: MarkedAbcOptions): MarkedExtension;
13
+
14
+ export {
15
+ _default as default,
16
+ };
17
+
18
+ export {};