1 <?xml version="1.0" encoding="utf-8"?>
4 # This file is part of Librarian.
6 # Copyright © 2008,2009,2010 Fundacja Nowoczesna Polska <fundacja@nowoczesnapolska.org.pl>
8 # For full list of contributors see AUTHORS file.
10 # This program is free software: you can redistribute it and/or modify
11 # it under the terms of the GNU Affero General Public License as published by
12 # the Free Software Foundation, either version 3 of the License, or
13 # (at your option) any later version.
15 # This program is distributed in the hope that it will be useful,
16 # but WITHOUT ANY WARRANTY; without even the implied warranty of
17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 # GNU Affero General Public License for more details.
20 # You should have received a copy of the GNU Affero General Public License
21 # along with this program. If not, see <http://www.gnu.org/licenses/>.
24 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
25 xmlns:wl="http://wolnelektury.pl/functions" >
27 <xsl:output encoding="utf-8" indent="yes" omit-xml-declaration = "yes" version="2.0" />
28 <xsl:template match="utwor">
31 <title>Książka z serwisu WolneLektury.pl</title>
32 <meta http-equiv="content-type" content="text/html;charset=utf-8"/>
37 font: Georgia, "Times New Roman", serif;
44 text-decoration: none;
52 /* ================================== */
53 /* = Header with logo and menu = */
54 /* ================================== */
56 margin: 3.4em 0 0 1.4em;
91 #menu li a:hover, #menu li a:active {
93 background: #FFF url(/media/img/arrow-down.png) no-repeat center right;
98 background: #FFF url(/media/img/arrow-up.png) no-repeat center right;
108 border-bottom: 0.25em solid #DDD;
109 border-right: 0.25em solid #DDD;
117 #toc ol, #themes ol {
128 padding: 0 0 1.5em 1.5em;
148 /* =================================================== */
149 /* = Common elements: headings, paragraphs and lines = */
150 /* =================================================== */
183 /* ======================== */
184 /* = Footnotes and themes = */
185 /* ======================== */
187 border-left: 0.1em solid #DDDDDD;
195 margin-right: -9.5em;
208 #footnotes .annotation {
233 margin: -0.25em -0.5em;
239 padding: 0.25em 0.5em;
243 .anchor:hover, #book-text .anchor:active {
245 background-color: #CCC;
248 /* =================== */
249 /* = Custom elements = */
250 /* =================== */
255 margin-bottom: 0.25em;
262 margin-bottom: -0.25em;
274 margin: 0.5em 0 0 1.5em;
285 div.kwestia div.stanza {
306 border-bottom: 0.1em solid #999;
307 padding-bottom: 1.5em;
310 div.note p, div.dedication p, div.note p.paragraph, div.dedication p.paragraph {
323 border-bottom: 0.1em solid #000;
334 padding: 0 0 0 1.5em;
341 em.math, em.foreign-word, em.book-title, em.didaskalia {
346 letter-spacing: 0.1em;
351 font-variant: small-caps;
356 <xsl:apply-templates select="powiesc|opowiadanie|liryka_l|liryka_lp|dramat_wierszowany_l|dramat_wierszowany_lp|dramat_wspolczesny" />
357 <xsl:if test="count(descendant::*[self::pe or self::pa or self::pr or self::pt][not(parent::extra)])">
360 <xsl:for-each select="descendant::*[self::pe or self::pa or self::pr or self::pt][not(parent::extra)]">
362 <a name="{concat('footnote-', generate-id(.))}" />
363 <a href="{concat('#anchor-', generate-id(.))}" class="annotation">[<xsl:number value="count(preceding::*[self::pa or self::pe or self::pr or self::pt]) + 1" />]</a>
365 <xsl:when test="count(akap|akap_cd|strofa) = 0">
366 <p><xsl:apply-templates select="text()|*" mode="inline" /></p>
369 <xsl:apply-templates select="text()|*" mode="inline" />
382 <!-- ============================================================================== -->
383 <!-- = MASTER TAG = -->
384 <!-- = (can contain block tags, paragraph tags, standalone tags and special tags) = -->
385 <!-- ============================================================================== -->
386 <xsl:template match="powiesc|opowiadanie|liryka_l|liryka_lp|dramat_wierszowany_l|dramat_wierszowany_lp|dramat_wspolczesny">
387 <xsl:if test="nazwa_utworu">
389 <xsl:apply-templates select="autor_utworu|dzielo_nadrzedne|nazwa_utworu|podtytul" mode="header" />
392 <xsl:apply-templates />
396 <!-- ==================================================================================== -->
397 <!-- = BLOCK TAGS = -->
398 <!-- = (can contain other block tags, paragraph tags, standalone tags and special tags) = -->
399 <!-- ==================================================================================== -->
400 <xsl:template match="nota">
401 <div class="note"><xsl:apply-templates /></div>
404 <xsl:template match="lista_osob">
405 <div class="person-list">
406 <h3><xsl:value-of select="naglowek_listy" /></h3>
408 <xsl:apply-templates select="lista_osoba" />
413 <xsl:template match="dedykacja">
414 <div class="dedication"><xsl:apply-templates /></div>
417 <xsl:template match="kwestia">
418 <div class="kwestia">
419 <xsl:apply-templates select="strofa|akap|didaskalia" />
423 <xsl:template match="dlugi_cytat|poezja_cyt">
424 <blockquote><xsl:apply-templates /></blockquote>
427 <xsl:template match="motto">
428 <div class="motto"><xsl:apply-templates mode="inline" /></div>
432 <!-- ========================================== -->
433 <!-- = PARAGRAPH TAGS = -->
434 <!-- = (can contain inline and special tags) = -->
435 <!-- ========================================== -->
437 <xsl:template match="autor_utworu" mode="header">
438 <span class="author editable"><xsl:apply-templates mode="inline" /></span>
441 <xsl:template match="nazwa_utworu" mode="header">
442 <span class="title editable"><xsl:apply-templates mode="inline" /></span>
445 <xsl:template match="dzielo_nadrzedne" mode="header">
446 <span class="collection"><xsl:apply-templates mode="inline" /></span>
449 <xsl:template match="podtytul" mode="header">
450 <span class="subtitle"><xsl:apply-templates mode="inline" /></span>
453 <!-- Section headers (included in index)-->
454 <xsl:template match="naglowek_akt|naglowek_czesc|srodtytul">
455 <h2><xsl:apply-templates mode="inline" /></h2>
458 <xsl:template match="naglowek_scena|naglowek_rozdzial">
459 <h3><xsl:apply-templates mode="inline" /></h3>
462 <xsl:template match="naglowek_osoba|naglowek_podrozdzial">
463 <h4><xsl:apply-templates mode="inline" /></h4>
466 <!-- Other paragraph tags -->
467 <xsl:template match="miejsce_czas">
468 <p class="place-and-time"><xsl:apply-templates mode="inline" /></p>
471 <xsl:template match="didaskalia">
472 <div class="didaskalia"><xsl:apply-templates mode="inline" /></div>
475 <xsl:template match="lista_osoba">
476 <li><xsl:apply-templates mode="inline" /></li>
479 <xsl:template match="akap|akap_dialog|akap_cd">
480 <p class="paragraph editable"><xsl:apply-templates mode="inline" /></p>
483 <xsl:template match="strofa">
484 <div class="stanza editable">
486 <xsl:when test="count(br) > 0">
487 <xsl:call-template name="verse">
488 <xsl:with-param name="verse-content" select="br[1]/preceding-sibling::text() | br[1]/preceding-sibling::node()" />
489 <xsl:with-param name="verse-type" select="br[1]/preceding-sibling::*[name() = 'wers_wciety' or name() = 'wers_akap' or name() = 'wers_cd'][1]" />
491 <xsl:for-each select="br">
492 <!-- Each BR tag "consumes" text after it -->
493 <xsl:variable name="lnum" select="count(preceding-sibling::br)" />
494 <xsl:call-template name="verse">
495 <xsl:with-param name="verse-content"
496 select="following-sibling::text()[count(preceding-sibling::br) = $lnum+1] | following-sibling::node()[count(preceding-sibling::br) = $lnum+1]" />
497 <xsl:with-param name="verse-type" select="following-sibling::*[count(preceding-sibling::br) = $lnum+1 and (name() = 'wers_wciety' or name() = 'wers_akap' or name() = 'wers_cd')][1]" />
502 <xsl:call-template name="verse">
503 <xsl:with-param name="verse-content" select="text() | node()" />
504 <xsl:with-param name="verse-type" select="wers_wciety|wers_akap|wers_cd[1]" />
511 <xsl:template name="verse">
512 <xsl:param name="verse-content" />
513 <xsl:param name="verse-type" />
516 <xsl:when test="name($verse-type) = 'wers_akap'">
517 <xsl:attribute name="style">padding-left: 1em</xsl:attribute>
519 <xsl:when test="name($verse-type) = 'wers_wciety'">
521 <xsl:when test="$verse-content/@typ">
522 <xsl:attribute name="style">padding-left: <xsl:value-of select="$verse-content/@typ" />em</xsl:attribute>
525 <xsl:attribute name="style">padding-left: 1em</xsl:attribute>
529 <xsl:when test="name($verse-type) = 'wers_cd'">
530 <xsl:attribute name="style">padding-left: 12em</xsl:attribute>
533 <xsl:apply-templates select="$verse-content" mode="inline" />
537 <xsl:template match="motto_podpis">
538 <p class="motto_podpis"><xsl:apply-templates mode="inline" /></p>
542 <!-- ================================================ -->
543 <!-- = INLINE TAGS = -->
544 <!-- = (contain other inline tags and special tags) = -->
545 <!-- ================================================ -->
547 <xsl:template match="pa|pe|pr|pt" mode="inline">
548 <a name="{concat('anchor-', generate-id(.))}" />
549 <a href="{concat('#footnote-', generate-id(.))}" class="annotation">[<xsl:number value="count(preceding::*[self::pa or self::pe or self::pr or self::pt]) + 1" />]</a>
552 <!-- Other inline tags -->
553 <xsl:template match="mat" mode="inline">
554 <em class="math"><xsl:apply-templates mode="inline" /></em>
557 <xsl:template match="didask_tekst" mode="inline">
558 <em class="didaskalia"><xsl:apply-templates mode="inline" /></em>
561 <xsl:template match="slowo_obce" mode="inline">
562 <em class="foreign-word"><xsl:apply-templates mode="inline" /></em>
565 <xsl:template match="tytul_dziela" mode="inline">
566 <em class="book-title">
567 <xsl:if test="@typ = '1'">„</xsl:if><xsl:apply-templates mode="inline" /><xsl:if test="@typ = '1'">”</xsl:if>
571 <xsl:template match="wyroznienie" mode="inline">
572 <em class="author-emphasis"><xsl:apply-templates mode="inline" /></em>
575 <xsl:template match="osoba" mode="inline">
576 <em class="person"><xsl:apply-templates mode="inline" /></em>
580 <!-- ============================================== -->
581 <!-- = STANDALONE TAGS = -->
582 <!-- = (cannot contain any other tags) = -->
583 <!-- ============================================== -->
584 <xsl:template match="sekcja_swiatlo">
585 <hr class="spacer" />
588 <xsl:template match="sekcja_asterysk">
589 <p class="spacer-asterisk">*</p>
592 <xsl:template match="separator_linia">
593 <hr class="spacer-line" />
597 <!-- ================ -->
598 <!-- = SPECIAL TAGS = -->
599 <!-- ================ -->
601 <xsl:template match="begin" mode="inline">
602 <xsl:variable name="mnum" select="concat('m', substring(@id, 2))" />
603 <a name="m{substring(@id, 2)}" class="theme-begin" fid="{substring(@id, 2)}">
604 <xsl:value-of select="string(following::motyw[@id=$mnum]/text())" />
608 <xsl:template match="end" mode="inline">
609 <span class="theme-end" fid="{substring(@id, 2)}"> </span>
612 <xsl:template match="begin|end">
613 <xsl:apply-templates select='.' mode="inline" />
616 <xsl:template match="motyw" mode="inline" />
619 <!-- ================ -->
620 <!-- = IGNORED TAGS = -->
621 <!-- ================ -->
622 <xsl:template match="extra|uwaga" />
623 <xsl:template match="extra|uwaga" mode="inline" />
629 <xsl:template match="text()" />
630 <xsl:template match="text()" mode="inline">
631 <xsl:value-of select="wl:substitute_entities(.)" />