diff options
author | Olivier Hallot <olivier.hallot@libreoffice.org> | 2018-12-13 10:17:56 -0200 |
---|---|---|
committer | Olivier Hallot <olivier.hallot@libreoffice.org> | 2018-12-13 13:53:34 +0100 |
commit | 7db9d1ee3bb3626d99a6a58fe98eb185c65ddda5 (patch) | |
tree | 2dedb6e21e40b8c1a638dbff9ae4f96052f13800 /help3xsl/online_transform.xsl | |
parent | 3f0f452519618e4b0bd0b97a855fc5ffe5514a49 (diff) |
Add support for python code scripts
Introduced <pycode> section and "pycode" role for paragraphs
with same behaviour as BASIC coounterparts.
Used to list python scripts examples ans code fragments
in help pages
Change-Id: Ica76bcc65dcf422a1eb4b7f39a6d671b2e4e573c
Reviewed-on: https://gerrit.libreoffice.org/65097
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 | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/help3xsl/online_transform.xsl b/help3xsl/online_transform.xsl index e5671e22f6..e69d223105 100644 --- a/help3xsl/online_transform.xsl +++ b/help3xsl/online_transform.xsl @@ -553,7 +553,7 @@ <xsl:apply-templates /> </xsl:when> - <xsl:when test="@role='bascode'"> + <xsl:when test="@role='bascode' or @role='pycode'"> <xsl:value-of select="." /> </xsl:when> @@ -949,6 +949,13 @@ <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> +<xsl:template match="pycode"> + <div class="pycode" itemscope="true" itemtype="http://schema.org/SoftwareSourceCode" itemprop="codeSampleType" content="snippet"><pre><code class="language-python line-numbers"><xsl:apply-templates /></code></pre></div> +</xsl:template> +<xsl:template match="pycode" mode="embedded"> + <div class="pycode" itemscope="true" itemtype="http://schema.org/SoftwareSourceCode" itemprop="codeSampleType" content="snippet"><pre><code class="language-python line-numbers"><xsl:apply-templates mode="embedded" /></code></pre></div> +</xsl:template> + <!-- Insert Logo code snippet --> <xsl:template name="insertlogocode"> <pre><xsl:apply-templates /></pre> |