syntax icon indicating copy to clipboard operation
syntax copied to clipboard

Create an accurate Terraform & HCL grammar for PrismJS

Open radeksimko opened this issue 3 years ago • 0 comments

Background

HCL and Terraform languages evolve over time and the existing community-maintained PrismJS grammar doesn't accurately capture the state of these languages or relationship between HCL and Terraform.

In particular they seem to be treated as the same language, where any HCL config (such as Packer) highlights Terraform keywords: https://github.com/PrismJS/prism/blob/c2f6a64426f44497a675cb32dccb079b3eff1609/components/prism-hcl.js

Proposal

  • [ ] Publish a PrismJS grammar for HCL, based on existing TextMate grammar
  • [ ] Publish a PrismJS grammar for Terraform, based on existing TextMate grammar
  • [ ] (Unknown) Find out how existing websites can switch to that and/or whether we can get PrismJS/prism to consume our grammars
    • [ ] Terraform - e.g. https://www.terraform.io/language
    • [ ] Packer - e.g. https://www.packer.io/docs/templates/hcl_templates
    • [ ] Nomad - e.g. https://www.nomadproject.io/docs/configuration
    • [ ] Waypoint - e.g. https://www.waypointproject.io/docs/waypoint-hcl#template-waypoint-hcl
    • [ ] Consul - e.g. https://www.consul.io/docs/agent/config/config-files
    • [ ] Vault - e.g. https://www.vaultproject.io/docs/configuration
    • [ ] Boundary - e.g. https://www.boundaryproject.io/docs/configuration

radeksimko avatar May 27 '22 12:05 radeksimko