Skip to content

(docs) add Pug to SUPPORTED_LANGUAGES - #4558

Open
seebaermichi wants to merge 1 commit into
highlightjs:mainfrom
seebaermichi:add-pug-3rd-party
Open

seebaermichi wants to merge 1 commit into
highlightjs:mainfrom
seebaermichi:add-pug-3rd-party

Conversation

@seebaermichi

Copy link
Copy Markdown

Adds Pug (formerly Jade) to SUPPORTED_LANGUAGES.md as a 3rd-party grammar: @nera-static/highlightjs-pug (npm, live demo).

Pug has no grammar in core or in the 3rd-party list, and the existing unscoped highlightjs-pug package on npm is a stripped HAML copy that only highlights .class and #id. This one covers tags, class/id shorthand, attributes with JavaScript values (also across lines), keywords, include/extends paths, mixins, comments, doctype, piped text, block expansion, code lines, =/!= output and #{}/!{}/#[] interpolation, using standard scopes. The limits of a pattern-based grammar for an indentation language (text blocks, filter bodies) are documented in its README. The demo shows real templates in stock themes, with each token's scope on hover.

The package follows extra/3RD_PARTY_QUICK_START.md: src/languages/pug.js, markup tests in test/markup/pug/, and committed dist/ builds (pug.min.js registering on the global hljs, pug.es.min.js).

Changes

  • One row in SUPPORTED_LANGUAGES.md, alphabetically between Protocol Buffers and Puppet.

Checklist

  • Added markup tests, or they don't apply here because... this PR only adds a listing. The package's 48 markup tests pass in this repo's runner (ONLY_EXTRA=true npm run test-markup with the package in extra/), and npm test passes with it installed. With Pug registered, none of the 199 samples in test/detect changes its detected language.
  • I have read and followed our AI-assisted contributions policy (human review, no slop)

The grammar was written with AI assistance and reviewed by me.

Assisted-by: Claude Opus 5.5

Assisted-by: Claude Opus 5.5
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
seebaermichi pushed a commit to seebaermichi/nera-highlightjs-pug that referenced this pull request Oct 10, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant