File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ const cli = meow({
31
31
${ chalk . bold ( 'onepunch init' ) } [${ chalk . bold ( '-n' ) } ${ chalk . italic ( 'directory_name' ) } ]
32
32
Initialize a presentation.
33
33
34
- ${ chalk . bold ( 'onepunch serve' ) }
34
+ ${ chalk . bold ( 'onepunch serve' ) } [ ${ chalk . bold ( '-i' ) } ${ chalk . italic ( 'htmlfile' ) } ]
35
35
Open the presentation in the browser.
36
36
37
37
${ chalk . bold ( 'onepunch print' ) } [${ chalk . bold ( '-i' ) } ${ chalk . italic ( 'htmlfile' ) } ] [${ chalk . bold ( '-o' ) } ${ chalk . italic ( 'pdffile' ) } ]
@@ -47,7 +47,7 @@ const cli = meow({
47
47
Specify the name of the directory where the project is initialized. Defaults to ${ chalk . underline ( 'onepunch-presentation' ) } .
48
48
49
49
${ chalk . bold ( '-i' ) } or ${ chalk . bold ( '--input' ) } ${ chalk . italic ( 'htmlfile' ) }
50
- Specify the HTML file to print, defaults to ${ chalk . underline ( 'index.html' ) } .
50
+ Specify the HTML file to serve or print, defaults to ${ chalk . underline ( 'index.html' ) } .
51
51
52
52
${ chalk . bold ( '-o' ) } or ${ chalk . bold ( '--output' ) } ${ chalk . italic ( 'pdffile' ) }
53
53
Specify the name of the PDF file in output, defaults to ${ chalk . underline ( 'index.pdf' ) } .
@@ -104,7 +104,7 @@ switch (cli.input[0]) {
104
104
init ( cli . flags ) ;
105
105
break ;
106
106
case 'serve' :
107
- serve ( ) ;
107
+ serve ( cli . flags ) ;
108
108
break ;
109
109
case 'print' :
110
110
print ( cli . flags ) ;
@@ -117,11 +117,11 @@ switch (cli.input[0]) {
117
117
break ;
118
118
}
119
119
120
- function serve ( ) {
120
+ function serve ( flags ) {
121
121
liveServer . start ( {
122
122
port : 8180 ,
123
123
root : process . cwd ( ) ,
124
- open : true ,
124
+ open : `/ ${ flags . input } ` ,
125
125
logLevel : 1 ,
126
126
} ) ;
127
127
}
Original file line number Diff line number Diff line change @@ -35,10 +35,11 @@ The command above creates the directory `directory-name` with all the files need
35
35
Inside the project directory, run:
36
36
37
37
``` sh
38
- $ onepunch serve
38
+ $ onepunch serve [-i htmlfile]
39
39
```
40
40
41
41
The command above starts a local server and opens the browser, use the arrow keys to see the next and previous slides.
42
+ Flag ` -i ` (or ` --input ` ) specifies the HTML file to open, it defaults to "index.html".
42
43
43
44
### Print the PDF
44
45
You can’t perform that action at this time.
0 commit comments