markdown-paper 2.0.0 → 2.1.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 +83 -82
- package/bin/mdp.ts +36 -36
- package/bun.lockb +0 -0
- package/lib/docx.ts +18 -18
- package/lib/main.ts +167 -176
- package/license +673 -673
- package/package.json +3 -3
- package/theme/aps/aps.css +136 -133
- package/theme/aps/aps.md +40 -40
- package/theme/aps/aps.ts +129 -121
- package/theme/theme.ts +44 -44
- package/tsconfig.json +27 -27
package/theme/theme.ts
CHANGED
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
import type { PDFOptions } from 'puppeteer-core'
|
|
2
|
-
|
|
3
|
-
export abstract class Theme {
|
|
4
|
-
/**
|
|
5
|
-
* @param args 命令行参数
|
|
6
|
-
* @param cwd 当前工作目录
|
|
7
|
-
*/
|
|
8
|
-
constructor(args?: string[], cwd?: string) {
|
|
9
|
-
this.args = args ?? []
|
|
10
|
-
this.cwd = cwd ?? process.cwd()
|
|
11
|
-
}
|
|
12
|
-
/** 命令行参数 */
|
|
13
|
-
args: string[]
|
|
14
|
-
/** 当前工作目录 */
|
|
15
|
-
cwd: string
|
|
16
|
-
/**
|
|
17
|
-
* css 样式
|
|
18
|
-
* 不含 \<style>\</style>
|
|
19
|
-
*/
|
|
20
|
-
abstract css: string
|
|
21
|
-
/**
|
|
22
|
-
* 预处理 markdown 字符串
|
|
23
|
-
* 用于转换自定义标签等
|
|
24
|
-
* @param md markdown 字符串
|
|
25
|
-
* @returns 转换后的 markdown 字符串
|
|
26
|
-
*/
|
|
27
|
-
abstract preParseMarkdown(md: string): string
|
|
28
|
-
/**
|
|
29
|
-
* 预处理 html 字符串
|
|
30
|
-
* 将在保存 html 文件前调用
|
|
31
|
-
* @param html html 字符串
|
|
32
|
-
* @returns 转换后的 html 字符串
|
|
33
|
-
*/
|
|
34
|
-
abstract preParseHTML(html: string): string
|
|
35
|
-
/**
|
|
36
|
-
* 在网页中要执行的函数
|
|
37
|
-
* 将在保存 html 文件后调用
|
|
38
|
-
*/
|
|
39
|
-
abstract script(): void
|
|
40
|
-
/**
|
|
41
|
-
* PDF 参数
|
|
42
|
-
* 无需设置路径
|
|
43
|
-
*/
|
|
44
|
-
abstract pdfOptions: PDFOptions
|
|
1
|
+
import type { PDFOptions } from 'puppeteer-core'
|
|
2
|
+
|
|
3
|
+
export abstract class Theme {
|
|
4
|
+
/**
|
|
5
|
+
* @param args 命令行参数
|
|
6
|
+
* @param cwd 当前工作目录
|
|
7
|
+
*/
|
|
8
|
+
constructor(args?: string[], cwd?: string) {
|
|
9
|
+
this.args = args ?? []
|
|
10
|
+
this.cwd = cwd ?? process.cwd()
|
|
11
|
+
}
|
|
12
|
+
/** 命令行参数 */
|
|
13
|
+
args: string[]
|
|
14
|
+
/** 当前工作目录 */
|
|
15
|
+
cwd: string
|
|
16
|
+
/**
|
|
17
|
+
* css 样式
|
|
18
|
+
* 不含 \<style>\</style>
|
|
19
|
+
*/
|
|
20
|
+
abstract css: string
|
|
21
|
+
/**
|
|
22
|
+
* 预处理 markdown 字符串
|
|
23
|
+
* 用于转换自定义标签等
|
|
24
|
+
* @param md markdown 字符串
|
|
25
|
+
* @returns 转换后的 markdown 字符串
|
|
26
|
+
*/
|
|
27
|
+
abstract preParseMarkdown(md: string): string
|
|
28
|
+
/**
|
|
29
|
+
* 预处理 html 字符串
|
|
30
|
+
* 将在保存 html 文件前调用
|
|
31
|
+
* @param html html 字符串
|
|
32
|
+
* @returns 转换后的 html 字符串
|
|
33
|
+
*/
|
|
34
|
+
abstract preParseHTML(html: string): string
|
|
35
|
+
/**
|
|
36
|
+
* 在网页中要执行的函数
|
|
37
|
+
* 将在保存 html 文件后调用
|
|
38
|
+
*/
|
|
39
|
+
abstract script(): void
|
|
40
|
+
/**
|
|
41
|
+
* PDF 参数
|
|
42
|
+
* 无需设置路径
|
|
43
|
+
*/
|
|
44
|
+
abstract pdfOptions: PDFOptions
|
|
45
45
|
}
|
package/tsconfig.json
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
// Enable latest features
|
|
4
|
-
"lib": ["ESNext", "DOM"],
|
|
5
|
-
"target": "ESNext",
|
|
6
|
-
"module": "ESNext",
|
|
7
|
-
"moduleDetection": "force",
|
|
8
|
-
"jsx": "react-jsx",
|
|
9
|
-
"allowJs": true,
|
|
10
|
-
|
|
11
|
-
// Bundler mode
|
|
12
|
-
"moduleResolution": "bundler",
|
|
13
|
-
"allowImportingTsExtensions": true,
|
|
14
|
-
"verbatimModuleSyntax": true,
|
|
15
|
-
"noEmit": true,
|
|
16
|
-
|
|
17
|
-
// Best practices
|
|
18
|
-
"strict": true,
|
|
19
|
-
"skipLibCheck": true,
|
|
20
|
-
"noFallthroughCasesInSwitch": true,
|
|
21
|
-
|
|
22
|
-
// Some stricter flags (disabled by default)
|
|
23
|
-
"noUnusedLocals": true,
|
|
24
|
-
"noUnusedParameters": true,
|
|
25
|
-
"noPropertyAccessFromIndexSignature": true
|
|
26
|
-
}
|
|
27
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
// Enable latest features
|
|
4
|
+
"lib": ["ESNext", "DOM"],
|
|
5
|
+
"target": "ESNext",
|
|
6
|
+
"module": "ESNext",
|
|
7
|
+
"moduleDetection": "force",
|
|
8
|
+
"jsx": "react-jsx",
|
|
9
|
+
"allowJs": true,
|
|
10
|
+
|
|
11
|
+
// Bundler mode
|
|
12
|
+
"moduleResolution": "bundler",
|
|
13
|
+
"allowImportingTsExtensions": true,
|
|
14
|
+
"verbatimModuleSyntax": true,
|
|
15
|
+
"noEmit": true,
|
|
16
|
+
|
|
17
|
+
// Best practices
|
|
18
|
+
"strict": true,
|
|
19
|
+
"skipLibCheck": true,
|
|
20
|
+
"noFallthroughCasesInSwitch": true,
|
|
21
|
+
|
|
22
|
+
// Some stricter flags (disabled by default)
|
|
23
|
+
"noUnusedLocals": true,
|
|
24
|
+
"noUnusedParameters": true,
|
|
25
|
+
"noPropertyAccessFromIndexSignature": true
|
|
26
|
+
}
|
|
27
|
+
}
|