diff options
author | Olivier Hallot <olivier.hallot@libreoffice.org> | 2018-11-29 11:09:15 -0200 |
---|---|---|
committer | Olivier Hallot <olivier.hallot@libreoffice.org> | 2018-11-29 21:41:54 +0100 |
commit | 635750a0cda2e9f6f906e10e33a087b579a74ba8 (patch) | |
tree | f66ee5be65a4b67388323736a5b181581f2fdd36 /help3xsl/online_transform.xsl | |
parent | 93b7b1c8c79744b8d172dc0f2bbdf8a80e05abd8 (diff) |
tdf#115663 Syntax highlight in BASIC code examples
Use prism.js to highlight BASIC code in help pages
See README.prism.js.txt for details
added normalize-whitespaces plugin to remove extra 1st line
cleaned some useless css class
Change-Id: I6dde4d217a29f485199ced462b896ee1b500fba0
Reviewed-on: https://gerrit.libreoffice.org/64252
Tested-by: Jenkins
Reviewed-by: Olivier Hallot <olivier.hallot@libreoffice.org>
Diffstat (limited to 'help3xsl/online_transform.xsl')
-rw-r--r-- | help3xsl/online_transform.xsl | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/help3xsl/online_transform.xsl b/help3xsl/online_transform.xsl index 59eb5120a8..e5671e22f6 100644 --- a/help3xsl/online_transform.xsl +++ b/help3xsl/online_transform.xsl @@ -152,11 +152,13 @@ <link rel="shortcut icon" href="{$target}media/navigation/favicon.ico" /> <link type="text/css" href="{$target}normalize.css" rel="Stylesheet" /> <link type="text/css" href="{$target}default.css" rel="Stylesheet" /> + <link type="text/css" href="{$target}prism.css" rel="Stylesheet" /> <script type="text/javascript" src="{$target}help2.js"></script> <script type="text/javascript" src="{$target}languages.js"></script> <script type="text/javascript" src="{$target}{$lang}/langnames.js"></script> <script type="text/javascript" src="{$target}fuzzysort.js"></script> <script type="text/javascript" src="{$target}paginathing.js"></script> + <script type="text/javascript" src="{$target}prism.js"></script> <meta name="viewport" content="width=device-width,initial-scale=1"/> </head> <body itemscope="true" itemtype="http://schema.org/TechArticle"> @@ -552,7 +554,7 @@ </xsl:when> <xsl:when test="@role='bascode'"> - <xsl:call-template name="insertbascode" /> + <xsl:value-of select="." /> </xsl:when> <xsl:when test="@role='logocode'"> @@ -925,7 +927,6 @@ </xsl:template> - <!-- Insert Paragraph --> <xsl:template name="insertpara"> <xsl:variable name="role"> @@ -942,15 +943,10 @@ </xsl:template> <xsl:template match="bascode"> - <div class="bascode" itemscope="true" itemtype="http://schema.org/SoftwareSourceCode" itemprop="codeSampleType" content="snippet"><xsl:apply-templates /></div> + <div class="bascode" itemscope="true" itemtype="http://schema.org/SoftwareSourceCode" itemprop="codeSampleType" content="snippet"><pre><code class="language-visual-basic line-numbers"><xsl:apply-templates /></code></pre></div> </xsl:template> <xsl:template match="bascode" mode="embedded"> - <div class="bascode" itemscope="true" itemtype="http://schema.org/SoftwareSourceCode" itemprop="codeSampleType" content="snippet"><xsl:apply-templates /></div> -</xsl:template> - -<!-- Insert Basic code snippet --> -<xsl:template name="insertbascode"> - <pre class="bascodepar"><xsl:apply-templates /></pre><br/> + <div class="bascode" itemscope="true" itemtype="http://schema.org/SoftwareSourceCode" itemprop="codeSampleType" content="snippet"><pre><code class="language-visual-basic line-numbers"><xsl:apply-templates mode="embedded" /></code></pre></div> </xsl:template> <!-- Insert Logo code snippet --> |