API Reference

DocumenterTypst.jl provides a Documenter.jl plugin for generating documentation in Typst/PDF format.

DocumenterTypst.DocumenterTypstModule

DocumenterTypst

A Documenter.jl plugin for generating documentation in Typst/PDF format.

Usage

using Documenter
using DocumenterTypst

makedocs(
    sitename = "MyPackage",
    format = DocumenterTypst.Typst(),
    pages = [
        "Home" => "index.md",
    ]
)

See the documentation for DocumenterTypst.Typst for more options.

source

Exported Types

DocumenterTypst.TypstWriter.TypstType
DocumenterTypst.Typst(; kwargs...)

Output format specifier that results in Typst/PDF output. Used together with Documenter.makedocs, e.g.

makedocs(
    format = DocumenterTypst.Typst()
)

The makedocs argument sitename will be used for the document title. The authors argument should also be specified and will be used for the document metadata. A version number can be specified with the version option to Typst, which will be printed in the document and also appended to the output PDF file name.

Keyword arguments

  • platform sets the platform where the Typst file is compiled. Available options:

    • "typst" (default): Uses Typst_jll, a Julia binary wrapper that automatically provides the Typst compiler across all platforms.
    • "native": Uses the system-installed typst executable found in PATH, or a custom path specified via the typst keyword argument.
    • "none": Skips compilation and only generates the .typ source file in the build directory.
  • version specifies the version number printed on the title page of the manual. Defaults to the value in the TRAVIS_TAG environment variable (although this behaviour is considered deprecated), or to an empty string if TRAVIS_TAG is unset.

  • typst allows specifying a custom path to a typst executable. Only used when platform="native". Can be either a String path or a Cmd object.

  • optimize_pdf enables automatic PDF optimization using pdfcpu after compilation. Defaults to true. When enabled, reduces PDF file size by 60-85% by compressing uncompressed streams and optimizing PDF structure. Set to false to skip optimization (e.g., for faster builds during development).

  • use_system_fonts controls whether to allow Typst to use system fonts. Defaults to true. Setting to false will possibly decrease the size of the PDF file.

  • font_paths specifies custom font directories for Typst to search. Defaults to String[] (empty). Provide a vector of directory paths to add custom fonts. Each path will be passed to Typst as --font-path argument.

source

Internal Modules

DocumenterTypst.TypstWriterModule

A module for rendering Document objects to Typst and PDF.

Keywords

TypstWriter uses the following additional keyword arguments that can be passed to Documenter.makedocs: authors, sitename.

sitename is the site's title displayed in the title bar and at the top of the navigation menu. It goes into the Typst document title.

authors can be used to specify the authors. It goes into the Typst document metadata.

source

Usage

The main export from DocumenterTypst is the Typst type, which is used as the format argument to makedocs:

using Documenter
using DocumenterTypst

makedocs(
    sitename = "MyPackage",
    authors = "Author Name",
    format = DocumenterTypst.Typst(),
    pages = [
        "Home" => "index.md",
        "Guide" => "guide.md",
    ]
)

For detailed configuration options, see the Configuration Guide.

Documenter Integration

DocumenterTypst integrates with Documenter.jl through the format plugin system.

For complete integration details and all makedocs options, see the Configuration Guide.

Implementation Details

The package consists of two modules:

  • DocumenterTypst: The main module (this is what you using)
  • DocumenterTypst.TypstWriter: Internal rendering engine
Internal APIs

The TypstWriter module is not part of the public API and may change without notice. If you need to extend or customize the Typst rendering, please open an issue to discuss making specific APIs public.

See Also