summaryrefslogtreecommitdiffstats
path: root/public/prism/prism-turtle.js
diff options
context:
space:
mode:
authorArmand Philippot <git@armandphilippot.com>2021-12-30 19:47:21 +0100
committerArmand Philippot <git@armandphilippot.com>2021-12-30 19:47:21 +0100
commita98b5ea6fe8e8cc98a55e0fd793e6e8660ea31c1 (patch)
tree542810ab5aef99150db228bb54fd58303dcb31c7 /public/prism/prism-turtle.js
parentab355897a12b7bda1089a44de326d41455a0f7a3 (diff)
chore: add prismjs for syntax highlighting
Diffstat (limited to 'public/prism/prism-turtle.js')
-rw-r--r--public/prism/prism-turtle.js54
1 files changed, 54 insertions, 0 deletions
diff --git a/public/prism/prism-turtle.js b/public/prism/prism-turtle.js
new file mode 100644
index 0000000..50493a0
--- /dev/null
+++ b/public/prism/prism-turtle.js
@@ -0,0 +1,54 @@
+Prism.languages.turtle = {
+ comment: {
+ pattern: /#.*/,
+ greedy: true,
+ },
+ 'multiline-string': {
+ pattern:
+ /"""(?:(?:""?)?(?:[^"\\]|\\.))*"""|'''(?:(?:''?)?(?:[^'\\]|\\.))*'''/,
+ greedy: true,
+ alias: 'string',
+ inside: {
+ comment: /#.*/,
+ },
+ },
+ string: {
+ pattern: /"(?:[^\\"\r\n]|\\.)*"|'(?:[^\\'\r\n]|\\.)*'/,
+ greedy: true,
+ },
+ url: {
+ pattern:
+ /<(?:[^\x00-\x20<>"{}|^`\\]|\\(?:u[\da-fA-F]{4}|U[\da-fA-F]{8}))*>/,
+ greedy: true,
+ inside: {
+ punctuation: /[<>]/,
+ },
+ },
+ function: {
+ pattern:
+ /(?:(?![-.\d\xB7])[-.\w\xB7\xC0-\uFFFD]+)?:(?:(?![-.])(?:[-.:\w\xC0-\uFFFD]|%[\da-f]{2}|\\.)+)?/i,
+ inside: {
+ 'local-name': {
+ pattern: /([^:]*:)[\s\S]+/,
+ lookbehind: true,
+ },
+ prefix: {
+ pattern: /[\s\S]+/,
+ inside: {
+ punctuation: /:/,
+ },
+ },
+ },
+ },
+ number: /[+-]?\b\d+(?:\.\d*)?(?:e[+-]?\d+)?/i,
+ punctuation: /[{}.,;()[\]]|\^\^/,
+ boolean: /\b(?:false|true)\b/,
+ keyword: [/(?:\ba|@prefix|@base)\b|=/, /\b(?:base|graph|prefix)\b/i],
+ tag: {
+ pattern: /@[a-z]+(?:-[a-z\d]+)*/i,
+ inside: {
+ punctuation: /@/,
+ },
+ },
+};
+Prism.languages.trig = Prism.languages['turtle'];