xsharp.eu • X# Syntax Highlighting in Html Files with HighlightJS
Page 1 of 1

X# Syntax Highlighting in Html Files with HighlightJS

Posted: Mon Aug 02, 2021 12:39 pm
by VR
Our summer intern was busy and released another syntax highlighting related plugin, this time for the JS library HighlightJS. It can be used in the following way:

Code: Select all

<head>
    <link rel=stylesheet href="https://cdn.jsdelivr.net/npm/highlight.js@11.1.0/styles/vs.css" />
    <script src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.1.0/build/highlight.min.js" ></script>
    <script src="https://cdn.jsdelivr.net/npm/highlightjs-xsharp@0.0.1/dist/xsharp.min.js" ></script>
    <script>hljs.highlightAll()</script>
</head>
<body>
    <pre><code class="language-xsharp">
using system.Xml.Linq // needs references to System.XML and System.Xml.Linq in Project

class XDocumentExportExamples

method StaticXmlDoc() as void strict
    var doc := XDocument{;
    XElement{"info", ;
        XElement{"version", XAttribute{"id", 123}}, ;
        XElement{"changelog", "dummy dummy"}}}
    Console:WriteLine(doc:ToString())
    return
    </code></pre>
</body>    
When this Html Code is shown in a Browser, it looks like this:

Image