Skip to content

Commit 1253894

Browse files
authored
Use djot-grammars as canonical source for syntax highlighting (#103)
* Use djot-grammars as the canonical source for syntax highlighting grammars - Remove duplicate hljs-djot.ts and hljs-djot.js files - Update docs to use djot-grammars npm package for TextMate and highlight.js grammars - Update syntax-highlighting cookbook to reference djot-grammars - Update tests to use djot-grammars package * Fix: Use GitHub URL for djot-grammars (not yet on npm) * Update package-lock.json and fix workflow paths
1 parent f2de310 commit 1253894

12 files changed

Lines changed: 46 additions & 982 deletions

File tree

.github/workflows/test-hljs.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,9 @@ on:
44
push:
55
branches: [master]
66
paths:
7-
- 'docs/public/assets/hljs-djot.js'
87
- 'docs/tests/**'
98
pull_request:
109
paths:
11-
- 'docs/public/assets/hljs-djot.js'
1210
- 'docs/tests/**'
1311
workflow_dispatch:
1412

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,3 +133,4 @@ See [Safe Mode](https://php-collective.github.io/djot-php/guide/safe-mode) for d
133133
- [Djot](https://djot.net/) - Official Djot website with syntax reference and playground
134134
- [jgm/djot](https://github.com/jgm/djot) - Reference implementation in JavaScript by John MacFarlane
135135
- [JetBrains IDE support](https://github.com/php-collective/djot-intellij) - Plugin for PhpStorm, IntelliJ IDEA, WebStorm, etc.
136+
- [djot-grammars](https://github.com/php-collective/djot-grammars) - Syntax highlighting grammars (TextMate, highlight.js, Prism.js)

docs/.vitepress/components/DjotPlayground.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<script setup lang="ts">
22
import { ref, watch, onMounted, nextTick } from 'vue'
33
import hljs from 'highlight.js'
4-
import hljsDjot from '../hljs-djot'
4+
import hljsDjot from 'djot-grammars/highlightjs/djot.js'
55
66
// Register Djot language for syntax highlighting
77
if (!hljs.getLanguage('djot')) {

0 commit comments

Comments
 (0)