dprint-core

Crates.iodprint-core
lib.rsdprint-core
version0.67.0
sourcesrc
created_at2019-10-27 18:09:34.390022
updated_at2024-06-30 23:13:27.212585
descriptionCore library for dprint.
homepagehttps://github.com/dprint/dprint/tree/main/crates/core
repositoryhttps://github.com/dprint/dprint
max_upload_size
id176176
size276,195
David Sherret (dsherret)

documentation

README

dprint-core

Rust crate for common dprint code.

Features:

  • formatting - Code to help build a code formatter in Rust (not required for creating a plugin).
  • process - Code to help build a "process plugin"
  • wasm - Code to help build a "wasm plugin" (recommended over process plugins)

Formatting Api

Use:

let result = dprint_core::formatting::format(|| {
    let print_items = ...; // parsed out IR (see example below)
    print_items
}, PrintOptions {
    indent_width: 4,
    max_width: 10,
    use_tabs: false,
    newline_kind: "\n",
});

Example

See overview.md.

Commit count: 1120

cargo fmt