This repo contains the highlight.js language definition for Pyret.
"highlight.js": "^11.10.0"- NPM:
npm install @exercism/highlightjs-pyret - Yarn:
yarn add @exercism/highlightjs-pyret - Bun:
bun add @exercism/highlightjs-pyret
The repo's source files are defined in TypeScript and compiled to JavaScript.
The repo is structured as follows:
.
├── src
│ ├── <language>.ts (the language definition)
│ ├── <language>.js (the built output)
│ └── <language>.d.ts (the type declarations)
├── test
│ ├── detect (auto-detection test cases)
│ │ └── *.txt (input)
│ ├── markup (markup test cases)
│ │ ├── *.txt (input)
│ │ └── *.expected (expected output)
│ └── <language>.test.ts (test runner for tests/detect)
├── index.html (dev server file)
└── tsconfig.json (TypeScript config)
Run bun install to install all dependencies.
To help with development, run bun run dev.
This will start a Vite dev server (usually at http://localhost:5173/) that renders the index.html file.
The page displays a hardcoded sample of source code highlighted using the language definition in src/<language>.ts.
Any changes to the language definition will auto-refresh the dev server's rendered output.
The test/detect and test/markup directories contain the test files.
Run bun test to run these tests.
Note: test files should be relatively small and focus on a single aspect of the language.
Run bun publish to publish the plugin to NPM.