#hcl #white-space #modify #comments #parse #preserving #toml

hcl-edit

Parse and modify HCL while preserving comments and whitespace

40 releases

0.8.3 Oct 4, 2024
0.8.1 May 24, 2024
0.7.5 Jan 4, 2024
0.7.4 Sep 27, 2023
0.3.1 Mar 31, 2023

#537 in Encoding

Download history 3248/week @ 2024-07-29 1426/week @ 2024-08-05 2201/week @ 2024-08-12 1947/week @ 2024-08-19 2025/week @ 2024-08-26 1552/week @ 2024-09-02 1931/week @ 2024-09-09 1770/week @ 2024-09-16 2077/week @ 2024-09-23 2136/week @ 2024-09-30 1221/week @ 2024-10-07 1630/week @ 2024-10-14 2063/week @ 2024-10-21 1989/week @ 2024-10-28 2459/week @ 2024-11-04 2192/week @ 2024-11-11

8,768 downloads per month
Used in 28 crates (4 directly)

MIT/Apache

335KB
8K SLoC

hcl-edit

Build Status crates.io docs.rs License: Apache 2.0 License: MIT

Parse and modify HCL documents while preserving whitespace and comments. This crate is to HCL what toml_edit is to TOML. In fact, its API is heavily inspired by toml_edit.

Notice

The documentation as well as usage examples are scarce. There's still a lot of planned functionality missing and some APIs might even be cumbersome to use at the moment.

This will improve over time as this project evolves.

Expect breaking changes at any time until the biggest issues are fleshed out.

HCL document traversal

The visit module allows traversal of language items within a HCL document. Mutable document traversal is supported via the visit_mut module.

See the respective module's documentation for more.

Contributing

Contributions are welcome! Please read CONTRIBUTING.md before creating a PR.

License

The source code of hcl-edit is licensed under either of Apache License, Version 2.0 or MIT license at your option.

Dependencies

~1MB
~19K SLoC