@lowlighter/markdown 2.0.0 → 3.0.1
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 +31 -33
- package/mod.d.ts +34 -0
- package/mod.js +22 -0
- package/package.json +117 -40
- package/plugins/anchors.d.ts +11 -0
- package/plugins/anchors.js +39 -0
- package/plugins/callouts.d.ts +14 -0
- package/plugins/callouts.js +31 -0
- package/plugins/directives.d.ts +24 -0
- package/plugins/directives.js +76 -0
- package/plugins/emojis.d.ts +11 -0
- package/plugins/emojis.js +15 -0
- package/plugins/frontmatter.d.ts +20 -0
- package/plugins/frontmatter.js +49 -0
- package/plugins/gfm.d.ts +18 -0
- package/plugins/gfm.js +43 -0
- package/plugins/{highlighting.ts → highlighting.d.ts} +2 -11
- package/plugins/highlighting.js +24 -0
- package/plugins/markers.d.ts +15 -0
- package/plugins/markers.js +30 -0
- package/plugins/math.d.ts +21 -0
- package/plugins/math.js +75 -0
- package/plugins/mermaid.d.ts +25 -0
- package/plugins/mermaid.js +32 -0
- package/plugins/mod.d.ts +15 -0
- package/plugins/mod.js +14 -0
- package/plugins/{ruby.ts → ruby.d.ts} +2 -11
- package/plugins/ruby.js +28 -0
- package/plugins/uncomments.d.ts +13 -0
- package/plugins/uncomments.js +28 -0
- package/plugins/wikilinks.d.ts +26 -0
- package/plugins/wikilinks.js +45 -0
- package/presets/default.d.ts +3 -0
- package/presets/default.js +9 -0
- package/presets/svg.d.ts +3 -0
- package/presets/svg.js +11 -0
- package/presets/text.d.ts +3 -0
- package/presets/text.js +11 -0
- package/presets/web.d.ts +3 -0
- package/presets/web.js +12 -0
- package/renderer.d.ts +62 -0
- package/renderer.js +70 -0
- package/types.d.ts +85 -0
- package/types.js +10 -0
- package/deno.jsonc +0 -124
- package/deno.lock +0 -2282
- package/mod.mjs +0 -1
- package/mod.ts +0 -2
- package/mod_test.ts +0 -1
- package/plugins/anchors.mjs +0 -1
- package/plugins/anchors.ts +0 -21
- package/plugins/anchors_test.ts +0 -8
- package/plugins/directives.mjs +0 -1
- package/plugins/directives.ts +0 -112
- package/plugins/directives_test.ts +0 -13
- package/plugins/emojis.mjs +0 -1
- package/plugins/emojis.ts +0 -20
- package/plugins/emojis_test.ts +0 -8
- package/plugins/frontmatter.mjs +0 -1
- package/plugins/frontmatter.ts +0 -43
- package/plugins/frontmatter_test.ts +0 -18
- package/plugins/gfm.mjs +0 -1
- package/plugins/gfm.ts +0 -14
- package/plugins/gfm_test.ts +0 -28
- package/plugins/highlighting.mjs +0 -1
- package/plugins/highlighting_test.ts +0 -8
- package/plugins/linebreaks.mjs +0 -1
- package/plugins/linebreaks.ts +0 -21
- package/plugins/linebreaks_test.ts +0 -8
- package/plugins/markers.mjs +0 -1
- package/plugins/markers.ts +0 -25
- package/plugins/markers_test.ts +0 -13
- package/plugins/math.mjs +0 -1
- package/plugins/math.ts +0 -25
- package/plugins/math_test.ts +0 -8
- package/plugins/mermaid.mjs +0 -1
- package/plugins/mermaid.ts +0 -41
- package/plugins/mermaid_test.ts +0 -8
- package/plugins/mod.mjs +0 -1
- package/plugins/mod.ts +0 -14
- package/plugins/ruby.mjs +0 -1
- package/plugins/ruby_test.ts +0 -8
- package/plugins/sanitize.mjs +0 -1
- package/plugins/sanitize.ts +0 -26
- package/plugins/sanitize_test.ts +0 -15
- package/plugins/uncomments.mjs +0 -1
- package/plugins/uncomments.ts +0 -20
- package/plugins/uncomments_test.ts +0 -8
- package/plugins/wikilinks.mjs +0 -1
- package/plugins/wikilinks.ts +0 -40
- package/plugins/wikilinks_test.ts +0 -14
- package/renderer.mjs +0 -1
- package/renderer.ts +0 -138
- package/renderer_test.ts +0 -19
package/plugins/mermaid.ts
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
// Imports
|
|
2
|
-
import type { Plugin } from "../renderer.ts"
|
|
3
|
-
import rehypeMermaid from "rehype-mermaid"
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Add support for Mermaid diagrams.
|
|
7
|
-
*
|
|
8
|
-
* {@link https://mermaid-js.github.io/mermaid/ | See Mermaid documentation for more information}.
|
|
9
|
-
*
|
|
10
|
-
* > [!WARNING]
|
|
11
|
-
* > This plugin requires playwright browser to be installed.
|
|
12
|
-
* >
|
|
13
|
-
* > You can install it by running the following command:
|
|
14
|
-
* > ```sh
|
|
15
|
-
* > npx playwright-core install --with-deps chromium
|
|
16
|
-
* > ```
|
|
17
|
-
*
|
|
18
|
-
* > [!WARNING]
|
|
19
|
-
* > This plugin requires the following permission in Deno:
|
|
20
|
-
* > - read
|
|
21
|
-
* > - env
|
|
22
|
-
* > - sys
|
|
23
|
-
* > - write: <TMP>
|
|
24
|
-
* > - run: <location to playwright browser executable>
|
|
25
|
-
*
|
|
26
|
-
* @example
|
|
27
|
-
* ````md
|
|
28
|
-
* ```mermaid
|
|
29
|
-
* graph TD;
|
|
30
|
-
* A-->B;
|
|
31
|
-
* A-->C;
|
|
32
|
-
* B-->D;
|
|
33
|
-
* C-->D;
|
|
34
|
-
* ```
|
|
35
|
-
* ````
|
|
36
|
-
*/
|
|
37
|
-
export default {
|
|
38
|
-
rehype(processor) {
|
|
39
|
-
return processor.use(rehypeMermaid, { strategy: "inline-svg", launchOptions: { headless: true, args: ["--no-sandbox", "--disable-setuid-sandbox", "--disable-dev-shm-usage", "--disable-accelerated-2d-canvas", "--no-zygote", "--disable-gpu"] } })
|
|
40
|
-
},
|
|
41
|
-
} as Plugin
|
package/plugins/mermaid_test.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { expect, test } from "@libs/testing"
|
|
2
|
-
import { Renderer } from "../renderer.ts"
|
|
3
|
-
import plugin from "./mermaid.ts"
|
|
4
|
-
|
|
5
|
-
test.skip("deno")("`Plugin.mermaid` renders mermaid diagrams", async () => {
|
|
6
|
-
const markdown = new Renderer({ plugins: [plugin] })
|
|
7
|
-
await expect(markdown.render("```mermaid\ngraph TD;\nA-->A;\n```")).resolves.toMatch(/foo<br>\nbar/)
|
|
8
|
-
}, { permissions: { read: true, env: true, sys: true, write: "inherit", run: "inherit" } })
|