Skip to content

VSCode Syntax Highlighting for JS blocks enclosed in triple square brackets ([[[ ]]]) within YAML strings. Used when configuring Home Assistant Lovelace card, Button Card.

License

Notifications You must be signed in to change notification settings

wfurphy/vscode-button-card-js

Repository files navigation

Button Card Javascript Syntax Highlighting in VSCode

release license

This is a very niche extension for Visual Studio Code which provides syntax highlighting of Javascript code blocks in YAML which are enclosed by triple square brackets ([[[ ... ]]]). Used when configuring the advanced javascript templates properties of Button-Card cards for Home Assistant Lovelace dashboards.

  • Syntax highlighting provided using built-in Javascript grammar
  • "Double quoted" and block YAML strings supported
  • Works with the standard YAML language and the home-assistant YAML language created by the Home Assistant Config Helper plugin.

I made this while I was working on Creative Button Card Templates and could not handle writing any more JS without syntax highlighting. Hopefully it gives someone else the same relief it gave me.

Installation

Preview

VSCode BC JS Example

The preview above is using the OneDark Pro theme, however this plugin will work with any theme that supports yaml and javascript.

About

VSCode Syntax Highlighting for JS blocks enclosed in triple square brackets ([[[ ]]]) within YAML strings. Used when configuring Home Assistant Lovelace card, Button Card.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published