Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

HCL

RawHCL accepts pre-serialized HCL bytes (there is no marshal method since HCL has no standard Go marshal API):

clog.Print().RawHCL(terraformConfig)

Styling

Token colors are configured via styles:

custom := style.DefaultHCL()
custom.Key = new(lipgloss.NewStyle().Foreground(lipgloss.Color("#50fa7b")))
clog.SetStyles(&style.Config{HCL: custom})
Style fieldTokens
BlockTypeblock type identifiers (resource, variable)
BoolFalsefalse
BoolTruetrue
Comment#, //, /* */ comments
Keyattribute keys (identifier before =)
NestedKeyattribute keys inside nested blocks (depth >= 2); falls back to Key
Nullnull
Numbernumeric literals
Punctuationstructural tokens (=, {, }, [, ])
Stringstring values and quote markers