1. Introduction
  2. User Guide
  3. 1. Installation
  4. 2. Get Started
  5. 3. Frequently Asked Questions
  6. 4. Further reading
  7. Reference Guide
  8. 5. Command Line Tool
    1. 5.1. init
    2. 5.2. build
    3. 5.3. serve
    4. 5.4. clean
    5. 5.5. completions
  9. 6. Format
    1. 6.1. book.typ
      1. 6.1.1. Book Metadata
        1. 6.1.1.1. Draft chapter
      2. 6.1.2. Build Metadata
    2. 6.2. Theme
    3. 6.3. Typst Support
      1. 6.3.1. Cross Reference
        1. 6.3.1.1. Cross Reference Sample
      2. 6.3.2. Embed Sanitized HTML Elements
        1. 6.3.2.1. Multimedia components
      3. 6.3.3. Semantic Page Description
    4. 6.4. Rendering Tests
  10. 7. For developers
    1. 7.1. Typst-side APIs
    2. 7.2. shiroa CLI Internals
    3. 7.3. Alternative Backends

shiroa

#

The serve command

The serve command is used to preview a book by serving it via HTTP at localhost:25520 by default:


        
shiroa serve

        
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.


        
shiroa serve path/to/book

        
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:


        
shiroa serve path/to/book --addr 8000:127.0.0.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.