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

hcl-edit

Parse and modify HCL while preserving comments and whitespace

36 releases

0.7.7 Apr 13, 2024
0.7.5 Jan 4, 2024
0.7.4 Sep 27, 2023
0.7.2 Jul 14, 2023
0.3.1 Mar 31, 2023

#816 in Encoding

Download history 950/week @ 2024-01-03 364/week @ 2024-01-10 580/week @ 2024-01-17 318/week @ 2024-01-24 747/week @ 2024-01-31 490/week @ 2024-02-07 514/week @ 2024-02-14 511/week @ 2024-02-21 499/week @ 2024-02-28 413/week @ 2024-03-06 386/week @ 2024-03-13 543/week @ 2024-03-20 962/week @ 2024-03-27 758/week @ 2024-04-03 821/week @ 2024-04-10 1269/week @ 2024-04-17

3,934 downloads per month
Used in 12 crates (2 directly)

MIT/Apache

330KB
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