# Syntax highlighting

**URL:** <https://discourse.haskell.org/t/syntax-highlighting/13515>\
**Category:** Site Feedback\
**Created:** [January 11, 2026, 1:49pm UTC](https://discourse.haskell.org/t/syntax-highlighting/13515 "2026-01-11T13:49:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mpilgrem](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.haskell.org/mpilgrem/32/2529_2.png) [@mpilgrem](https://discourse.haskell.org/u/mpilgrem)\
**Post date:** [January 11, 2026, 1:49pm UTC](https://discourse.haskell.org/t/syntax-highlighting/13515/1 "2026-01-11T13:49:55Z")

</div>

Could this site highlight the syntax of (a) YAML (a superset of JSON) and/or (b) Cabal files? It currently handles Haskell source code (with `~~~haskell`) and JSON (with `~~~json`).

In the case of Cabal file syntax, I appreciate that `highlighter.js` does not handle it out of the box, but perhaps _something_ can be borrowed from the [implementation](https://github.com/JustusAdam/language-haskell/blob/master/syntaxes/cabal.YAML-tmLanguage) of the Haskell Syntax Highlighting extension for VS Code (which handles Cabal files).

For example, currently, (using `~~~yaml`):

```yaml
# package.yaml
spec-version: 0.36.0
name: my-package
version: 0.1.0.0

dependencies:
- base >= 4.7 && < 5

library:
  source-dirs: src

```

Or (using, say, `~~~cabal`):

```cabal
-- my-package.cabal
cabal-version: 1.12
name: my-package
version: 0.1.0.0

library
  exposed-modules:
      Lib
  hs-source-dirs:
      src
  build-depends:
      base >=4.7 && <5

```

YAML is used to configure GHCup and Stack, describe packages (with Hpack), and widely in the CI of Haskell projects.

---

<div class="post-metadata">

**Author:** ![f-a](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.haskell.org/f-a/32/2740_2.png) [@f-a](https://discourse.haskell.org/u/f-a)\
**Post date:** [January 16, 2026, 5:41pm UTC](https://discourse.haskell.org/t/syntax-highlighting/13515/2 "2026-01-16T17:41:53Z")

</div>

This could be done via [theme components](https://meta.discourse.org/t/install-a-new-language-for-highlight-js-via-a-theme-component/292480).
