@wenyan-md/core 1.0.1 → 1.0.2
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/dist/types/wrapper.d.ts +7 -0
- package/dist/wrapper.js +15 -0
- package/package.json +7 -4
package/dist/wrapper.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { JSDOM as a } from "jsdom";
|
|
2
|
+
import { configureMarked as s, handleFrontMatter as m, renderMarkdown as w, getContentForGzh as l } from "./core.js";
|
|
3
|
+
async function f(n, o, e, r) {
|
|
4
|
+
s();
|
|
5
|
+
const t = m(n), c = await w(t.body), d = new a(`<body><section id="wenyan">${c}</section></body>`).window.document, i = await l(d, o, e, r);
|
|
6
|
+
return {
|
|
7
|
+
title: t.title,
|
|
8
|
+
cover: t.cover,
|
|
9
|
+
content: i,
|
|
10
|
+
description: t.description
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
export {
|
|
14
|
+
f as getGzhContent
|
|
15
|
+
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wenyan-md/core",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "Core library for Wenyan markdown rendering & publishing",
|
|
5
|
+
"author": "Lei <caol64@gmail.com> (https://github.com/caol64)",
|
|
6
|
+
"license": "Apache-2.0",
|
|
7
|
+
"keywords": ["公众号", "markdown", "文颜", "wenyan", "wechat", "publishing", "renderer"],
|
|
5
8
|
"type": "module",
|
|
6
9
|
"files": [
|
|
7
10
|
"dist"
|
|
@@ -10,17 +13,17 @@
|
|
|
10
13
|
"module": "./dist/core.js",
|
|
11
14
|
"exports": {
|
|
12
15
|
".": "./dist/core.js",
|
|
13
|
-
"./publish": "./dist/publish.js"
|
|
16
|
+
"./publish": "./dist/publish.js",
|
|
17
|
+
"./wrapper": "./dist/wrapper.js"
|
|
14
18
|
},
|
|
15
19
|
"scripts": {
|
|
16
20
|
"dev": "vite build --watch",
|
|
17
21
|
"build": "vite build && tsc",
|
|
18
22
|
"testMain": "vitest run main.test.js",
|
|
23
|
+
"testWrapper": "vitest run wrapper.test.js",
|
|
19
24
|
"testPublish": "vitest run publish.test.js",
|
|
20
25
|
"prepublishOnly": "pnpm build"
|
|
21
26
|
},
|
|
22
|
-
"keywords": [],
|
|
23
|
-
"author": "",
|
|
24
27
|
"packageManager": "pnpm@10.7.1",
|
|
25
28
|
"devDependencies": {
|
|
26
29
|
"@types/css-tree": "^2.3.10",
|