The serve command
The serve command is used to preview a book by serving it via HTTP at localhost:25520
by default:
1
shiroa serve
1
shiroa serve
Note: The serve
command is for testing a book's HTML output, and is not intended to be a complete HTTP server for a website.
Specify a directory
The serve
command can take a directory as an argument to use as the book's root instead of the current working directory.
1
shiroa serve path/to/book
1
shiroa serve path/to/book
Build options
The serve
command will build your book once before serving the content. It is hence including all of the options from build
command.
Server options
The serve
address defaults to localhost:25520
. Either option can be specified on the command line:
1
shiroa serve path/to/book --addr 8000:127.0.0.1
1
shiroa serve path/to/book --addr 8000:127.0.0.1
–open
When you use the --open
flag, shiroa will open the rendered book in your default web browser after building it.