Skip to content

Commit

Permalink
Adding callouts and updating oneoff files
Browse files Browse the repository at this point in the history
  • Loading branch information
vagrant committed Oct 23, 2014
1 parent 872b1b1 commit 736fdcc
Show file tree
Hide file tree
Showing 24 changed files with 87 additions and 0 deletions.
Binary file added callouts/1.pdf
Binary file not shown.
Binary file added callouts/1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added callouts/10.pdf
Binary file not shown.
Binary file added callouts/10.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added callouts/11.pdf
Binary file not shown.
Binary file added callouts/11.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added callouts/2.pdf
Binary file not shown.
Binary file added callouts/2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added callouts/3.pdf
Binary file not shown.
Binary file added callouts/3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added callouts/4.pdf
Binary file not shown.
Binary file added callouts/4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added callouts/5.pdf
Binary file not shown.
Binary file added callouts/5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added callouts/6.pdf
Binary file not shown.
Binary file added callouts/6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added callouts/7.pdf
Binary file not shown.
Binary file added callouts/7.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added callouts/8.pdf
Binary file not shown.
Binary file added callouts/8.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added callouts/9.pdf
Binary file not shown.
Binary file added callouts/9.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
35 changes: 35 additions & 0 deletions theme/pdf/pdf.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,43 @@
/*--------Put Your Custom CSS Rules Below--------*/
/*--- This oneoff overrides the code in https://github.com/oreillymedia/animal_theme/blob/master/pdf/pdf.css---*/

/* right align */

.alignmeright
{
text-align: right;
}

/* Font fall backs */
p
{
font-family: "MinionPro", "Symbola", "Arial Unicode MS", "DejaVu Sans", "Code2000";
}




table tbody tr td p
{
font-family: "MinionPro", "Symbola", "Arial Unicode MS", "DejaVu Sans", "Code2000";
}

pre[data-type="programlisting"]
{
font-family: "UbuntuMono", "Arial Unicode MS", "Code2000";
}
code
{
font-family: "UbuntuMono", "Arial Unicode MS", "DejaVu Sans", "Code2000";
}





/*----Uncomment to turn on automatic code wrapping
pre {
white-space: pre-wrap;
word-wrap: break-word;
Expand Down
52 changes: 52 additions & 0 deletions theme/pdf/pdf.xsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:h="http://www.w3.org/1999/xhtml"
xmlns="http://www.w3.org/1999/xhtml"
exclude-result-prefixes="h">

<!-- Do add border div for figure images in animal series -->
<xsl:param name="figure.border.div" select="1"/>

<xsl:template name="string-replace-all">
<xsl:param name="text"/>
<xsl:param name="replace"/>
<xsl:param name="by"/>
<xsl:choose>
<xsl:when test="contains($text, $replace)">
<xsl:value-of select="substring-before($text,$replace)"/>
<xsl:value-of select="$by"/>
<xsl:call-template name="string-replace-all">
<xsl:with-param name="text" select="substring-after($text,$replace)"/>
<xsl:with-param name="replace" select="$replace"/>
<xsl:with-param name="by" select="$by"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$text"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>

<xsl:template match="h:img/@src">
<xsl:choose>
<xsl:when test="contains(., 'callouts/')">
<xsl:variable name="newtext">
<xsl:call-template name="string-replace-all">
<xsl:with-param name="text" select="."/>
<xsl:with-param name="replace" select="'png'"/>
<xsl:with-param name="by" select="'pdf'"/>
</xsl:call-template>
</xsl:variable>
<xsl:attribute name="src">
<xsl:value-of select="$newtext"/>
</xsl:attribute>
</xsl:when>
<xsl:otherwise>
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:otherwise>
</xsl:choose>
</xsl:template>

</xsl:stylesheet>

0 comments on commit 736fdcc

Please sign in to comment.