Skip to content

Commit

Permalink
Add gleam highlightjs support (exercism#3430)
Browse files Browse the repository at this point in the history
This reverts commit a3e3745.
  • Loading branch information
ErikSchierboom authored Feb 7, 2023
1 parent 70cb329 commit 288b5f0
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 0 deletions.
7 changes: 7 additions & 0 deletions app/javascript/declarations/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,10 @@ declare module 'highlightjs-bqn' {

export default setup
}

declare module 'highlightjs-gleam' {
import { LanguageFn } from 'highlight.js'
const setup: LanguageFn

export default setup
}
2 changes: 2 additions & 0 deletions app/javascript/utils/highlight.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ import { useEffect, useRef } from 'react'
import setupABAP from 'highlightjs-sap-abap'
import setupCobol from 'highlightjs-cobol'
import setupBqn from 'highlightjs-bqn'
import setupGleam from '@gleam-lang/highlight.js-gleam'

highlighter.default.registerLanguage('abap', setupABAP)
highlighter.default.registerLanguage('cobol', setupCobol)
highlighter.default.registerLanguage('bqn', setupBqn)
highlighter.default.registerLanguage('gleam', setupGleam)

highlighter.default.configure({
throwUnescapedHTML: true,
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"@exercism/active-background": "^0.6.2",
"@exercism/codemirror-lang-wren": "https://github.com/exercism/codemirror-lang-wren",
"@exercism/twine2-story-format": "https://github.com/exercism/twine2-story-format.git",
"@gleam-lang/highlight.js-gleam": "^1.0.0",
"@hotwired/turbo-rails": "^7.1.3",
"@popperjs/core": "^2.5.2",
"@rails/actioncable": "^6.0.0",
Expand Down
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1393,6 +1393,11 @@
npm "^6.3.0"
underscore "^1.8.3"

"@gleam-lang/highlight.js-gleam@^1.0.0":
version "1.0.0"
resolved "https://registry.yarnpkg.com/@gleam-lang/highlight.js-gleam/-/highlight.js-gleam-1.0.0.tgz#c9868daf7bc04df3477aaa3357c49a27edd3a18a"
integrity sha512-PNtTN5u7yQgo3uj+vm4SkZ2dbH+ozVMlsbaq8KdrNW5OPWsbRsPluSvGrhCkjJ2RVQKBsKK1o8WTjEU1hNTY1A==

"@hotwired/turbo-rails@^7.1.3":
version "7.1.3"
resolved "https://registry.yarnpkg.com/@hotwired/turbo-rails/-/turbo-rails-7.1.3.tgz#a4e04ecb800a06e7f9aa6e298170fa4580b74216"
Expand Down

0 comments on commit 288b5f0

Please sign in to comment.