MatthiasHunt / wordpress-syntax-highlighter

A VS Code Extension that adds syntax highlighting to WordPress and Gutenberg decorators and function calls that exist inside traditional comment blocks

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

This extension provides syntax highlighting for the following WordPress syntaxes that exist inside traditional comment blocks:

  • Plugin header fields (PHP)
  • Block patten fields (PHP)
  • Theme header fields (style.css)
  • Block markup (HTML + JSON)

Examples

HTML

Screenshot of an HTML file containing colorized WordPress blocks

CSS

Screenshot of a CSS WordPress theme file containing a colorized header

PHP

Screenshot of a PHP WordPress theme file containing a colorized block pattern header and colorized HTML

Additional Features

The Syntax Highlighter also implements rules for pattern/header field validation based on the following official documentation:

Screenshot of a PHP WordPress theme file containing a colorized block pattern header and colorized HTML

Unmatched brackets cause error highlighting inside the embedded JSON of WordPress blocks

Screenshot of a PHP WordPress theme file containing a colorized block pattern header and colorized HTML

Credits

This project was inspired by Gutenberg Comment Highlight by @chrisrhymes

Wapuu design by @marktimemedia

About

A VS Code Extension that adds syntax highlighting to WordPress and Gutenberg decorators and function calls that exist inside traditional comment blocks

License:MIT License


Languages

Language:PHP 45.7%Language:HTML 35.5%Language:CSS 18.8%