summaryrefslogtreecommitdiffstats
path: root/help3xsl/README.prism.js.txt
diff options
context:
space:
mode:
authorOlivier Hallot <olivier.hallot@libreoffice.org>2018-11-29 11:09:15 -0200
committerOlivier Hallot <olivier.hallot@libreoffice.org>2018-11-29 21:41:54 +0100
commit635750a0cda2e9f6f906e10e33a087b579a74ba8 (patch)
treef66ee5be65a4b67388323736a5b181581f2fdd36 /help3xsl/README.prism.js.txt
parentHelp pages for VBA Enum statement (diff)
downloadhelp-635750a0cda2e9f6f906e10e33a087b579a74ba8.tar.gz
help-635750a0cda2e9f6f906e10e33a087b579a74ba8.zip
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/README.prism.js.txt')
-rw-r--r--help3xsl/README.prism.js.txt39
1 files changed, 39 insertions, 0 deletions
diff --git a/help3xsl/README.prism.js.txt b/help3xsl/README.prism.js.txt
new file mode 100644
index 0000000000..581a1fe71c
--- /dev/null
+++ b/help3xsl/README.prism.js.txt
@@ -0,0 +1,39 @@
+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 + defaults 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">
+ <pre><code class="language-visual-basic line-numbers"><xsl:apply-templates /></code></pre></div>
+</xsl:template>