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

#

Theme

The default renderer uses a handlebars template to render your typst source files and comes with a default theme included in the shiroa binary.

Currently we have no much design on theme's html part. But you can still configure your book project like a regular typst project.

#

Things to note

Your book.typ should at least provides a book-meta, as Get Started shown.


        
#import "@preview/shiroa:0.2.3": *

        
#show: book

        


        
#book-meta(

        
    title: "My Book"

        
    summary: [

        
      = My Book

        
    ]

        
)

        
#import "@preview/shiroa:0.2.3": *

        
#show: book

        


        
#book-meta(

        
    title: "My Book"

        
    summary: [

        
      = My Book

        
    ]

        
)

To support specialized rendering for web pages and different page layouts, Your template.typ can import and respect the page-width and target variable from @preview/shiroa:0.2.3 to this time.


        
#import "@preview/shiroa:0.2.3": page-width, target

        


        
#let project(body) = {

        
  // set web/pdf page properties

        
  set page(

        
    width: page-width,

        
    // for a website, we don't need pagination.

        
    height: auto,

        
  )

        
  

        
  // remove margins for web target

        
  set page(margin: (

        
    // reserved beautiful top margin

        
    top: 20pt,

        
    // Typst is setting the page's bottom to the baseline of the last line of text. So bad :(.

        
    bottom: 0.5em,

        
    // remove rest margins.

        
    rest: 0pt,

        
  )) if target.starts-with("web");

        
  

        
  body

        
}

        
#import "@preview/shiroa:0.2.3": page-width, target

        


        
#let project(body) = {

        
  // set web/pdf page properties

        
  set page(

        
    width: page-width,

        
    // for a website, we don't need pagination.

        
    height: auto,

        
  )

        
  

        
  // remove margins for web target

        
  set page(margin: (

        
    // reserved beautiful top margin

        
    top: 20pt,

        
    // Typst is setting the page's bottom to the baseline of the last line of text. So bad :(.

        
    bottom: 0.5em,

        
    // remove rest margins.

        
    rest: 0pt,

        
  )) if target.starts-with("web");

        
  

        
  body

        
}