Skip to content

About

KDL formatter as a dprint Wasm plugin

Topics

Resources

Stars

3 stars

Watchers

1 watching

Forks

Repository files navigation

dprint-plugin-kdl

npm version CI

Adapter for kdl-rs for use as a formatting plugin in dprint. It formats KDL files (.kdl).

Originally created by Kenichi Kamiya.

Install

Install and setup dprint.

Then in your project's directory with a dprint.json file, run:

dprint add kdl

Configuration

By default, it formats as KDL 2.0 and works with no configuration.

If you only format KDL v1 documents, you can use the "kdlVersion" option:

{
  "kdl": {
    "kdlVersion": "v1"
  }
}

Mixed v1 and v2 Files

Some famous applications still use KDL v1 for now:

If your repository has mixed versions of KDL files, consider adding a version marker line to the top of your files:

/- kdl-version 1
simplified_ui true
/- kdl-version 2
simplified_ui #true

This version marker is defined as an optional hint in the KDL specification.
When placed on the first line, this plugin formats the file with that version,
even if kdlVersion in dprint.json says otherwise.

JS Formatting API

Versioning

This repo automatically upgrades to the latest version of kdl-rs once a day. You can check which version of kdl-rs is being used by looking at the kdl entry in the Cargo.toml file in this repo:

https://github.com/dprint/dprint-plugin-kdl/blob/main/Cargo.toml

At the moment, the version of this plugin does not reflect the version of kdl-rs.

License

This project is licensed under the Apache License 2.0 - see the LICENSE and NOTICE files for details.

About

KDL formatter as a dprint Wasm plugin

Topics

Resources

Stars

3 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages