スキル一覧に戻る
mcclowes

prism-syntax

by mcclowes

A constraint and probability-based programming language

1🍴 0📅 2026年1月12日
GitHubで見るManusで実行

SKILL.md


name: prism-syntax

prettier-ignore

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

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

スコア

総合スコア

60/100

リポジトリの品質指標に基づく評価

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

+10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

レビュー

💬

レビュー機能は近日公開予定です