@@ -10,99 +10,103 @@ The css-doodle command line tool for previewing and generating images.
1010npm install -g @css-doodle/cli
1111```
1212
13- ## Commands
13+ After installation, you can use the ` css-doodle ` or ` cssd ` command in the terminal.
1414
15- ### render
16- Generate an image from the CSS Doodle source file.
15+ ## Usage
1716
18- ``` bash
19- cssd render code.css
2017```
18+ Usage: cssd [options] [command]
2119
22- #### -o, --output
23-
24- Custom output filename of the generated image.
20+ Options:
21+ -V, --version output the version number
22+ -h, --help display help for command
2523
26- ``` bash
27- cssd render code.css -o result.png
24+ Commands:
25+ render Generate an image from css-doodle file
26+ preview Open a window to preview the css-doodle file
27+ generate Generate code using css-doodle generators
28+ config Display/set the configurations
29+ use Shorthand to fetch and use a custom version of css-doodle
30+ parse Print the parsed tokens, helped to debug on development
2831```
2932
30- #### -x, --scale
33+ ## Commands
3134
32- Scale factor of the generated image, defaults to 1.
35+ ### render
36+ Generate an image from the css-doodle source file. It'll read from STDIN if no source file specified.
3337
38+ * ` -o, --output ` : Custom output filename of the generated image.
39+ * ` -x, --scale ` : Scale factor of the generated image, defaults to 1.
40+
3441``` bash
42+ cssd render
43+ cssd render code.css
44+ cssd render code.css -o result.png
3545cssd render code.css -x 4
3646```
3747
3848### preview
39- Open a window to preview the CSS Doodle file.
40-
41- ``` bash
42- cssd preview code.css
43- ```
44-
45- #### --fullscreen
49+ Open a window to preview the css-doodle file.
4650
47- Open the preview in fullscreen mode.
51+ * ` --fullscreen ` : Open in fullscreen mode.
4852
4953``` bash
54+ cssd preview code.css
5055cssd preview code.css --fullscreen
5156```
5257
58+ ### generate
5359
54- ### config
60+ Generate code using css-doodle generators.
5561
56- Display/set the configuration.
62+ * ` svg ` : Generate SVG code using svg() function.
63+ * ` polygon ` : Generate CSS polygon() using shape() function.
5764
5865``` bash
59- cssd config
60- ```
61-
62- #### browserPath
63-
64- Use a custom browser to preview and generate images.
66+ cssd generate svg code.css
67+ cssd generate polygon code.css
6568
66- ``` bash
67- cssd config browserPath /Applications/Google \ Chrome.app/Contents/MacOS/Google \ Chrome
69+ # read from STDIN
70+ cssd generate polygon
6871```
6972
70- ### generate
73+ ### config
7174
72- Generate code using CSS Doodle generators.
75+ Display/set the configurations in key/value pairs. Currently only two configuration names are recognized:
7376
74- #### svg
77+ * ` set ` : Set a configuration with key/value pair.
78+ * ` get ` : Get a configuration value by key.
79+ * ` list ` : List all configurations.
7580
76- Generate SVG code using svg() function.
81+ Recognizable configurations:
7782
78- ``` bash
79- cssd generate svg code.css
80- ```
83+ * ` browserPath ` : The path to the browser executable.
84+ * ` css-doodle ` : The path to the css-doodle to use.
8185
82- #### polygon
86+ ``` bash
87+ # show all configurations
88+ cssd config list
8389
84- Generate CSS polygon() using shape() function.
90+ # use a custom browser
91+ cssd config set browserPath /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome
8592
86- ``` bash
87- cssd generate polygon code.css
88- ```
93+ # reset
94+ cssd config reset browserPath ' '
8995
90- ## Usage
96+ # get the value
97+ cssd config get browserPath
9198
99+ # set the version of css-doodle
100+ cssd config set css-doodle 0.40.6
92101```
93- Usage: css-doodle [options] [command]
94102
95- The css-doodle CLI for previewing and generating images
103+ ### use
104+ Shorthand of ` cssd config set css-doodle <version> ` .
96105
97- Options:
98- -V, --version output the version number
99- -h, --help display help for command
106+ ``` bash
107+ cssd use css-doodle@0.40.6
100108
101- Commands:
102- render [options] [source] generate an image from the CSS Doodle source file
103- preview [options] <source> open a window to preview the CSS Doodle file
104- parse [source] print the parsed tokens, helped to debug on development
105- config display/set the configuration
106- generate generate code using CSS Doodle generators
107- help [command] display help for command
109+ # or just version
110+ cssd use 0.40.6
111+ cssd use latest
108112```
0 commit comments