smithery.ai

prism-syntax

Use when adding syntax highlighting for custom languages to Prism.js, used by Docusaurus and many documentation sites

First seen Apr 19, 2026

Installation

$ npx skills add https://smithery.ai

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from smithery.ai · top by installs.

npx skills add https://smithery.ai

Browse all from smithery.ai

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 1,846 B
  • docs SUMMARY.md 137 B

History

  1. First seen on skills.sh
  2. First recorded snapshot · 1 installs

SKILL.md

Prism.js Syntax Highlighting

Quick Start

Prism.languages.mylang = {
  'comment': /\/\/.*/,
  'string': /"(?:\\.|[^"\\])*"/,
  'keyword': /\b(?:if|else|while|for|return)\b/,
  'number': /\b\d+(?:\.\d+)?\b/,
  'operator': /[+\-*/%=<>!&|]+/,
  'punctuation': /[{}[\];(),.:]/
};

Token Types (CSS Classes)

  • comment - Comments
  • string - String literals
  • keyword - Language keywords
  • number - Numeric literals
  • operator - Operators
  • punctuation - Punctuation marks
  • function - Function names
  • class-name - Type/class names
  • property - Object properties
  • boolean - true/false
  • builtin - Built-in functions

Pattern Techniques

{
  // Lookbehind for context
  'function': {
    pattern: /(\bfunction\s+)\w+/,
    lookbehind: true
  },
  // Nested grammar
  'interpolation': {
    pattern: /\$\{[^}]+\}/,
    inside: {
      'variable': /\$\{|\}/,
      'expression': { pattern: /[\s\S]+/, inside: Prism.languages.javascript }
    }
  },
  // Greedy matching
  'string': { pattern: /"(?:\\.|[^"\\])*"/, greedy: true }
}

Docusaurus Integration

// docusaurus.config.js
module.exports = {
  themeConfig: {
    prism: {
      additionalLanguages: ['mylang'],
      theme: require('prism-react-renderer').themes.github,
    }
  }
};

// Create src/prism/prism-mylang.js and import in src/theme/prism-include-languages.js

Reference Files

  • [references/tokens.md](references/tokens.md) - Complete token reference
  • [references/patterns.md](references/patterns.md) - Advanced pattern techniques
  • [references/docusaurus.md](references/docusaurus.md) - Docusaurus integration