forked from sindresorhus/generate-github-markdown-css
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cli.js
executable file
·46 lines (40 loc) · 882 Bytes
/
cli.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/usr/bin/env node
import meow from 'meow';
import githubMarkdownCss from './index.js';
const cli = meow(`
Usage
github-markdown-css > <filename>
Options
--type Theme name: 'light', 'dark', 'auto' or other --list values.
'auto' means using the media query (prefers-color-scheme)
to switch between the 'light' and 'dark' theme.
--list List available themes.
Examples
$ github-markdown-css --list
light
dark
dark_dimmed
dark_high_contrast
dark_colorblind
light_colorblind
`, {
importMeta: import.meta,
flags: {
type: {
type: 'string',
},
list: {
type: 'boolean',
},
},
});
(async () => {
const {type, list} = cli.flags;
let light = type;
let dark = type;
if (type === 'auto') {
light = 'light';
dark = 'dark';
}
console.log(await githubMarkdownCss({light, dark, list}));
})();