Browse files

XSL: Add cover and watermark

  • Loading branch information...
1 parent d6b9593 commit 2f99338f0b5a9a57ad93f0b7e89d8a35f1ab06b0 @runpaint committed Oct 2, 2010
Showing with 38 additions and 8 deletions.
  1. BIN www/draft.png
  2. +38 −8 xsl/pdf.xsl
View
BIN www/draft.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
46 xsl/pdf.xsl
@@ -127,16 +127,11 @@ article > section > section > h1 {
font-weight: normal;
}
-article > section > section > section > h1 {
- font-size: 110%;
+section > section > section > h1 {
+ font-size: 130%;
font-weight: normal;
}
-article > section > section > section > section > h1 {
- font-size: 100%;
- font-weight: bold;
-}
-
table {
margin-left: auto;
margin-right: auto;
@@ -226,7 +221,7 @@ body {
font-style: normal;
font-size: large;
font-color: black;
- background-color: white;
+ background-color: transparent;
}
figcaption { display: none }
@@ -248,11 +243,42 @@ article {
border-top: solid black thin;
padding-top: 8pt;
}
+
+ @top-center {
+ content: 'Read Ruby 1.9 (DRAFT): http://ruby.runpaint.org/';
+ font-weight: bold;
+ }
+ @bottom-center {
+ content: counter(page);
+ font-style: italic;
+ }
+ background: url('../www/draft.png') no-repeat fixed center;
+}
+
+@page:first {
+ @top { content: normal }
+ @bottom-center { content: normal }
+}
+
+body > h1 {
+ font-size: 1000%;
+ text-transform: uppercase;
+ text-align: center;
+ line-height: 80%;
+ font-weight: bold;
+ margin: 0;
+ padding-bottom: 5%;
+}
+
+body > p {
+ text-align: center;
+ font-size: 150%;
}
.fn::footnote-marker:after {
content: ' - ';
}
+
</xsl:text>
</xsl:template>
@@ -269,12 +295,16 @@ article {
</xsl:call-template>
<title>Read Ruby 1.9</title>
<body>
+ <h1><xsl:value-of select="/d:book/d:title"/></h1>
+ <p>Free ebook about the Ruby 1.9 programming language</p>
+ <p><a href="http://ruby.runpaint.org/">ruby.runpaint.org</a></p>
<xsl:apply-templates/>
</body>
</html>
</xsl:document>
</xsl:template>
+ <xsl:template match="d:book/d:title"/>
<xsl:template match="d:sect1/d:title|d:sect2/d:title|d:sect3/d:title">
<h1><xsl:apply-templates/></h1>
</xsl:template>

0 comments on commit 2f99338

Please sign in to comment.