API Reference
DocumenterTypst.jl provides a Documenter.jl plugin for generating documentation in Typst/PDF format.
DocumenterTypst.DocumenterTypst — Module
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.
Exported Types
DocumenterTypst.TypstWriter.Typst — Type
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
platformsets 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-installedtypstexecutable found inPATH, or a custom path specified via thetypstkeyword argument."none": Skips compilation and only generates the.typsource file in the build directory.
versionspecifies the version number printed on the title page of the manual. Defaults to the value in theTRAVIS_TAGenvironment variable (although this behaviour is considered deprecated), or to an empty string ifTRAVIS_TAGis unset.typstallows specifying a custom path to atypstexecutable. Only used whenplatform="native". Can be either aStringpath or aCmdobject.optimize_pdfenables automatic PDF optimization using pdfcpu after compilation. Defaults totrue. When enabled, reduces PDF file size by 60-85% by compressing uncompressed streams and optimizing PDF structure. Set tofalseto skip optimization (e.g., for faster builds during development).use_system_fontscontrols whether to allow Typst to use system fonts. Defaults totrue. Setting tofalsewill possibly decrease the size of the PDF file.font_pathsspecifies custom font directories for Typst to search. Defaults toString[](empty). Provide a vector of directory paths to add custom fonts. Each path will be passed to Typst as--font-pathargument.
Internal Modules
DocumenterTypst.TypstWriter — Module
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.
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 youusing)DocumenterTypst.TypstWriter: Internal rendering engine
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
- Documenter.jl Documentation - Main documentation generator
- Typst Documentation - Typst typesetting system
- Getting Started Guide - Quick start guide
- Configuration Guide - Detailed configuration options