An open API service indexing awesome lists of open source software.

https://github.com/sillyfreak/typst-parsing-plugin

Example for parsing strings in Typst using a Rust WASM plugin
https://github.com/sillyfreak/typst-parsing-plugin

typst

Last synced: 9 months ago
JSON representation

Example for parsing strings in Typst using a Rust WASM plugin

Awesome Lists containing this project

README

          

# The `my-package` Package

A short description about the project and/or client.

## Template adaptation checklist

- [ ] Fill out `README.md`
- Change the `my-package` package name, including code snippets
- Check section contents and/or delete sections that don't apply
- [ ] Check and/or replace `LICENSE` by something that suits your needs
- [ ] Fill out `typst.toml`
- See also the [typst/packages README](https://github.com/typst/packages/?tab=readme-ov-file#package-format)
- [ ] Adapt Repository URLs in `CHANGELOG.md`
- Consider only committing that file with your first release, or removing the "Initial Release" part in the beginning
- [ ] Adapt or deactivate the release workflow in `.github/workflows/release.yml`
- to deactivate it, delete that file or remove/comment out lines 2-4 (`on:` and following)
- to use the workflow
- [ ] check the values under `env:`, particularly `REGISTRY_REPO`
- [ ] if you don't have one, [create a fine-grained personal access token](https://github.com/settings/tokens?type=beta) with [only Contents permission](https://stackoverflow.com/a/75116350/371191) for the `REGISTRY_REPO`
- [ ] on this repo, create a secret `REGISTRY_TOKEN` (at `https://github.com/[user]/[repo]/settings/secrets/actions`) that contains the so created token

if configured correctly, whenever you create a tag `v...`, your package will be pushed onto a branch on the `REGISTRY_REPO`, from which you can then create a pull request against [typst/packages](https://github.com/typst/packages/)
- [ ] remove/replace the example test case
- [ ] (add your actual code, docs and tests)
- [ ] remove this section from the README

## Getting Started

To add this package to your project, use this:

```typ
#import "@preview/my-package:0.0.1": *

#let expr = "2 * (2 + x)"

#eval(mode: "math", expr)

#my-package.parse(expr)

#my-package.eval(expr, x: 3)
```

![Example](./thumbnail.png)

## Usage

See the [manual](docs/manual.pdf) for details.