@trim21/dprint-plugin-beancount 0.1.11 → 0.1.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +32 -12
- package/package.json +1 -1
- package/plugin.wasm +0 -0
package/README.md
CHANGED
|
@@ -2,26 +2,46 @@
|
|
|
2
2
|
|
|
3
3
|
Rust formatter for Beancount files with a reusable core library, a small CLI, and optional Python bindings.
|
|
4
4
|
|
|
5
|
-
##
|
|
6
|
-
The published package includes plugin.wasm for browser/CDN usage.
|
|
5
|
+
## Usage
|
|
7
6
|
|
|
8
|
-
|
|
9
|
-
- jsDelivr (latest): https://cdn.jsdelivr.net/npm/@trim21/dprint-plugin-beancount@latest/plugin.wasm
|
|
10
|
-
- Node usage: require the package and read `wasmPath` or call `getWasmBuffer()`.
|
|
7
|
+
### cli/pypi package
|
|
11
8
|
|
|
12
|
-
## Crates
|
|
13
|
-
- crates/beancount-formatter: core library containing the formatter and configuration.
|
|
14
|
-
- crates/beancount-formatter-cli: CLI wrapper around the formatter library.
|
|
15
|
-
- crates/beancount-formatter-py: Python bindings built with PyO3/maturin.
|
|
16
|
-
|
|
17
|
-
## CLI usage
|
|
18
9
|
- Format files in place (default): `beancount-format path/to/file.beancount`
|
|
19
10
|
- Check without modifying (exit 1 if reformat needed): `beancount-format --check path/to/file.beancount`
|
|
20
|
-
|
|
11
|
+
|
|
12
|
+
## Config
|
|
21
13
|
|
|
22
14
|
The CLI auto-detects `pyproject.toml` from the working directory or provided paths and merges settings with any CLI overrides.
|
|
23
15
|
|
|
16
|
+
```toml
|
|
17
|
+
[tool.beancount-format]
|
|
18
|
+
line-width = 70
|
|
19
|
+
indent-width = 2
|
|
20
|
+
new-line-kind = "lf"
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
- Can be overridden from args: `--line-width 80 --indent-width 4 --new-line lf`
|
|
24
|
+
|
|
25
|
+
### dprint
|
|
26
|
+
|
|
27
|
+
A [dprint](https://github.com/dprint/dprint) plugin is published in npm and can be fetched from jsDelivr directly:
|
|
28
|
+
|
|
29
|
+
```json
|
|
30
|
+
{
|
|
31
|
+
"plugins": [
|
|
32
|
+
"https://cdn.jsdelivr.net/npm/@trim21/dprint-plugin-beancount@latest/plugin.wasm"
|
|
33
|
+
]
|
|
34
|
+
}
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Crates
|
|
38
|
+
|
|
39
|
+
- crates/beancount-formatter: core library containing the formatter and configuration.
|
|
40
|
+
- crates/beancount-formatter-cli: CLI wrapper around the formatter library.
|
|
41
|
+
- crates/beancount-formatter-py: Python bindings built with PyO3/maturin.
|
|
42
|
+
|
|
24
43
|
## Development
|
|
44
|
+
|
|
25
45
|
- Build CLI: `cargo build -p beancount-formatter-cli --release`
|
|
26
46
|
- Run tests: `cargo test --workspace`
|
|
27
47
|
- Format code: `cargo fmt --all`
|
package/package.json
CHANGED
package/plugin.wasm
CHANGED
|
Binary file
|