Adapter for typstyle for use as a formatting plugin in dprint. It formats Typst files (.typ).
Originally created by Kenichi Kamiya.
Then in your project's directory with a dprint.json file, run:
dprint add typstyleNote: You do not need typstyle installed globally as dprint will run typstyle-core from the .wasm file in a sandboxed environment.
Works with no configuration by default. To add configuration, specify a "typst" key in your dprint.json:
- typst section in dprint.json
- global config in dprint.json
- default values in typstyle-core
| dprint-plugin-typstyle | dprint global config | typstyle-core | typstyle CLI |
|---|---|---|---|
| lineWidth | lineWidth | max_width | line-width |
| indentWidth | indentWidth | tab_spaces | indent-width |
| blankLinesUpperBound | none |
blank_lines_upper_bound | none |
| reorderImportItems | none |
reorder_import_items | no-reorder-import-items # disable |
| wrapMode | none |
wrap_mode | wrap-text (none/fill/sentence) |
- JS Formatter - Browser/Deno and Node
- npm package
This repo automatically upgrades to the latest version of typstyle once a day. You can check which version of typstyle is being used by looking at the typstyle-core entry in the Cargo.toml file in this repo:
https://github.com/dprint/dprint-plugin-typstyle/blob/main/Cargo.toml
At the moment, the version of this plugin does not reflect the version of typstyle.
This project is licensed under the Apache License 2.0 - see the LICENSE and NOTICE files for details.
{ "typst": { "wrapMode": "fill", // "none" by default }, "plugins": [ // ...etc... ], }