markdown-to-html-cli 3.2.5 → 3.2.6
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 +47 -0
- package/lib/create.js +4 -2
- package/lib/create.js.map +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.js +6 -45
- package/lib/index.js.map +1 -1
- package/lib/utils.d.ts +3 -0
- package/lib/utils.js +49 -0
- package/lib/utils.js.map +1 -0
- package/package.json +23 -40
- package/LICENSE +0 -21
- package/github-fork-ribbon.css +0 -91
- package/github.css +0 -930
package/README.md
CHANGED
|
@@ -17,6 +17,15 @@ Used in Github [Actions](https://github.com/actions).
|
|
|
17
17
|
```yml
|
|
18
18
|
- run: npm i markdown-to-html-cli -g
|
|
19
19
|
- run: markdown-to-html --output coverage/index.html
|
|
20
|
+
- run: markdown-to-html --source src/README.md --output coverage/index.html
|
|
21
|
+
# or
|
|
22
|
+
- name: Converts Markdown to HTML
|
|
23
|
+
uses: jaywcjlove/github-action-contributors@main
|
|
24
|
+
with:
|
|
25
|
+
source: README-zh.md
|
|
26
|
+
output: coverage/action.html
|
|
27
|
+
github-corners: https://github.com/jaywcjlove/markdown-to-html-cli
|
|
28
|
+
favicon: data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text y=%22.9em%22 font-size=%2290%22>🌐</text></svg>
|
|
20
29
|
```
|
|
21
30
|
|
|
22
31
|
Using With Command.
|
|
@@ -52,6 +61,34 @@ const html = create({
|
|
|
52
61
|
$ npm i markdown-to-html-cli
|
|
53
62
|
```
|
|
54
63
|
|
|
64
|
+
## Github [Actions](https://github.com/actions)
|
|
65
|
+
|
|
66
|
+
```yml
|
|
67
|
+
- name: Converts Markdown to HTML
|
|
68
|
+
uses: jaywcjlove/markdown-to-html-cli@main
|
|
69
|
+
with:
|
|
70
|
+
source: README-zh.md
|
|
71
|
+
output: coverage/action.html
|
|
72
|
+
github-corners: https://github.com/jaywcjlove/markdown-to-html-cli
|
|
73
|
+
favicon: data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text y=%22.9em%22 font-size=%2290%22>🌐</text></svg>
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### Input Parameters
|
|
77
|
+
|
|
78
|
+
- `output` - Output static pages to the specified directory. (default: `index.html`)
|
|
79
|
+
- `source` - The path of the target file "README.md". (default: `README.md`)
|
|
80
|
+
- `description` - Define a description of your web page.
|
|
81
|
+
- `config` - Specify the configuration file. (default: `package.json`)
|
|
82
|
+
- `markdown` - Markdown string
|
|
83
|
+
- `favicon` - Add a Favicon to your Site.
|
|
84
|
+
- `github-corners` - Add a Github corner to your project page.
|
|
85
|
+
|
|
86
|
+
### Output Parameters
|
|
87
|
+
|
|
88
|
+
- `output` - Output static pages to the specified directory
|
|
89
|
+
- `markdown` - Markdown string
|
|
90
|
+
- `html` - HTML string
|
|
91
|
+
|
|
55
92
|
## Configure in package.json
|
|
56
93
|
|
|
57
94
|
The configuration can be specified through `--config="config/conf.json"`, It can be in `package.json` by default.
|
|
@@ -218,6 +255,16 @@ $ npm run build
|
|
|
218
255
|
$ npm run watch
|
|
219
256
|
```
|
|
220
257
|
|
|
258
|
+
## Contributors
|
|
259
|
+
|
|
260
|
+
As always, thanks to our amazing contributors!
|
|
261
|
+
|
|
262
|
+
<a href="https://github.com/jaywcjlove/markdown-to-html-cli/graphs/contributors">
|
|
263
|
+
<img src="https://jaywcjlove.github.io/markdown-to-html-cli/CONTRIBUTORS.svg" />
|
|
264
|
+
</a>
|
|
265
|
+
|
|
266
|
+
Made with [github-action-contributors](https://github.com/jaywcjlove/github-action-contributors).
|
|
267
|
+
|
|
221
268
|
## License
|
|
222
269
|
|
|
223
270
|
MIT © [Kenny Wong](https://wangchujiang.com/)
|
package/lib/create.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import fs from 'fs
|
|
1
|
+
import fs from 'fs';
|
|
2
2
|
import path from 'path';
|
|
3
3
|
import { unified } from 'unified';
|
|
4
4
|
import rehypeDocument from 'rehype-document';
|
|
5
5
|
// @ts-ignore
|
|
6
|
-
import rehypePrism from '@mapbox/rehype-prism
|
|
6
|
+
import rehypePrism from '@mapbox/rehype-prism';
|
|
7
7
|
import stringify from 'rehype-stringify';
|
|
8
8
|
import rehypeSlug from 'rehype-slug';
|
|
9
9
|
import rehypeFormat from 'rehype-format';
|
|
@@ -26,6 +26,8 @@ import { octiconLink } from './nodes/octiconLink.js';
|
|
|
26
26
|
import { copyElement } from './nodes/copy.js';
|
|
27
27
|
// https://stackoverflow.com/questions/46745014/alternative-for-dirname-in-node-when-using-the-experimental-modules-flag
|
|
28
28
|
// export const _dirname = dirname(fileURLToPath(import.meta.url));
|
|
29
|
+
// const filename = fileURLToPath(import.meta.url);
|
|
30
|
+
// const dirname = path.dirname(filename);
|
|
29
31
|
export const _dirname = /file:\/\/(.+)\/[^/]/.exec(import.meta.url)[1];
|
|
30
32
|
const script = `function copied(target, str) {
|
|
31
33
|
target.classList.add('active');
|
package/lib/create.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create.js","sourceRoot":"","sources":["../src/create.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"create.js","sourceRoot":"","sources":["../src/create.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAElC,OAAO,cAAc,MAAM,iBAAiB,CAAC;AAC7C,aAAa;AACb,OAAO,WAAW,MAAM,sBAAsB,CAAC;AAC/C,OAAO,SAAS,MAAM,kBAAkB,CAAC;AACzC,OAAO,UAAU,MAAM,aAAa,CAAC;AACrC,OAAO,YAAY,MAAM,eAAe,CAAC;AACzC,OAAO,sBAAsB,MAAM,0BAA0B,CAAC;AA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C/B,IAAI,KAAK,IAAI,KAAK,CAAC,IAAI,KAAK,SAAS,IAAI,KAAK,CAAC,UAAU,EAAE;oBACzD,KAAK,CAAC,UAAU,GAAG,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC,UAAU,EAAE,CAAC;oBAChE,KAAK,CAAC,QAAQ,GAAG,CAAC,WAAW,EAAE,CAAC,CAAC;iBAClC;aACF;YACD,IAAI,IAAI,CAAC,IAAI,IAAI,SAAS,IAAI,IAAI,CAAC,OAAO,KAAK,KAAK,EAAE;gBACpD,MAAM,IAAI,GAAG,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;gBACvC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC;aACvC;YACD,IAAI,OAAO,IAAI,OAAO,OAAO,KAAK,UAAU,EAAE;gBAC5C,OAAO,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;aAC9B;QACH,CAAC;KACF,CAAC;SACD,GAAG,CAAC,YAAY,CAAC;SACjB,GAAG,CAAC,SAAS,CAAC;SACd,WAAW,CAAC,QAAQ,CAAC;SACrB,QAAQ,EAAE,CAAC;AAChB,CAAC"}
|
package/lib/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { ParsedArgs } from 'minimist';
|
|
|
2
2
|
import { Options } from 'rehype-document';
|
|
3
3
|
import { RehypeRewriteOptions } from 'rehype-rewrite';
|
|
4
4
|
export * from './create';
|
|
5
|
+
export * from './utils';
|
|
5
6
|
export interface RunArgvs extends Omit<ParsedArgs, '_'> {
|
|
6
7
|
version?: string;
|
|
7
8
|
source?: string;
|
package/lib/index.js
CHANGED
|
@@ -2,8 +2,9 @@ import fs from 'fs-extra';
|
|
|
2
2
|
import path from 'path';
|
|
3
3
|
import minimist from 'minimist';
|
|
4
4
|
import { create, _dirname } from './create.js';
|
|
5
|
+
import { formatConfig } from './utils.js';
|
|
5
6
|
export * from './create.js';
|
|
6
|
-
|
|
7
|
+
export * from './utils.js';
|
|
7
8
|
export function run(opts = {}) {
|
|
8
9
|
const argvs = minimist(process.argv.slice(2), {
|
|
9
10
|
alias: {
|
|
@@ -26,56 +27,16 @@ export function run(opts = {}) {
|
|
|
26
27
|
console.log(`${cliHelp}${exampleHelp}`);
|
|
27
28
|
return;
|
|
28
29
|
}
|
|
29
|
-
|
|
30
|
+
const pkgPath = path.resolve(_dirname, '..', 'package.json');
|
|
31
|
+
if ((argvs.v || argvs.version) && fs.existsSync(pkgPath)) {
|
|
32
|
+
const pkg = fs.readJSONSync(pkgPath);
|
|
30
33
|
console.log(`\n \x1b[35mmarkdown-to-html-cli\x1b[0m v${pkg.version}\n`);
|
|
31
34
|
return pkg.version;
|
|
32
35
|
}
|
|
33
36
|
if (argvs.source && !argvs.markdown) {
|
|
34
37
|
argvs.markdown = fs.readFileSync(path.resolve(argvs.source)).toString();
|
|
35
38
|
}
|
|
36
|
-
|
|
37
|
-
const projectPkg = path.resolve(process.cwd(), opts.config || argvs.config || 'package.json');
|
|
38
|
-
let pgkData = {};
|
|
39
|
-
if (fs.existsSync(projectPkg)) {
|
|
40
|
-
pgkData = fs.readJSONSync(projectPkg);
|
|
41
|
-
if (pgkData.name && !options.document.title) {
|
|
42
|
-
options.document.title = pgkData.name;
|
|
43
|
-
}
|
|
44
|
-
if (pgkData.repository && !argvs['github-corners']) {
|
|
45
|
-
argvs['github-corners'] = typeof pgkData.repository === 'string' ? pgkData.repository : pgkData.repository.url;
|
|
46
|
-
}
|
|
47
|
-
if (pgkData['markdown-to-html']) {
|
|
48
|
-
const mth = pgkData['markdown-to-html'];
|
|
49
|
-
const { title, meta, link } = options.document;
|
|
50
|
-
options = { ...options, ...mth, document: { title, meta, link, ...mth.document } };
|
|
51
|
-
if (mth['github-corners']) {
|
|
52
|
-
argvs['github-corners'] = mth['github-corners'];
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
if (argvs['github-corners']) {
|
|
57
|
-
argvs['github-corners'] = argvs['github-corners'].replace(/^git[+]/, '');
|
|
58
|
-
}
|
|
59
|
-
if (Array.isArray(options.document.link) && options.favicon) {
|
|
60
|
-
options.document.link.push({ rel: 'icon', href: options.favicon, type: 'image/x-icon' });
|
|
61
|
-
}
|
|
62
|
-
if (Array.isArray(options.document.meta)) {
|
|
63
|
-
if (options.description) {
|
|
64
|
-
options.document.meta.push({ description: options.description });
|
|
65
|
-
}
|
|
66
|
-
else if (pgkData.description) {
|
|
67
|
-
options.document.meta.push({ description: pgkData.description });
|
|
68
|
-
}
|
|
69
|
-
if (options.keywords) {
|
|
70
|
-
options.document.meta.push({ keywords: options.keywords });
|
|
71
|
-
}
|
|
72
|
-
else if (pgkData.keywords && Array.isArray(pgkData.keywords)) {
|
|
73
|
-
options.document.meta.push({ keywords: pgkData.keywords.join(',') });
|
|
74
|
-
}
|
|
75
|
-
if (typeof options.author === 'string') {
|
|
76
|
-
options.document.meta.push({ author: options.author });
|
|
77
|
-
}
|
|
78
|
-
}
|
|
39
|
+
const options = formatConfig({ ...opts, ...argvs });
|
|
79
40
|
const output = path.resolve(argvs.output);
|
|
80
41
|
const strMarkdown = create({ ...argvs, ...options });
|
|
81
42
|
fs.writeFileSync(output, strMarkdown);
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,UAAU,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,QAAwB,MAAM,UAAU,CAAC;AAGhD,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,UAAU,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,QAAwB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C,EAAE;QACxD,MAAM,GAAG,GAAG,EAAE,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;QACrC,OAAO,CAAC,GAAG,CAAC,2CAA2C,GAAG,CAAC,OAAO,IAAI,CAAC,CAAC;QACxE,OAAO,GAAG,CAAC,OAAO,CAAC;KACpB;IACD,IAAI,KAAK,CAAC,MAAM,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE;QACnC,KAAK,CAAC,QAAQ,GAAG,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC;KACzE;IACD,MAAM,OAAO,GAAG,YAAY,CAAC,EAAE,GAAG,IAAI,EAAE,GAAG,KAAK,EAAE,CAAC,CAAC;IACpD,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IAC1C,MAAM,WAAW,GAAG,MAAM,CAAC,EAAE,GAAG,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACrD,EAAE,CAAC,aAAa,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;IACtC,OAAO,CAAC,GAAG,CAAC,iCAAiC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,MAAM,CAAC,WAAW,CAAC,CAAC;AAChG,CAAC;AAED,MAAM,CAAC,MAAM,OAAO,GAAW;;;;;;;;;;;;;;;;CAgB9B,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAU;;;;;;;;;;;CAWjC,CAAC"}
|
package/lib/utils.d.ts
ADDED
package/lib/utils.js
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import fs from 'fs-extra';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
export function formatConfig(opts) {
|
|
4
|
+
let options = { ...opts, document: { title: opts.title, meta: [], link: [] } };
|
|
5
|
+
const projectPkg = path.resolve(process.cwd(), opts.config || 'package.json');
|
|
6
|
+
let pgkData = {};
|
|
7
|
+
if (fs.existsSync(projectPkg)) {
|
|
8
|
+
pgkData = fs.readJSONSync(projectPkg);
|
|
9
|
+
if (pgkData.name && !options.document.title) {
|
|
10
|
+
options.document.title = pgkData.name;
|
|
11
|
+
}
|
|
12
|
+
if (pgkData.repository && !opts['github-corners']) {
|
|
13
|
+
opts['github-corners'] = typeof pgkData.repository === 'string' ? pgkData.repository : pgkData.repository.url;
|
|
14
|
+
}
|
|
15
|
+
if (pgkData['markdown-to-html']) {
|
|
16
|
+
const mth = pgkData['markdown-to-html'];
|
|
17
|
+
const { title, meta, link } = options.document;
|
|
18
|
+
options = { ...options, ...mth, document: { title, meta, link, ...mth.document } };
|
|
19
|
+
if (mth['github-corners']) {
|
|
20
|
+
opts['github-corners'] = mth['github-corners'];
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
if (opts['github-corners']) {
|
|
25
|
+
opts['github-corners'] = opts['github-corners'].replace(/^git[+]/, '');
|
|
26
|
+
}
|
|
27
|
+
if (Array.isArray(options.document.link) && options.favicon) {
|
|
28
|
+
options.document.link.push({ rel: 'icon', href: options.favicon, type: 'image/x-icon' });
|
|
29
|
+
}
|
|
30
|
+
if (Array.isArray(options.document.meta)) {
|
|
31
|
+
if (options.description) {
|
|
32
|
+
options.document.meta.push({ description: options.description });
|
|
33
|
+
}
|
|
34
|
+
else if (pgkData.description) {
|
|
35
|
+
options.document.meta.push({ description: pgkData.description });
|
|
36
|
+
}
|
|
37
|
+
if (options.keywords) {
|
|
38
|
+
options.document.meta.push({ keywords: options.keywords });
|
|
39
|
+
}
|
|
40
|
+
else if (pgkData.keywords && Array.isArray(pgkData.keywords)) {
|
|
41
|
+
options.document.meta.push({ keywords: pgkData.keywords.join(',') });
|
|
42
|
+
}
|
|
43
|
+
if (typeof options.author === 'string') {
|
|
44
|
+
options.document.meta.push({ author: options.author });
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return options;
|
|
48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,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;SAC5D;aAAM,IAAI,OAAO,CAAC,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;YAC9D,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,QAAQ,EAAE,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;SACtE;QACD,IAAI,OAAO,OAAO,CAAC,MAAM,KAAK,QAAQ,EAAE;YACtC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;SACxD;KACF;IACD,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "markdown-to-html-cli",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.6",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Command line tool generates markdown as html.",
|
|
6
6
|
"homepage": "https://jaywcjlove.github.io/markdown-to-html-cli",
|
|
@@ -12,14 +12,6 @@
|
|
|
12
12
|
"markdown-to-html": "lib/cli.js",
|
|
13
13
|
"markdown-to-html-cli": "lib/cli.js"
|
|
14
14
|
},
|
|
15
|
-
"scripts": {
|
|
16
|
-
"start": "node lib/cli.js --github-corners-fork --github-corners 'https://jaywcjlove.github.io'",
|
|
17
|
-
"watch": "tsbb watch --disable-babel --no-esm -f src/cli.ts",
|
|
18
|
-
"build": "tsbb build --disable-babel --no-esm -f src/cli.ts && npm run fix",
|
|
19
|
-
"fix": "tsc-esm-fix --target='lib' --ext='.js'",
|
|
20
|
-
"test": "npm run build && tsbb test",
|
|
21
|
-
"coverage": "npm run build && tsbb test --coverage"
|
|
22
|
-
},
|
|
23
15
|
"repository": {
|
|
24
16
|
"type": "git",
|
|
25
17
|
"url": "https://github.com/jaywcjlove/markdown-to-html-cli.git"
|
|
@@ -34,11 +26,6 @@
|
|
|
34
26
|
"engines": {
|
|
35
27
|
"node": "^12.20.0 || ^14.13.1 || >=16.0.0"
|
|
36
28
|
},
|
|
37
|
-
"jest": {
|
|
38
|
-
"transformIgnorePatterns": [
|
|
39
|
-
"<rootDir>/node_modules/?!(.*)"
|
|
40
|
-
]
|
|
41
|
-
},
|
|
42
29
|
"markdown-to-html": {
|
|
43
30
|
"reurls": {
|
|
44
31
|
"README-zh.md": "index.zh.html",
|
|
@@ -51,31 +38,27 @@
|
|
|
51
38
|
"github.css"
|
|
52
39
|
],
|
|
53
40
|
"dependencies": {
|
|
54
|
-
"@mapbox/rehype-prism": "0.8.0",
|
|
55
|
-
"@types/fs-extra": "9.0.13",
|
|
56
|
-
"@types/minimist": "1.2.2",
|
|
57
|
-
"fs-extra": "10.0.0",
|
|
58
|
-
"minimist": "1.2.5",
|
|
59
|
-
"rehype-attr": "2.0.7",
|
|
60
|
-
"rehype-autolink-headings": "6.1.0",
|
|
61
|
-
"rehype-document": "6.0.
|
|
62
|
-
"rehype-format": "4.0.
|
|
63
|
-
"rehype-meta": "
|
|
64
|
-
"rehype-raw": "6.1.0",
|
|
65
|
-
"rehype-rewrite": "3.0.4",
|
|
66
|
-
"rehype-slug": "5.0.0",
|
|
67
|
-
"rehype-stringify": "9.0.2",
|
|
68
|
-
"rehype-urls": "1.1.1",
|
|
69
|
-
"rehype-video": "1.1.1",
|
|
70
|
-
"rehype-wrap": "1.0.10",
|
|
71
|
-
"remark-gemoji": "7.0.1",
|
|
72
|
-
"remark-gfm": "3.0.1",
|
|
73
|
-
"remark-parse": "10.0.1",
|
|
74
|
-
"remark-rehype": "10.1.0",
|
|
75
|
-
"unified": "10.1.1"
|
|
76
|
-
},
|
|
77
|
-
"devDependencies": {
|
|
78
|
-
"tsc-esm-fix": "2.7.4",
|
|
79
|
-
"tsbb": "3.5.2"
|
|
41
|
+
"@mapbox/rehype-prism": "~0.8.0",
|
|
42
|
+
"@types/fs-extra": "~9.0.13",
|
|
43
|
+
"@types/minimist": "~1.2.2",
|
|
44
|
+
"fs-extra": "~10.0.0",
|
|
45
|
+
"minimist": "~1.2.5",
|
|
46
|
+
"rehype-attr": "~2.0.7",
|
|
47
|
+
"rehype-autolink-headings": "~6.1.0",
|
|
48
|
+
"rehype-document": "~6.0.1",
|
|
49
|
+
"rehype-format": "~4.0.1",
|
|
50
|
+
"rehype-meta": "~3.2.0",
|
|
51
|
+
"rehype-raw": "~6.1.0",
|
|
52
|
+
"rehype-rewrite": "~3.0.4",
|
|
53
|
+
"rehype-slug": "~5.0.0",
|
|
54
|
+
"rehype-stringify": "~9.0.2",
|
|
55
|
+
"rehype-urls": "~1.1.1",
|
|
56
|
+
"rehype-video": "~1.1.1",
|
|
57
|
+
"rehype-wrap": "~1.0.10",
|
|
58
|
+
"remark-gemoji": "~7.0.1",
|
|
59
|
+
"remark-gfm": "~3.0.1",
|
|
60
|
+
"remark-parse": "~10.0.1",
|
|
61
|
+
"remark-rehype": "~10.1.0",
|
|
62
|
+
"unified": "~10.1.1"
|
|
80
63
|
}
|
|
81
64
|
}
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2021 小弟调调™
|
|
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/github-fork-ribbon.css
DELETED
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
.github-fork-ribbon {
|
|
2
|
-
width: 12.1em;
|
|
3
|
-
height: 12.1em;
|
|
4
|
-
position: absolute;
|
|
5
|
-
overflow: hidden;
|
|
6
|
-
top: 0;
|
|
7
|
-
right: 0;
|
|
8
|
-
z-index: 9999;
|
|
9
|
-
pointer-events: none;
|
|
10
|
-
font-size: 13px;
|
|
11
|
-
text-decoration: none;
|
|
12
|
-
text-indent: -999999px;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
.github-fork-ribbon.fixed {
|
|
16
|
-
position: fixed;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
.github-fork-ribbon:hover, .github-fork-ribbon:active {
|
|
20
|
-
background-color: rgba(0, 0, 0, 0.0);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
.github-fork-ribbon:before, .github-fork-ribbon:after {
|
|
24
|
-
/* The right and left classes determine the side we attach our banner to */
|
|
25
|
-
position: absolute;
|
|
26
|
-
display: block;
|
|
27
|
-
width: 15.38em;
|
|
28
|
-
height: 1.54em;
|
|
29
|
-
|
|
30
|
-
top: 3.23em;
|
|
31
|
-
right: -3.23em;
|
|
32
|
-
|
|
33
|
-
-webkit-box-sizing: content-box;
|
|
34
|
-
-moz-box-sizing: content-box;
|
|
35
|
-
box-sizing: content-box;
|
|
36
|
-
|
|
37
|
-
-webkit-transform: rotate(45deg);
|
|
38
|
-
-moz-transform: rotate(45deg);
|
|
39
|
-
-ms-transform: rotate(45deg);
|
|
40
|
-
-o-transform: rotate(45deg);
|
|
41
|
-
transform: rotate(45deg);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
.github-fork-ribbon:before {
|
|
45
|
-
content: "";
|
|
46
|
-
|
|
47
|
-
/* Add a bit of padding to give some substance outside the "stitching" */
|
|
48
|
-
padding: .38em 0;
|
|
49
|
-
|
|
50
|
-
/* Set the base colour */
|
|
51
|
-
background-color: #a00;
|
|
52
|
-
|
|
53
|
-
/* Set a gradient: transparent black at the top to almost-transparent black at the bottom */
|
|
54
|
-
background-image: -webkit-gradient(linear, left top, left bottom, from(rgba(0, 0, 0, 0)), to(rgba(0, 0, 0, 0.15)));
|
|
55
|
-
background-image: -webkit-linear-gradient(top, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.15));
|
|
56
|
-
background-image: -moz-linear-gradient(top, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.15));
|
|
57
|
-
background-image: -ms-linear-gradient(top, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.15));
|
|
58
|
-
background-image: -o-linear-gradient(top, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.15));
|
|
59
|
-
background-image: linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.15));
|
|
60
|
-
|
|
61
|
-
/* Add a drop shadow */
|
|
62
|
-
-webkit-box-shadow: 0 .15em .23em 0 rgba(0, 0, 0, 0.5);
|
|
63
|
-
-moz-box-shadow: 0 .15em .23em 0 rgba(0, 0, 0, 0.5);
|
|
64
|
-
box-shadow: 0 .15em .23em 0 rgba(0, 0, 0, 0.5);
|
|
65
|
-
|
|
66
|
-
pointer-events: auto;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
.github-fork-ribbon:after {
|
|
70
|
-
/* Set the text from the data-ribbon attribute */
|
|
71
|
-
content: attr(data-ribbon);
|
|
72
|
-
|
|
73
|
-
/* Set the text properties */
|
|
74
|
-
color: #fff;
|
|
75
|
-
font: 700 1em "Helvetica Neue", Helvetica, Arial, sans-serif;
|
|
76
|
-
line-height: 1.54em;
|
|
77
|
-
text-decoration: none;
|
|
78
|
-
text-shadow: 0 -.08em rgba(0, 0, 0, 0.5);
|
|
79
|
-
text-align: center;
|
|
80
|
-
text-indent: 0;
|
|
81
|
-
|
|
82
|
-
/* Set the layout properties */
|
|
83
|
-
padding: .15em 0;
|
|
84
|
-
margin: .15em 0;
|
|
85
|
-
|
|
86
|
-
/* Add "stitching" effect */
|
|
87
|
-
border-width: .08em 0;
|
|
88
|
-
border-style: dotted;
|
|
89
|
-
border-color: #fff;
|
|
90
|
-
border-color: rgba(255, 255, 255, 0.7);
|
|
91
|
-
}
|