DocBook2OperashowCustomizationLayer

Norman Walsh edited this page Oct 1, 2015 · 1 revision

DocBook2Operashow

''This customization layer for the DocBookXslStylesheets converts a DocBook document to html that can be viewed as a slide show in the Opera web browser.''

Usage

''When writing a DocBook document, use role="screen" to indicate elements that should only be displayed when viewing the page as regular html. This text diappears when viewing the page in full screen mode. Use role="presentation" on elements that should not appear when the page is viewed as regular html. Convert your DocBook document to html using the stylesheet below and your favorite xsl processor. Then view the page in Opera and press F11 to toggle full screen mode. For an example, see How to avoid learning XML. Also see this Operashow tutorial. Send questions to DavidCramer''

Stylesheet

{{{

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">

<xsl:import href="http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl"/>

<xsl:param name="css.decoration">1</xsl:param> <xsl:param name="generate.toc"></xsl:param> <xsl:param name="section.autolabel">0</xsl:param>

<xsl:param name="phrase.propagates.style">1</xsl:param>

<xsl:template match="*[not(self::phrase) and @role = 'screen']">

<xsl:template match="*[@role = 'projection']">

<xsl:template name="user.head.content">

<style type="text/css"> /* common settings for all modes and CSS1 browsers */ div.projection { display: none } div.screen { display: block } /* settings for normal screen mode */ @media screen { body { color: black; background: white; margin: 2em; } div.projection { display: none } div.screen { display: block } } /* settings for projection mode */ @media projection { body { font: 25px Gill Sans, sans-serif; color: black; background: white; padding-left: 1em; padding-right: 1em; } h1.title, h2.title, h3.title, h4.title, h5.title, h6.title, h7.title, h8.title { page-break-before: always; font-size: 1.4em; text-align: center; margin-top: 2em; padding-bottom: 0.2em; } h1.title{ page-break-before: auto; } // Don't display footnotes or footnote markers. // but do display superscripted numbers that aren't // footnote markers. See override of inline.superscriptseq below. // This kind of works, but Opera gets a little confused by the // inline non-displayed stuff inside a block non-displayed region. div.footnotes{ display: none;} div.footnote{ display: none;} sup.inline{display: inline;} sup{ display: none;} div.projection { display: block } div.screen { display: none } span.screen { display: none} } div.revhistory {padding-bottom: 6px} body { padding-top: 1px } /* hack to get around bug in Opera 4.0 */ </style>

</xsl:template>

<xsl:template name="user.header.content">

<xsl:template name="inline.superscriptseq"> <xsl:param name="content"> <xsl:call-template name="anchor"/> <xsl:call-template name="simple.xlink"> <xsl:with-param name="content"> xsl:apply-templates/ </xsl:with-param> </xsl:call-template> </xsl:param> <xsl:copy-of select="$content"/> </xsl:template>

</xsl:stylesheet>

}}}

Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.