Package detail

shiki-templ

indaco14MITdeprecated0.2.4

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

Enabling Templ syntax highlighting in Shiki.

shiki, syntax-highlighting, templ, go

readme

shiki-templ

Enabling Templ syntax highlighting in Shiki.

  NPM Package license

shiki-templ makes easier to use the TextMate grammar definition for Templ with Shiki.

The package fetches the online version of the grammar file.

[!NOTE] A PR has been submitted to officially add Templ language support to Shiki. > This package will be used in the meantime.

sample templ syntax

Installation

You can install the package using npm, pnpm, or yarn:

# npm
npm install shiki-templ

# pnpm
pnpm add shiki-templ

# yarn
yarn add shiki-templ

Usage

Shiki

To use the shiki-templ with Shiki, please refer to the official Load Custom Language page.

Vitepress

Here's how you can configure Vitepress to use the shiki-templ:

import { defineConfig } from "vitepress";
import { templLang } from "shiki-templ";

// https://vitepress.dev/reference/site-config
export default defineConfig({
    // ...
    markdown: {
        languages: [templLang],
    },
}):

License

This project is licensed under the MIT License - see the LICENSE file for details.

changelog

Changelog

v0.2.4

compare changes

💅 Refactors

🏡 Chore

❤️ Contributors

v0.2.3

compare changes

🚀 Enhancements

  • Converted readLocalGrammar to an async (53ce432)

🏡 Chore

  • Add prefix text to output messages and errors (b921bba)
  • templ.tmLanguage.json: Updated (73528c5)
  • Update dev deps (628b2a5)

❤️ Contributors

v0.2.2

🩹 Fixes

  • Use LanguageInput as type instead of LanguageRegistration (a9891f3)
  • Add "shiki" as peer dependency (4b74a8c)

❤️ Contributors

v0.2.1

🩹 Fixes

  • Dynamically import Node.js modules only if running in a Node.js environment (isNode is true). (e60646a)

🏡 Chore

  • package.json: Bump packageManager to pnpm@9.1.4 (57adebc)

❤️ Contributors

v0.2.0

🚀 Enhancements

  • Attempts to fetch the online grammar file first and falls back to the local (25c7467)

💅 Refactors

  • rewrite in Typescript (21e73e4)
  • Update path join syntax in grammarPath assignment (77ad5e3)

📖 Documentation

  • README.md: Update description text (d212f63)
  • Update README and description (eca121f)

🏡 Chore

❤️ Contributors