Skip to content

Commit

Permalink
Adding header and footer support
Browse files Browse the repository at this point in the history
  • Loading branch information
regebro committed May 13, 2017
1 parent c3e7e68 commit 6ae1b1c
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 4 deletions.
3 changes: 3 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ Changes
support installing Hovercraft as a ZIP file anyway, so it only complicates
things for no good reason.

- Support for .. header:: and .. footer:: that can be used for static
content.


2.3 (2017-04-12)
----------------
Expand Down
22 changes: 22 additions & 0 deletions docs/presentations.rst
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,28 @@ You can also add one extra Javascript-file via a command-line parameter:

hovercraft --js=my_extra.js presentationfile.rst outdir/

If you want static content, content that doesn't move with each slide; for
example a header, footer, your company logo or a slide background pattern,
then you can insert that content with the header and footer commands::

.. header::

.. image:: images/company-logo.png


.. footer::

"How to use Hovercraft", Yern Busfern, ImaginaryCon 2017

The header will be located in the resulting HTML before the first slide, and
the footer will be located after the last slide. However, they will be
displayed statically on every slide, and you will have to position them with
CSS.

It doesn't matter where in the presentation you add these commands, I would
recommend that you add them before the first slide.


Styling a specific slide
........................

Expand Down
24 changes: 20 additions & 4 deletions hovercraft/templates/default/template.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,13 @@ xmlns="http://www.w3.org/1999/xhtml">
<body class="impress-not-supported">

<xsl:for-each select="/document">

<xsl:for-each select="decoration/header">
<div class="header">
<xsl:apply-templates />
</div>
</xsl:for-each>

<div id="impress">
<xsl:if test="@data-perspective">
<xsl:attribute name="data-perspective">
Expand All @@ -84,18 +91,27 @@ xmlns="http://www.w3.org/1999/xhtml">
<xsl:value-of select="@auto-console" />
</xsl:attribute>
</xsl:if>

<xsl:for-each select="step">
<div class="step">
<xsl:copy-of select="@*"/>
<xsl:apply-templates />
</div>
</xsl:for-each>
</div>
</xsl:for-each>
<xsl:if test="/document/@slide-numbers">
<div id="slide-number" class="slide-number">
1

<xsl:for-each select="decoration/footer">
<div class="footer">
<xsl:apply-templates />
</div>
</xsl:for-each>

</xsl:for-each>

<xsl:if test="/document/@slide-numbers">
<div id="slide-number" class="slide-number">
1
</div>
</xsl:if>

<div id="hovercraft-help">
Expand Down

0 comments on commit 6ae1b1c

Please sign in to comment.