Skip to content

Latest commit

 

History

History
71 lines (49 loc) · 2.63 KB

File metadata and controls

71 lines (49 loc) · 2.63 KB

replace-this-with-the-track-name language support for highlight.js

NPM Version

This repo contains the highlight.js language definition for replace-this-with-the-track-name.

⚠️ To ensure that the package can be integrated on the Exercism website, don't change the packages' versions:

"highlight.js": "^11.10.0"

Install

  • NPM: npm install @exercism/highlightjs-replace-this-with-the-track-slug
  • Yarn: yarn add @exercism/highlightjs-replace-this-with-the-track-slug
  • Bun: bun add @exercism/highlightjs-replace-this-with-the-track-slug

Prerequisites

Resources

Structure

The repo's source files are defined in TypeScript and compiled to JavaScript.

.
├── src
│   ├── replace-this-with-the-track-slug.ts (the language definition)
│   ├── replace-this-with-the-track-slug.js (the built output)
│   └── replace-this-with-the-track-slug.d.ts (the type declarations)
├── test
│   ├── detect (auto-detection test cases)
│   │   └── *.txt (input)
│   ├── markup (markup test cases)
│   │   ├── *.txt (input)
│   │   └── *.expected (expected output)
│   └── replace-this-with-the-track-slug.test.ts (test runner for tests/detect)
├── index.html (dev server file)
└── tsconfig.json (TypeScript config)

Setup

Run bun install to install all dependencies.

Developing

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/replace-this-with-the-track-slug.ts. Any changes to the language definition will auto-refresh the dev server's rendered output.

Testing

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.

Publishing

Run bun publish to publish the plugin to NPM.