Deutsch English Français Italiano |
<vef7oh$caat$1@dont-email.me> View for Bookmarking (what is this?) Look up another Usenet article |
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: =?UTF-8?Q?Arne_Vajh=C3=B8j?= <arne@vajhoej.dk> Newsgroups: comp.os.vms Subject: Re: highlight.js & DCL Date: Sat, 12 Oct 2024 21:28:50 -0400 Organization: A noiseless patient Spider Lines: 121 Message-ID: <vef7oh$caat$1@dont-email.me> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Sun, 13 Oct 2024 03:28:50 +0200 (CEST) Injection-Info: dont-email.me; posting-host="a15c40dd9459a1347e07ff65fce4264f"; logging-data="403805"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/t2q0oluWIinQaAH7qhCqwl52Un4WlJ50=" User-Agent: Mozilla Thunderbird Cancel-Lock: sha1:Az4yciiyqJEW8ece2/ogCPqJ8Io= Content-Language: en-US On 1/18/2022 7:56 PM, Arne Vajhøj wrote: > Long shot, but has anyone added DCL support to highlight.js? > > https://highlightjs.org/ > > (it hash all kinds of programming languages, bash, cmd > etc. but no DCL) I finally got to take a look at it. Not so difficult. First attempt attached below. Arne export default function(hljs) { const COMMENT = hljs.COMMENT( '!', '$', { relevance: 10 } ); const KEYWORDS = [ "if", "then", "else", "endif", "goto", "open", "read", "write", "close", "call", "subroutine", "return", "endsubroutine", "def", "define", "assign", "deassign", "set", "show", "on", "wait", "exit" ]; const BUILT_INS = [ "copy", "type", "append", "del", "delete", "pur", "purge", "ren", "rename", "dir", "directory", "cre", "create", "conv", "convert", "pipe", "edit", "link", "run", "for", "fortran", "pas", "pascal", "cc", "cxx", "bas", "basic", "cob", "cobol", "macro", "bliss", "java", "javax", "groovy", "groovyc", "kotlin", "kotlinc", "scala", "scalac", "python", "php", "sear", "search", "diff", "difference", "sort", "backup", "allocate", "deallocate", "mount", "dismount", "submit", "print", "logout" ]; return { name: 'DCL (VMS)', aliases: [ 'dcl', 'com' ], case_insensitive: true, keywords: { $pattern: /\b[a-z]+\b/, keyword: KEYWORDS, built_in: BUILT_INS }, contains: [ hljs.QUOTE_STRING_MODE, COMMENT ] }; }