#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

#554 in Encoding

Download history 1618/week @ 2024-08-21 1782/week @ 2024-08-28 1879/week @ 2024-09-04 1973/week @ 2024-09-11 1409/week @ 2024-09-18 2096/week @ 2024-09-25 1964/week @ 2024-10-02 1461/week @ 2024-10-09 1676/week @ 2024-10-16 2167/week @ 2024-10-23 2119/week @ 2024-10-30 2277/week @ 2024-11-06 2097/week @ 2024-11-13 1621/week @ 2024-11-20 1460/week @ 2024-11-27 1609/week @ 2024-12-04

7,192 downloads per month
Used in 31 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