Skip to content

Commit

Permalink
Add syntax highlighting for bolt docs (#193)
Browse files Browse the repository at this point in the history
  • Loading branch information
robsdedude authored Oct 11, 2023
1 parent 4ea1b0f commit 671e012
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions src/js/vendor/highlight.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,5 +92,40 @@
illegal: /([;<']|BEGIN)/,
}
})
hljs.registerLanguage('bolt',
function (hljs) {
return {
keywords: {
$pattern: /[a-zA-Z_]+:?/,
name: 'HELLO INIT LOGON LOGOFF TELEMETRY GOODBYE ACK_FAILURE RESET RUN DISCARD DISCARD_ALL PULL PULL_ALL BEGIN COMMIT ROLLBACK ROUTE SUCCESS IGNORED FAILURE RECORD',
keyword: 'C: S:',
literal: 'true false null',
type: 'Null Boolean Integer Float Bytes String List Dictionary',
},
contains: [
hljs.COMMENT('//', '$', {}),
hljs.QUOTE_STRING_MODE,
{
className: 'number',
begin: '-?\\b\\d+(\\.\\d*)?',
relevance: 0
},
{
className: '',
begin: '(?=[a-zA-Z_]+?::)',
returnBegin: true,
contains: [
{
className: 'name',
begin: '[a-zA-Z_]+?',
end: '::',
excludeEnd: true,
endsParent: true,
},
]
},
]
}
})
hljs.highlightAll()
})()

0 comments on commit 671e012

Please sign in to comment.