markdown-to-html-cli 2.2.1 → 3.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/README.md +23 -5
- package/lib/create.js +1 -1
- package/lib/nodes/octiconLink.js +2 -17
- package/lib/nodes/octiconLink.js.map +1 -1
- package/lib/styles/github.css +858 -275
- package/package.json +5 -1
- package/.github/workflows/ci.yml +0 -63
- package/README-zh.md +0 -200
- package/renovate.json +0 -5
- package/src/cli.ts +0 -5
- package/src/create.ts +0 -85
- package/src/index.ts +0 -160
- package/src/nodes/githubCorners.ts +0 -64
- package/src/nodes/githubCornersFork.ts +0 -25
- package/src/nodes/octiconLink.ts +0 -27
- package/src/styles/github-fork-ribbon.css +0 -91
- package/src/styles/github.css +0 -393
- package/test/create.test.ts +0 -93
- package/test/index.test.ts +0 -89
- package/tsconfig.json +0 -21
package/README.md
CHANGED
|
@@ -137,6 +137,22 @@ Here is a simple footnote[^1]. With some additional text after it.
|
|
|
137
137
|
[^1]: My reference.
|
|
138
138
|
```
|
|
139
139
|
|
|
140
|
+
### [Task lists](https://docs.github.com/en/github/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#task-lists)
|
|
141
|
+
|
|
142
|
+
To create a task list, preface list items with a regular space character followed by `[ ]`. To mark a task as complete, use `[x]`.
|
|
143
|
+
|
|
144
|
+
```markdown
|
|
145
|
+
- [x] #739
|
|
146
|
+
- [ ] https://github.com/octo-org/octo-repo/issues/740
|
|
147
|
+
- [ ] Add delight to the experience when all tasks are complete :tada:
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
If a task list item description begins with a parenthesis, you'll need to escape it with `\`:
|
|
151
|
+
|
|
152
|
+
```markdown
|
|
153
|
+
- [ ] \(Optional) Open a followup issue
|
|
154
|
+
```
|
|
155
|
+
|
|
140
156
|
## API
|
|
141
157
|
|
|
142
158
|
```ts
|
|
@@ -144,12 +160,14 @@ import { ParsedArgs } from 'minimist';
|
|
|
144
160
|
import { Options } from 'rehype-document';
|
|
145
161
|
export interface CreateOptions extends MDToHTMLOptions { }
|
|
146
162
|
export declare function create(options?: CreateOptions): string;
|
|
147
|
-
export interface RunArgvs extends ParsedArgs {
|
|
163
|
+
export interface RunArgvs extends Omit<ParsedArgs, '_'> {
|
|
148
164
|
version?: string;
|
|
149
165
|
source?: string;
|
|
150
166
|
output?: string;
|
|
151
|
-
/** Add a Github corner to your project page */
|
|
167
|
+
/** Add a Github corner to your project page. */
|
|
152
168
|
'github-corners'?: string;
|
|
169
|
+
/** Github corners style. */
|
|
170
|
+
'github-corners-fork'?: boolean;
|
|
153
171
|
/** Markdown string. */
|
|
154
172
|
markdown?: string;
|
|
155
173
|
/** The `<title>` tag is required in HTML documents! */
|
|
@@ -165,10 +183,11 @@ export interface RunArgvs extends ParsedArgs {
|
|
|
165
183
|
/** Define the author of a page */
|
|
166
184
|
author?: string;
|
|
167
185
|
}
|
|
168
|
-
export interface MDToHTMLOptions extends
|
|
169
|
-
'github-corners'?: RunArgvs['github-corners'];
|
|
186
|
+
export interface MDToHTMLOptions extends RunArgvs {
|
|
170
187
|
/** [rehype-document](https://github.com/rehypejs/rehype-document#options) options */
|
|
171
188
|
document?: Options;
|
|
189
|
+
/** Rewrite Element. [rehype-rewrite](https://github.com/jaywcjlove/rehype-rewrite#rewritenode-index-parent-void) */
|
|
190
|
+
rewrite?: RehypeRewriteOptions['rewrite'];
|
|
172
191
|
/** rewrite URLs of href and src attributes. */
|
|
173
192
|
reurls?: Record<string, string>;
|
|
174
193
|
/**
|
|
@@ -184,7 +203,6 @@ export interface MDToHTMLOptions extends Omit<RunArgvs, '_'> {
|
|
|
184
203
|
export declare function run(opts?: Omit<RunArgvs, "_">): any;
|
|
185
204
|
export declare const cliHelp: string;
|
|
186
205
|
export declare const exampleHelp: string;
|
|
187
|
-
|
|
188
206
|
```
|
|
189
207
|
|
|
190
208
|
## Development
|
package/lib/create.js
CHANGED
|
@@ -24,7 +24,7 @@ import { githubCornersFork } from './nodes/githubCornersFork.js';
|
|
|
24
24
|
import { octiconLink } from './nodes/octiconLink.js';
|
|
25
25
|
export function create(options = {}) {
|
|
26
26
|
// default github css.
|
|
27
|
-
const { markdown, document, rewrite, reurls = {}, wrap = { wrapper: 'div.
|
|
27
|
+
const { markdown, document, rewrite, reurls = {}, wrap = { wrapper: 'div.markdown-body' } } = options;
|
|
28
28
|
let cssStr = fs.readFileSync(path.resolve(/file:\/\/(.+)\/[^/]/.exec(import.meta.url)[1], 'styles', 'github.css')).toString();
|
|
29
29
|
if (options['github-corners-fork'] && options['github-corners']) {
|
|
30
30
|
let cssFork = fs.readFileSync(path.resolve(/file:\/\/(.+)\/[^/]/.exec(import.meta.url)[1], 'styles', 'github-fork-ribbon.css')).toString();
|
package/lib/nodes/octiconLink.js
CHANGED
|
@@ -1,26 +1,11 @@
|
|
|
1
1
|
export function octiconLink() {
|
|
2
2
|
return {
|
|
3
3
|
type: 'element',
|
|
4
|
-
tagName: '
|
|
4
|
+
tagName: 'span',
|
|
5
5
|
properties: {
|
|
6
6
|
class: 'octicon octicon-link',
|
|
7
|
-
viewBox: '0 0 16 16',
|
|
8
|
-
version: '1.1',
|
|
9
|
-
width: '16',
|
|
10
|
-
height: '16',
|
|
11
|
-
ariaHidden: 'true',
|
|
12
7
|
},
|
|
13
|
-
children: [
|
|
14
|
-
{
|
|
15
|
-
type: 'element',
|
|
16
|
-
tagName: 'path',
|
|
17
|
-
properties: {
|
|
18
|
-
fillRule: 'evenodd',
|
|
19
|
-
d: 'M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z',
|
|
20
|
-
},
|
|
21
|
-
children: []
|
|
22
|
-
}
|
|
23
|
-
]
|
|
8
|
+
children: []
|
|
24
9
|
};
|
|
25
10
|
}
|
|
26
11
|
//# sourceMappingURL=octiconLink.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"octiconLink.js","sourceRoot":"","sources":["../../src/nodes/octiconLink.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,WAAW;IACzB,OAAO;QACL,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"octiconLink.js","sourceRoot":"","sources":["../../src/nodes/octiconLink.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,WAAW;IACzB,OAAO;QACL,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,MAAM;QACf,UAAU,EAAE;YACV,KAAK,EAAE,sBAAsB;SAC9B;QACD,QAAQ,EAAE,EAAE;KACb,CAAA;AACH,CAAC"}
|