summaryrefslogtreecommitdiffstats
path: root/helpcontent2/help3xsl/README.prism.js.txt
blob: 96a42aa1307ad8896fb12644301b8b091b549fed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
Latest download version

PrismJS 1.28.0

Using prism.js for Basic code highlight

http://prismjs.com

License MIT (see prism.js)

Download page http://prismjs.com/download

Theme: Coy

Languages to download: 
Visual Basic + 
Python + 
SQL + 
defaults Prism pre-sets

Plugins: 
line numbers,
normalize-whitespace: configure after https://prismjs.com/plugins/normalize-whitespace/

Prism.plugins.NormalizeWhitespace = new NormalizeWhitespace({
'remove-trailing': true,
'remove-indent': true,
'left-trim': true,
'right-trim': true,
/*'break-lines': 80,
'indent': 2,*/
'remove-initial-line-feed': true,
/*'tabs-to-spaces': 4,
'spaces-to-tabs': 4*/
});


Usage:

Add prism.js and prism.css to html page,

Add class 'language-visual-basic' and 'line-numbers' to <code> as in

<xsl:template match="bascode">
    <div class="bascode" itemscope="true" itemtype="http://schema.org/SoftwareSourceCode" itemprop="codeSampleType" content="snippet">
        <xsl:attribute name="data-tooltip"><xsl:value-of select="$ui_copyclip"/></xsl:attribute>
        <pre><code class="language-visual-basic line-numbers"><xsl:apply-templates /></code></pre>
    </div>
</xsl:template>

<xsl:template match="pycode">
    <div class="pycode" itemscope="true" itemtype="http://schema.org/SoftwareSourceCode" itemprop="codeSampleType" content="snippet">
        <xsl:attribute name="data-tooltip"><xsl:value-of select="$ui_copyclip"/></xsl:attribute>
        <pre><code class="language-python line-numbers"><xsl:apply-templates /></code></pre>
    </div>
</xsl:template>