rst2typst.package module¶
Typst package helper.
Note
In this module, “Package” means Typst package.
This module provides two features.
Package registry to manage packages and to render import statements.
Helper functions to install files as local package.
- class rst2typst.package.Entrypoint(name: str, alias: str | None = None)¶
Bases:
objectImporting target and alias of package.
- class rst2typst.package.PackageRegistry(*args, **kwargs)¶
Bases:
dict[str,set[Entrypoint]]Package management store.
- rst2typst.package.build_install_path(name: str, version: str | None = None) Path¶
Retrieve path object of package Typst local package.
If version is not specified, name is treated as the name of a published Python package, and the installed version is used.
- Parameters:
name – Package name
version – Version of package.
- rst2typst.package.install_package(source: Path, name: str, version: str | None = None, *, force: bool = False)¶
Copy package directory as Typst local package.
Ref¶
- param source:
Source directory of Typst package.
- param name:
The name of local package.
- param version:
The version of local package.
- param force:
Flag to override package.