From a98b5ea6fe8e8cc98a55e0fd793e6e8660ea31c1 Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Thu, 30 Dec 2021 19:47:21 +0100 Subject: chore: add prismjs for syntax highlighting --- public/prism/prism-mongodb.min.js | 280 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 280 insertions(+) create mode 100644 public/prism/prism-mongodb.min.js (limited to 'public/prism/prism-mongodb.min.js') diff --git a/public/prism/prism-mongodb.min.js b/public/prism/prism-mongodb.min.js new file mode 100644 index 0000000..6c845ac --- /dev/null +++ b/public/prism/prism-mongodb.min.js @@ -0,0 +1,280 @@ +!(function ($) { + var e = [ + '$eq', + '$gt', + '$gte', + '$in', + '$lt', + '$lte', + '$ne', + '$nin', + '$and', + '$not', + '$nor', + '$or', + '$exists', + '$type', + '$expr', + '$jsonSchema', + '$mod', + '$regex', + '$text', + '$where', + '$geoIntersects', + '$geoWithin', + '$near', + '$nearSphere', + '$all', + '$elemMatch', + '$size', + '$bitsAllClear', + '$bitsAllSet', + '$bitsAnyClear', + '$bitsAnySet', + '$comment', + '$elemMatch', + '$meta', + '$slice', + '$currentDate', + '$inc', + '$min', + '$max', + '$mul', + '$rename', + '$set', + '$setOnInsert', + '$unset', + '$addToSet', + '$pop', + '$pull', + '$push', + '$pullAll', + '$each', + '$position', + '$slice', + '$sort', + '$bit', + '$addFields', + '$bucket', + '$bucketAuto', + '$collStats', + '$count', + '$currentOp', + '$facet', + '$geoNear', + '$graphLookup', + '$group', + '$indexStats', + '$limit', + '$listLocalSessions', + '$listSessions', + '$lookup', + '$match', + '$merge', + '$out', + '$planCacheStats', + '$project', + '$redact', + '$replaceRoot', + '$replaceWith', + '$sample', + '$set', + '$skip', + '$sort', + '$sortByCount', + '$unionWith', + '$unset', + '$unwind', + '$abs', + '$accumulator', + '$acos', + '$acosh', + '$add', + '$addToSet', + '$allElementsTrue', + '$and', + '$anyElementTrue', + '$arrayElemAt', + '$arrayToObject', + '$asin', + '$asinh', + '$atan', + '$atan2', + '$atanh', + '$avg', + '$binarySize', + '$bsonSize', + '$ceil', + '$cmp', + '$concat', + '$concatArrays', + '$cond', + '$convert', + '$cos', + '$dateFromParts', + '$dateToParts', + '$dateFromString', + '$dateToString', + '$dayOfMonth', + '$dayOfWeek', + '$dayOfYear', + '$degreesToRadians', + '$divide', + '$eq', + '$exp', + '$filter', + '$first', + '$floor', + '$function', + '$gt', + '$gte', + '$hour', + '$ifNull', + '$in', + '$indexOfArray', + '$indexOfBytes', + '$indexOfCP', + '$isArray', + '$isNumber', + '$isoDayOfWeek', + '$isoWeek', + '$isoWeekYear', + '$last', + '$last', + '$let', + '$literal', + '$ln', + '$log', + '$log10', + '$lt', + '$lte', + '$ltrim', + '$map', + '$max', + '$mergeObjects', + '$meta', + '$min', + '$millisecond', + '$minute', + '$mod', + '$month', + '$multiply', + '$ne', + '$not', + '$objectToArray', + '$or', + '$pow', + '$push', + '$radiansToDegrees', + '$range', + '$reduce', + '$regexFind', + '$regexFindAll', + '$regexMatch', + '$replaceOne', + '$replaceAll', + '$reverseArray', + '$round', + '$rtrim', + '$second', + '$setDifference', + '$setEquals', + '$setIntersection', + '$setIsSubset', + '$setUnion', + '$size', + '$sin', + '$slice', + '$split', + '$sqrt', + '$stdDevPop', + '$stdDevSamp', + '$strcasecmp', + '$strLenBytes', + '$strLenCP', + '$substr', + '$substrBytes', + '$substrCP', + '$subtract', + '$sum', + '$switch', + '$tan', + '$toBool', + '$toDate', + '$toDecimal', + '$toDouble', + '$toInt', + '$toLong', + '$toObjectId', + '$toString', + '$toLower', + '$toUpper', + '$trim', + '$trunc', + '$type', + '$week', + '$year', + '$zip', + '$comment', + '$explain', + '$hint', + '$max', + '$maxTimeMS', + '$min', + '$orderby', + '$query', + '$returnKey', + '$showDiskLoc', + '$natural', + ], + t = + '(?:' + + (e = e.map(function ($) { + return $.replace('$', '\\$'); + })).join('|') + + ')\\b'; + ($.languages.mongodb = $.languages.extend('javascript', {})), + $.languages.insertBefore('mongodb', 'string', { + property: { + pattern: + /(?:(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)(?=\s*:)/, + greedy: !0, + inside: { keyword: RegExp('^([\'"])?' + t + '(?:\\1)?$') }, + }, + }), + ($.languages.mongodb.string.inside = { + url: { + pattern: + /https?:\/\/[-\w@:%.+~#=]{1,256}\.[a-z0-9()]{1,6}\b[-\w()@:%+.~#?&/=]*/i, + greedy: !0, + }, + entity: { + pattern: + /\b(?:(?:[01]?\d\d?|2[0-4]\d|25[0-5])\.){3}(?:[01]?\d\d?|2[0-4]\d|25[0-5])\b/, + greedy: !0, + }, + }), + $.languages.insertBefore('mongodb', 'constant', { + builtin: { + pattern: RegExp( + '\\b(?:' + + [ + 'ObjectId', + 'Code', + 'BinData', + 'DBRef', + 'Timestamp', + 'NumberLong', + 'NumberDecimal', + 'MaxKey', + 'MinKey', + 'RegExp', + 'ISODate', + 'UUID', + ].join('|') + + ')\\b' + ), + alias: 'keyword', + }, + }); +})(Prism); -- cgit v1.2.3