Originally written by Marek Stępniowski <marek@stepniowski>
Later contributions:
-
+
* Łukasz Rekucki <lrekucki@gmail.com>
* Radek Czajka <radek.czajka@gmail.com>
-
+
FNP Librarian
Copyright © 2010 Fundacja Nowoczesna Polska <fundacja@nowoczesnapolska.org.pl>
-
- For full list of contributors see AUTHORS file.
+
+ For full list of contributors see AUTHORS file.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
-------
![AGPL Logo](http://www.gnu.org/graphics/agplv3-155x51.png)
-
+
Copyright © 2008,2009,2010 Fundacja Nowoczesna Polska <fundacja@nowoczesnapolska.org.pl>
-
- For full list of contributors see AUTHORS section at the end.
+
+ For full list of contributors see AUTHORS section at the end.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
along with this program. If not, see <http://www.gnu.org/licenses/>.
-About
+About
------
-Librarian converts XML-based markup language used by FNP for writing books to
+Librarian converts XML-based markup language used by FNP for writing books to
other formats, which are more suitable for presentation.
Currently we support:
* Plain text
* EPUB (XHTML based)
* print-ready PDF
-
-Other features:
+
+Other features:
* extract DublinCore meta-data from documents;
* extract marked "themes" from documents.
300, 0
)
-def asbis_cover(author, title):
+def prestigio_cover(author, title):
return cover(author, u"„%s”" % title,
580, 783, '#fff', get_resource('res/cover-prestigio.png'),
446, 118, 62, 60, '#fff', ImageFont.truetype(get_resource('fonts/JunicodeWL-Italic.ttf'), 50), '#000',
# -*- coding: utf-8 -*-
#
# This file is part of Librarian, licensed under GNU Affero GPLv3 or later.
-# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
+# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
#
from __future__ import with_statement
"""
nt = node.text if node.text is not None else ''
- return ''.join([nt] + [etree.tostring(child) for child in node])
+ return ''.join([nt] + [etree.tostring(child) for child in node])
def set_inner_xml(node, text):
""" sets node's text and children from a string
os.chdir(os.path.join(os.path.dirname(os.path.realpath(__file__)), 'font-optimizer'))
for fname in 'DejaVuSerif.ttf', 'DejaVuSerif-Bold.ttf', 'DejaVuSerif-Italic.ttf', 'DejaVuSerif-BoldItalic.ttf':
- optimizer_call = ['perl', 'subset.pl', '--chars', ''.join(chars).encode('utf-8'),
+ optimizer_call = ['perl', 'subset.pl', '--chars', ''.join(chars).encode('utf-8'),
get_resource('fonts/' + fname), os.path.join(tmpdir, fname)]
if verbose:
print "Running font-optimizer"
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml">\r
- <head>\r
- <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />\r
- <title>WolneLektury.pl</title>\r
- </head>\r
- <body></body>\r
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
+ <title>WolneLektury.pl</title>
+ </head>
+ <body></body>
</html>
\ No newline at end of file
-@font-face {\r
- font-family: "DejaVu Serif";\r
- font-weight: normal;\r
- font-style: normal;\r
- src: url(DejaVuSerif.ttf);\r
-}\r
-@font-face {\r
- font-family: "DejaVu Serif";\r
- font-weight: bold;\r
- font-style: normal;\r
- src: url(DejaVuSerif-Bold.ttf);\r
-}\r
-@font-face {\r
- font-family: "DejaVu Serif";\r
- font-weight: normal;\r
- font-style: italic;\r
- src: url(DejaVuSerif-Italic.ttf);\r
-}\r
-@font-face {\r
- font-family: "DejaVu Serif";\r
- font-weight: bold;\r
- font-style: italic;\r
- src: url(DejaVuSerif-BoldItalic.ttf);\r
-}\r
-\r
-body, p, h1, h2, h3, h4 {\r
- font-family: "DejaVu Serif", serif;\r
-}\r
-\r
-\r
-body\r
-{\r
- line-height: 1.5em;\r
- margin: 0;\r
-}\r
-\r
-a\r
-{\r
- text-decoration: none;\r
- color: #00e;\r
-}\r
-\r
-a img {\r
- border: 0;\r
-}\r
-\r
-#book-text\r
-{\r
- margin: 2em;\r
- /*margin-right: 9em;*/\r
-}\r
-\r
-/* =================================================== */\r
-/* = Common elements: headings, paragraphs and lines = */\r
-/* =================================================== */\r
-\r
-\r
-.h2\r
-{\r
- font-size: 2em;\r
- margin: 0;\r
- margin-top: 1.5em;\r
- font-weight: bold;\r
- line-height: 1.5em;\r
-}\r
-\r
-.h3\r
-{\r
- text-align:left;\r
- font-size: 1.5em;\r
- margin-top: 1.5em;\r
- font-weight: normal;\r
- line-height: 1.5em;\r
-}\r
-\r
-.h4\r
-{\r
- font-size: 1em;\r
- margin: 0;\r
- margin-top: 1.5em;\r
- line-height: 1.5em;\r
-}\r
-\r
-p\r
-{\r
- margin: 0;\r
-}\r
-\r
-/* ======================== */\r
-/* = Footnotes and themes = */\r
-/* ======================== */\r
-\r
-.theme-begin\r
-{\r
- border-left: 0.1em solid #DDDDDD;\r
- color: #777;\r
- padding: 0 0.5em;\r
- width: 7.5em;\r
- font-style: normal;\r
- font-weight: normal;\r
- font-size: 0.875em;\r
- float: right;\r
- margin-right: -9.5em;\r
- clear: both;\r
- left: 40em;\r
- line-height: 1.5em;\r
- text-align: left;\r
-}\r
-\r
-.annotation\r
-{\r
- font-style: normal;\r
- font-weight: normal;\r
- font-size: 0.875em;\r
-}\r
-\r
-#footnotes .annotation\r
-{\r
- display: block;\r
- float: left;\r
- width: 2.5em;\r
- clear: both;\r
-}\r
-\r
-#footnotes div\r
-{\r
- margin: 0;\r
- margin-top: 1.5em;\r
-}\r
-\r
-#footnotes p\r
-{\r
- margin-left: 2.5em;\r
- font-size: 0.875em;\r
-}\r
-\r
-.block\r
-{\r
- font-size: 0.875em;\r
- padding: 1em;\r
-}\r
-\r
-/* ============= */\r
-/* = Numbering = */\r
-/* ============= */\r
-\r
-.anchor\r
-{\r
- margin: -0.25em -0.5em;\r
- color: #777;\r
- font-size: 0.875em;\r
- width: 2em;\r
- text-align: center;\r
- padding: 0.25em 0.5em;\r
- line-height: 1.5em;\r
-}\r
-\r
-/* =================== */\r
-/* = Custom elements = */\r
-/* =================== */\r
-\r
-.title-page\r
-{\r
- margin-top: 1.5em;\r
-}\r
-\r
-.title\r
-{\r
- font-size: 3em;\r
- text-align: center;\r
- line-height: 1.5em;\r
- font-weight: bold;\r
-}\r
-\r
-.author\r
-{\r
- margin: 0;\r
- text-align: center;\r
- font-weight: bold;\r
-\r
- font-size: 1.5em;\r
- line-height: 1.5em;\r
- margin-bottom: 0.25em;\r
-}\r
-\r
-.intitle\r
-{\r
- margin: 0;\r
- text-align: center;\r
- font-weight: bold;\r
-\r
- font-size: 1.5em;\r
- line-height: 1.5em;\r
- margin-bottom: 0.25em;\r
-}\r
-\r
-.insubtitle\r
-{\r
- margin: 0;\r
- text-align: center;\r
- font-weight: bold;\r
-\r
- font-size: 1em;\r
- line-height: 1.5em;\r
- margin-bottom: 0.25em;\r
-}\r
-\r
-.collection\r
-{\r
- margin: 0;\r
- text-align: center;\r
- font-weight: bold;\r
-\r
- font-size: 1.125em;\r
- line-height: 1.5em;\r
- margin-bottom: -0.25em;\r
-}\r
-\r
-.subtitle\r
-{\r
- margin: 0;\r
- text-align: center;\r
- font-weight: bold;\r
-\r
- font-size: 1.5em;\r
- line-height: 1.5em;\r
- margin-top: -0.25em;\r
-}\r
-\r
-div.didaskalia\r
-{\r
- font-style: italic;\r
- margin-top: 0.5em;\r
- margin-left: 1.5em;\r
-}\r
-\r
-div.kwestia\r
-{\r
- margin-top: 0.5em;\r
-}\r
-\r
-.paragraph\r
-{\r
- text-align: justify;\r
- margin-top: 1.5em;\r
-}\r
-\r
-.motto\r
-{\r
- text-align: justify;\r
- font-style: italic;\r
- margin-top: 1.5em;\r
-}\r
-\r
-.motto_podpis\r
-{\r
- font-size: 0.875em;\r
- text-align: right;\r
-}\r
-\r
-div.fragment\r
-{\r
- border-bottom: 0.1em solid #999;\r
- padding-bottom: 1.5em;\r
-}\r
-\r
-div.note\r
-{\r
- text-align: right;\r
- font-style: italic;\r
-}\r
-div.note div.paragraph\r
-{\r
- text-align: right;\r
- font-style: italic;\r
-}\r
-div.dedication\r
-{\r
- text-align: right;\r
- font-style: italic;\r
-}\r
-div.dedication div.paragaph\r
-{\r
- text-align: right;\r
- font-style: italic;\r
-}\r
-\r
-\r
-hr.spacer\r
-{\r
- height: 3em;\r
- visibility: hidden;\r
-}\r
-\r
-hr.spacer-line\r
-{\r
- margin: 0;\r
- margin-top: 1.5em;\r
- margin-bottom: 1.5em;\r
- border: none;\r
- border-bottom: 0.1em solid #000;\r
-}\r
-\r
-.spacer-asterisk\r
-{\r
- padding: 0;\r
- margin: 0;\r
- margin-top: 1.5em;\r
- margin-bottom: 1.5em;\r
- text-align: center;\r
-}\r
-\r
-div.person-list ol\r
-{\r
- list-style: none;\r
- padding: 0;\r
- padding-left: 1.5em;\r
-}\r
-\r
-.place-and-time\r
-{\r
- font-style: italic;\r
-}\r
-\r
-em.math\r
-{\r
- font-style: italic;\r
-}\r
-em.foreign-word\r
-{\r
- font-style: italic;\r
-}\r
-em.book-title\r
-{\r
- font-style: italic;\r
-}\r
-em.didaskalia\r
-{\r
- font-style: italic;\r
-}\r
-\r
-em.author-emphasis\r
-{\r
- letter-spacing: 0.1em;\r
-}\r
-\r
-.person-list em.person\r
-{\r
- font-style: normal;\r
- /*font-variant: small-caps;*/\r
- text-transform: uppercase;\r
-}\r
-\r
-p.info\r
-{\r
- text-align: center;\r
- margin-bottom: 1em;\r
-}\r
-\r
-p.info img\r
-{\r
- margin: 0;\r
- margin-left: 2em;\r
- margin-right: 2em;\r
-}\r
-\r
-p.minor {\r
- font-size: 0.75em;\r
-}\r
-p.footer {\r
- margin-top: 2em;\r
-}\r
+@font-face {
+ font-family: "DejaVu Serif";
+ font-weight: normal;
+ font-style: normal;
+ src: url(DejaVuSerif.ttf);
+}
+@font-face {
+ font-family: "DejaVu Serif";
+ font-weight: bold;
+ font-style: normal;
+ src: url(DejaVuSerif-Bold.ttf);
+}
+@font-face {
+ font-family: "DejaVu Serif";
+ font-weight: normal;
+ font-style: italic;
+ src: url(DejaVuSerif-Italic.ttf);
+}
+@font-face {
+ font-family: "DejaVu Serif";
+ font-weight: bold;
+ font-style: italic;
+ src: url(DejaVuSerif-BoldItalic.ttf);
+}
+
+body, p, h1, h2, h3, h4 {
+ font-family: "DejaVu Serif", serif;
+}
+
+
+body
+{
+ line-height: 1.5em;
+ margin: 0;
+}
+
+a
+{
+ text-decoration: none;
+ color: #00e;
+}
+
+a img {
+ border: 0;
+}
+
+#book-text
+{
+ margin: 2em;
+ /*margin-right: 9em;*/
+}
+
+/* =================================================== */
+/* = Common elements: headings, paragraphs and lines = */
+/* =================================================== */
+
+
+.h2
+{
+ font-size: 2em;
+ margin: 0;
+ margin-top: 1.5em;
+ font-weight: bold;
+ line-height: 1.5em;
+}
+
+.h3
+{
+ text-align:left;
+ font-size: 1.5em;
+ margin-top: 1.5em;
+ font-weight: normal;
+ line-height: 1.5em;
+}
+
+.h4
+{
+ font-size: 1em;
+ margin: 0;
+ margin-top: 1.5em;
+ line-height: 1.5em;
+}
+
+p
+{
+ margin: 0;
+}
+
+/* ======================== */
+/* = Footnotes and themes = */
+/* ======================== */
+
+.theme-begin
+{
+ border-left: 0.1em solid #DDDDDD;
+ color: #777;
+ padding: 0 0.5em;
+ width: 7.5em;
+ font-style: normal;
+ font-weight: normal;
+ font-size: 0.875em;
+ float: right;
+ margin-right: -9.5em;
+ clear: both;
+ left: 40em;
+ line-height: 1.5em;
+ text-align: left;
+}
+
+.annotation
+{
+ font-style: normal;
+ font-weight: normal;
+ font-size: 0.875em;
+}
+
+#footnotes .annotation
+{
+ display: block;
+ float: left;
+ width: 2.5em;
+ clear: both;
+}
+
+#footnotes div
+{
+ margin: 0;
+ margin-top: 1.5em;
+}
+
+#footnotes p
+{
+ margin-left: 2.5em;
+ font-size: 0.875em;
+}
+
+.block
+{
+ font-size: 0.875em;
+ padding: 1em;
+}
+
+/* ============= */
+/* = Numbering = */
+/* ============= */
+
+.anchor
+{
+ margin: -0.25em -0.5em;
+ color: #777;
+ font-size: 0.875em;
+ width: 2em;
+ text-align: center;
+ padding: 0.25em 0.5em;
+ line-height: 1.5em;
+}
+
+/* =================== */
+/* = Custom elements = */
+/* =================== */
+
+.title-page
+{
+ margin-top: 1.5em;
+}
+
+.title
+{
+ font-size: 3em;
+ text-align: center;
+ line-height: 1.5em;
+ font-weight: bold;
+}
+
+.author
+{
+ margin: 0;
+ text-align: center;
+ font-weight: bold;
+
+ font-size: 1.5em;
+ line-height: 1.5em;
+ margin-bottom: 0.25em;
+}
+
+.intitle
+{
+ margin: 0;
+ text-align: center;
+ font-weight: bold;
+
+ font-size: 1.5em;
+ line-height: 1.5em;
+ margin-bottom: 0.25em;
+}
+
+.insubtitle
+{
+ margin: 0;
+ text-align: center;
+ font-weight: bold;
+
+ font-size: 1em;
+ line-height: 1.5em;
+ margin-bottom: 0.25em;
+}
+
+.collection
+{
+ margin: 0;
+ text-align: center;
+ font-weight: bold;
+
+ font-size: 1.125em;
+ line-height: 1.5em;
+ margin-bottom: -0.25em;
+}
+
+.subtitle
+{
+ margin: 0;
+ text-align: center;
+ font-weight: bold;
+
+ font-size: 1.5em;
+ line-height: 1.5em;
+ margin-top: -0.25em;
+}
+
+div.didaskalia
+{
+ font-style: italic;
+ margin-top: 0.5em;
+ margin-left: 1.5em;
+}
+
+div.kwestia
+{
+ margin-top: 0.5em;
+}
+
+.paragraph
+{
+ text-align: justify;
+ margin-top: 1.5em;
+}
+
+.motto
+{
+ text-align: justify;
+ font-style: italic;
+ margin-top: 1.5em;
+}
+
+.motto_podpis
+{
+ font-size: 0.875em;
+ text-align: right;
+}
+
+div.fragment
+{
+ border-bottom: 0.1em solid #999;
+ padding-bottom: 1.5em;
+}
+
+div.note
+{
+ text-align: right;
+ font-style: italic;
+}
+div.note div.paragraph
+{
+ text-align: right;
+ font-style: italic;
+}
+div.dedication
+{
+ text-align: right;
+ font-style: italic;
+}
+div.dedication div.paragaph
+{
+ text-align: right;
+ font-style: italic;
+}
+
+
+hr.spacer
+{
+ height: 3em;
+ visibility: hidden;
+}
+
+hr.spacer-line
+{
+ margin: 0;
+ margin-top: 1.5em;
+ margin-bottom: 1.5em;
+ border: none;
+ border-bottom: 0.1em solid #000;
+}
+
+.spacer-asterisk
+{
+ padding: 0;
+ margin: 0;
+ margin-top: 1.5em;
+ margin-bottom: 1.5em;
+ text-align: center;
+}
+
+div.person-list ol
+{
+ list-style: none;
+ padding: 0;
+ padding-left: 1.5em;
+}
+
+.place-and-time
+{
+ font-style: italic;
+}
+
+em.math
+{
+ font-style: italic;
+}
+em.foreign-word
+{
+ font-style: italic;
+}
+em.book-title
+{
+ font-style: italic;
+}
+em.didaskalia
+{
+ font-style: italic;
+}
+
+em.author-emphasis
+{
+ letter-spacing: 0.1em;
+}
+
+.person-list em.person
+{
+ font-style: normal;
+ /*font-variant: small-caps;*/
+ text-transform: uppercase;
+}
+
+p.info
+{
+ text-align: center;
+ margin-bottom: 1em;
+}
+
+p.info img
+{
+ margin: 0;
+ margin-left: 2em;
+ margin-right: 2em;
+}
+
+p.minor {
+ font-size: 0.75em;
+}
+p.footer {
+ margin-top: 2em;
+}
-<?xml version="1.0" encoding="UTF-8"?>\r
-<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">\r
- <xsl:output method="html" version="1.0" encoding="utf-8" />\r
- <xsl:output doctype-system="http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd" />\r
- <xsl:output doctype-public="-//W3C//DTD XHTML 1.1//EN" />\r
-\r
- <xsl:template match="/">\r
- <html xmlns="http://www.w3.org/1999/xhtml">\r
- <head>\r
- <link rel="stylesheet" href="style.css" type="text/css" />\r
- <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />\r
- <title>\r
- <xsl:text>Przypisy</xsl:text>\r
- </title>\r
- </head>\r
- <body>\r
- <div id="book-text" xmlns="http://www.w3.org/1999/xhtml">\r
- <div id="footnotes" xmlns="http://www.w3.org/1999/xhtml">\r
- <h2 xmlns="http://www.w3.org/1999/xhtml">\r
- Przypisy:\r
- </h2>\r
- <xsl:apply-templates mode="przypis" />\r
- </div>\r
- </div>\r
- </body>\r
- </html>\r
- </xsl:template>\r
-\r
- <xsl:template match="text()" >\r
- <xsl:value-of select="." disable-output-escaping="yes"/>\r
- </xsl:template>\r
-\r
- <xsl:template match="pa|pe|pr|pt" mode="przypis">\r
- <div xmlns="http://www.w3.org/1999/xhtml">\r
- <p id="annotation-{@number}" xmlns="http://www.w3.org/1999/xhtml"></p>\r
- <a class="annotation" href="part{@part}.html#anchor-{@number}" xmlns="http://www.w3.org/1999/xhtml">\r
- [<xsl:value-of select="@number" />]\r
- </a>\r
- <p xmlns="http://www.w3.org/1999/xhtml">\r
- <xsl:apply-templates />\r
- </p>\r
- </div>\r
- </xsl:template>\r
-\r
- <xsl:template match="slowo_obce">\r
- <em class="foreign-word" xmlns="http://www.w3.org/1999/xhtml">\r
- <xsl:apply-templates select="text()" />\r
- </em>\r
- </xsl:template>\r
-\r
- <xsl:template match="akap|akap_cd">\r
- <p class="paragraph" xmlns="http://www.w3.org/1999/xhtml">\r
- <xsl:apply-templates />\r
- </p>\r
- </xsl:template>\r
-\r
- <xsl:template match="strofa">\r
- <div class="stanza" xmlns="http://www.w3.org/1999/xhtml">\r
- <xsl:apply-templates />\r
- </div>\r
- </xsl:template>\r
-\r
- <xsl:template match="tytul_dziela" >\r
- <em class="book-title" xmlns="http://www.w3.org/1999/xhtml">\r
- <xsl:if test="@typ = '1'" >„</xsl:if>\r
- <xsl:apply-templates />\r
- <xsl:if test="@typ = '1'">”</xsl:if>\r
- </em>\r
- </xsl:template>\r
-\r
- <xsl:template match="wers_normalny">\r
- <p class="verse" xmlns="http://www.w3.org/1999/xhtml">\r
- <xsl:apply-templates />\r
- </p>\r
- </xsl:template>\r
-\r
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+ <xsl:output method="html" version="1.0" encoding="utf-8" />
+ <xsl:output doctype-system="http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd" />
+ <xsl:output doctype-public="-//W3C//DTD XHTML 1.1//EN" />
+
+ <xsl:template match="/">
+ <html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <link rel="stylesheet" href="style.css" type="text/css" />
+ <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
+ <title>
+ <xsl:text>Przypisy</xsl:text>
+ </title>
+ </head>
+ <body>
+ <div id="book-text" xmlns="http://www.w3.org/1999/xhtml">
+ <div id="footnotes" xmlns="http://www.w3.org/1999/xhtml">
+ <h2 xmlns="http://www.w3.org/1999/xhtml">
+ Przypisy:
+ </h2>
+ <xsl:apply-templates mode="przypis" />
+ </div>
+ </div>
+ </body>
+ </html>
+ </xsl:template>
+
+ <xsl:template match="text()" >
+ <xsl:value-of select="." disable-output-escaping="yes"/>
+ </xsl:template>
+
+ <xsl:template match="pa|pe|pr|pt" mode="przypis">
+ <div xmlns="http://www.w3.org/1999/xhtml">
+ <p id="annotation-{@number}" xmlns="http://www.w3.org/1999/xhtml"></p>
+ <a class="annotation" href="part{@part}.html#anchor-{@number}" xmlns="http://www.w3.org/1999/xhtml">
+ [<xsl:value-of select="@number" />]
+ </a>
+ <p xmlns="http://www.w3.org/1999/xhtml">
+ <xsl:apply-templates />
+ </p>
+ </div>
+ </xsl:template>
+
+ <xsl:template match="slowo_obce">
+ <em class="foreign-word" xmlns="http://www.w3.org/1999/xhtml">
+ <xsl:apply-templates select="text()" />
+ </em>
+ </xsl:template>
+
+ <xsl:template match="akap|akap_cd">
+ <p class="paragraph" xmlns="http://www.w3.org/1999/xhtml">
+ <xsl:apply-templates />
+ </p>
+ </xsl:template>
+
+ <xsl:template match="strofa">
+ <div class="stanza" xmlns="http://www.w3.org/1999/xhtml">
+ <xsl:apply-templates />
+ </div>
+ </xsl:template>
+
+ <xsl:template match="tytul_dziela" >
+ <em class="book-title" xmlns="http://www.w3.org/1999/xhtml">
+ <xsl:if test="@typ = '1'" >„</xsl:if>
+ <xsl:apply-templates />
+ <xsl:if test="@typ = '1'">”</xsl:if>
+ </em>
+ </xsl:template>
+
+ <xsl:template match="wers_normalny">
+ <p class="verse" xmlns="http://www.w3.org/1999/xhtml">
+ <xsl:apply-templates />
+ </p>
+ </xsl:template>
+
</xsl:stylesheet>
\ No newline at end of file
-<?xml version="1.0" encoding="UTF-8"?>\r
-<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:dc="http://purl.org/dc/elements/1.1/">\r
- <xsl:output method="html" version="1.0" encoding="utf-8" />\r
- <xsl:output doctype-system="http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd" />\r
- <xsl:output doctype-public="-//W3C//DTD XHTML 1.1//EN" />\r
-\r
- <xsl:template match="/">\r
- <html xmlns="http://www.w3.org/1999/xhtml">\r
- <head>\r
- <link rel="stylesheet" href="style.css" type="text/css" />\r
- <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />\r
- <title>\r
- <xsl:text>Strona tytułowa</xsl:text>\r
- </title>\r
- </head>\r
- <body>\r
- <div id="book-text" xmlns="http://www.w3.org/1999/xhtml">\r
- <div class='title-page'>\r
- <xsl:apply-templates select="//dc:title" mode="poczatek"/>\r
- </div>\r
- </div>\r
- </body>\r
- </html>\r
- </xsl:template>\r
-\r
- <xsl:template match="text()" >\r
- <xsl:value-of select="." disable-output-escaping="yes" />\r
- </xsl:template>\r
-\r
- <xsl:template match="node()" mode="poczatek">\r
- <xsl:value-of select="." />\r
- </xsl:template>\r
-\r
- <xsl:template match="dc:title" mode="poczatek" >\r
- <h1 class="title" xmlns="http://www.w3.org/1999/xhtml">\r
- <xsl:apply-templates />\r
- </h1>\r
- </xsl:template>\r
-\r
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <xsl:output method="html" version="1.0" encoding="utf-8" />
+ <xsl:output doctype-system="http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd" />
+ <xsl:output doctype-public="-//W3C//DTD XHTML 1.1//EN" />
+
+ <xsl:template match="/">
+ <html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <link rel="stylesheet" href="style.css" type="text/css" />
+ <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
+ <title>
+ <xsl:text>Strona tytułowa</xsl:text>
+ </title>
+ </head>
+ <body>
+ <div id="book-text" xmlns="http://www.w3.org/1999/xhtml">
+ <div class='title-page'>
+ <xsl:apply-templates select="//dc:title" mode="poczatek"/>
+ </div>
+ </div>
+ </body>
+ </html>
+ </xsl:template>
+
+ <xsl:template match="text()" >
+ <xsl:value-of select="." disable-output-escaping="yes" />
+ </xsl:template>
+
+ <xsl:template match="node()" mode="poczatek">
+ <xsl:value-of select="." />
+ </xsl:template>
+
+ <xsl:template match="dc:title" mode="poczatek" >
+ <h1 class="title" xmlns="http://www.w3.org/1999/xhtml">
+ <xsl:apply-templates />
+ </h1>
+ </xsl:template>
+
</xsl:stylesheet>
\ No newline at end of file
-<?xml version="1.0" encoding="UTF-8"?>\r
-<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:dc="http://purl.org/dc/elements/1.1/">\r
- <xsl:output method="html" version="1.0" omit-xml-declaration="no" />\r
-\r
- <xsl:template match="/">\r
- <package xmlns="http://www.idpf.org/2007/opf" unique-identifier="BookId" version="2.0">\r
- <metadata xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:opf="http://www.idpf.org/2007/opf">\r
- <xsl:apply-templates select="//dc:title" />\r
- <dc:language xsi:type="dcterms:RFC3066">\r
- <xsl:apply-templates select="//dc:language" />\r
- </dc:language>\r
- <dc:identifier id="BookId" opf:scheme="URI">\r
- <xsl:apply-templates select="//dc:identifier.url" />\r
- </dc:identifier>\r
- <dc:subject>\r
- <xsl:apply-templates select="//dc:identifier.url" />\r
- </dc:subject>\r
- <dc:creator>\r
- <xsl:apply-templates select="//dc:creator" />\r
- </dc:creator>\r
- <dc:publisher>\r
- <xsl:apply-templates select="//dc:publisher" />\r
- </dc:publisher>\r
- <dc:date xsi:type="dcterms:W3CDTF">\r
- <xsl:apply-templates select="//dc:date" />\r
- </dc:date>\r
- </metadata>\r
- <manifest>\r
- <item id="toc" href="toc.ncx" media-type="application/x-dtbncx+xml" />\r
- <item id="style" href="style.css" media-type="text/css" />\r
- <item id="titlePage" href="title.html" media-type="application/xhtml+xml" />\r
- <item id="logo_wolnelektury" href="logo_wolnelektury.png" media-type="image/png" />\r
- <item id="DejaVuSerif.ttf" href="DejaVuSerif.ttf" media-type="font/ttf" />\r
- <item id="DejaVuSerif-Bold.ttf" href="DejaVuSerif-Bold.ttf" media-type="font/ttf" />\r
- <item id="DejaVuSerif-BoldItalic.ttf" href="DejaVuSerif-BoldItalic.ttf" media-type="font/ttf" />\r
- <item id="DejaVuSerif-Italic.ttf" href="DejaVuSerif-Italic.ttf" media-type="font/ttf" />\r
- </manifest>\r
- <spine toc="toc">\r
- <itemref idref="titlePage" />\r
- </spine>\r
- </package>\r
- </xsl:template>\r
-\r
- <xsl:template match="dc:title" >\r
- <dc:title>\r
- <xsl:value-of select="." />\r
- </dc:title>\r
- </xsl:template>\r
-\r
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <xsl:output method="html" version="1.0" omit-xml-declaration="no" />
+
+ <xsl:template match="/">
+ <package xmlns="http://www.idpf.org/2007/opf" unique-identifier="BookId" version="2.0">
+ <metadata xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:opf="http://www.idpf.org/2007/opf">
+ <xsl:apply-templates select="//dc:title" />
+ <dc:language xsi:type="dcterms:RFC3066">
+ <xsl:apply-templates select="//dc:language" />
+ </dc:language>
+ <dc:identifier id="BookId" opf:scheme="URI">
+ <xsl:apply-templates select="//dc:identifier.url" />
+ </dc:identifier>
+ <dc:subject>
+ <xsl:apply-templates select="//dc:identifier.url" />
+ </dc:subject>
+ <dc:creator>
+ <xsl:apply-templates select="//dc:creator" />
+ </dc:creator>
+ <dc:publisher>
+ <xsl:apply-templates select="//dc:publisher" />
+ </dc:publisher>
+ <dc:date xsi:type="dcterms:W3CDTF">
+ <xsl:apply-templates select="//dc:date" />
+ </dc:date>
+ </metadata>
+ <manifest>
+ <item id="toc" href="toc.ncx" media-type="application/x-dtbncx+xml" />
+ <item id="style" href="style.css" media-type="text/css" />
+ <item id="titlePage" href="title.html" media-type="application/xhtml+xml" />
+ <item id="logo_wolnelektury" href="logo_wolnelektury.png" media-type="image/png" />
+ <item id="DejaVuSerif.ttf" href="DejaVuSerif.ttf" media-type="font/ttf" />
+ <item id="DejaVuSerif-Bold.ttf" href="DejaVuSerif-Bold.ttf" media-type="font/ttf" />
+ <item id="DejaVuSerif-BoldItalic.ttf" href="DejaVuSerif-BoldItalic.ttf" media-type="font/ttf" />
+ <item id="DejaVuSerif-Italic.ttf" href="DejaVuSerif-Italic.ttf" media-type="font/ttf" />
+ </manifest>
+ <spine toc="toc">
+ <itemref idref="titlePage" />
+ </spine>
+ </package>
+ </xsl:template>
+
+ <xsl:template match="dc:title" >
+ <dc:title>
+ <xsl:value-of select="." />
+ </dc:title>
+ </xsl:template>
+
</xsl:stylesheet>
\ No newline at end of file
-<?xml version="1.0" encoding="UTF-8"?>\r
-<xsl:stylesheet version="1.0"\r
- xmlns="http://www.w3.org/1999/xhtml"\r
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"\r
- xmlns:dc="http://purl.org/dc/elements/1.1/"\r
- xmlns:wl="http://wolnelektury.pl/functions"\r
- xmlns:date="http://exslt.org/dates-and-times">\r
- <xsl:output method="html" version="1.0" encoding="utf-8" />\r
- <xsl:output doctype-system="http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd" />\r
- <xsl:output doctype-public="-//W3C//DTD XHTML 1.1//EN" />\r
-\r
- <xsl:template match="/">\r
- <html>\r
- <head>\r
- <link rel="stylesheet" href="style.css" type="text/css" />\r
- <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />\r
- <title>\r
- <xsl:text>Strona redakcyjna</xsl:text>\r
- </title>\r
- </head>\r
- <body>\r
- <div id="book-text" >\r
- <p class="info">\r
- <xsl:choose>\r
- <xsl:when test="//dc:rights.license">\r
- Ten utwór jest udostepniony na licencji\r
- <a>\r
- <xsl:attribute name="href">\r
- <xsl:value-of select="//dc:rights.license" />\r
- </xsl:attribute>\r
- <xsl:value-of select="//dc:rights" />\r
- </a>\r
- </xsl:when>\r
- <xsl:otherwise>\r
- Ten utwór nie jest chroniony prawem autorskim i znajduje się w domenie\r
- publicznej, co oznacza że możesz go swobodnie wykorzystywać, publikować\r
- i rozpowszechniać. Jeśli utwór opatrzony jest dodatkowymi materiałami\r
- (przypisy, motywy literackie etc.), które podlegają prawu autorskiemu, to\r
- te dodatkowe materiały udostępnione są na licencji\r
- <a href="http://creativecommons.org/licenses/by-sa/3.0/">Creative Commons\r
- Uznanie Autorstwa – Na Tych Samych Warunkach 3.0 PL</a>.\r
- </xsl:otherwise>\r
- </xsl:choose>\r
- </p>\r
-\r
- <p class="info">Źródło: <a>\r
- <xsl:attribute name="href">\r
- <xsl:value-of select="//dc:identifier.url" />\r
- </xsl:attribute>\r
- <xsl:attribute name="title">\r
- <xsl:value-of select="wl:person_name(//dc:creator/text())" />, <xsl:value-of select="//dc:title" />\r
- </xsl:attribute>\r
- <xsl:value-of select="//dc:identifier.url" />\r
- </a></p>\r
-\r
- <xsl:if test="//dc:source" >\r
- <p class="info">Tekst opracowany na podstawie: <xsl:value-of select="//dc:source" /></p>\r
- </xsl:if>\r
-\r
- <xsl:if test="//dc:description" >\r
- <p class="info"><xsl:value-of select="//dc:description" /></p>\r
- </xsl:if>\r
-\r
- <xsl:call-template name="editors" />\r
-\r
- <p class="info"> </p>\r
- <p class="minor info">\r
- Plik wygenerowany dnia <span id="file_date"><xsl:value-of select="substring(date:date(), 1, 10)" /></span>.\r
- </p>\r
-\r
- </div>\r
- </body>\r
- </html>\r
- </xsl:template>\r
-\r
- <xsl:template match="text()" >\r
- <xsl:value-of select="." disable-output-escaping="yes" />\r
- </xsl:template>\r
-\r
- <xsl:template name="editors">\r
- <xsl:if test="//dc:contributor.editor[text()]|//dc:contributor.technical_editor[text()]">\r
- <p class="info">\r
- <xsl:text>Opracowanie redakcyjne i przypisy: </xsl:text>\r
- <xsl:for-each select="//dc:contributor.editor[text()]|//dc:contributor.technical_editor[text() and not(//dc:contributor.editor/text()=text())]">\r
- <xsl:sort />\r
- <xsl:if test="position() != 1">, </xsl:if>\r
- <xsl:apply-templates mode="person" />\r
- </xsl:for-each>.\r
- </p>\r
- </xsl:if>\r
- </xsl:template>\r
-\r
- <xsl:template match="dc:contributor.editor|dc:contributor.technical_editor">\r
- <br /><xsl:apply-templates mode='person' />\r
- </xsl:template>\r
-\r
- <xsl:template match="text()" mode="person">\r
- <xsl:value-of select="wl:person_name(.)" />\r
- </xsl:template>\r
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet version="1.0"
+ xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:wl="http://wolnelektury.pl/functions"
+ xmlns:date="http://exslt.org/dates-and-times">
+ <xsl:output method="html" version="1.0" encoding="utf-8" />
+ <xsl:output doctype-system="http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd" />
+ <xsl:output doctype-public="-//W3C//DTD XHTML 1.1//EN" />
+
+ <xsl:template match="/">
+ <html>
+ <head>
+ <link rel="stylesheet" href="style.css" type="text/css" />
+ <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
+ <title>
+ <xsl:text>Strona redakcyjna</xsl:text>
+ </title>
+ </head>
+ <body>
+ <div id="book-text" >
+ <p class="info">
+ <xsl:choose>
+ <xsl:when test="//dc:rights.license">
+ Ten utwór jest udostepniony na licencji
+ <a>
+ <xsl:attribute name="href">
+ <xsl:value-of select="//dc:rights.license" />
+ </xsl:attribute>
+ <xsl:value-of select="//dc:rights" />
+ </a>
+ </xsl:when>
+ <xsl:otherwise>
+ Ten utwór nie jest chroniony prawem autorskim i znajduje się w domenie
+ publicznej, co oznacza że możesz go swobodnie wykorzystywać, publikować
+ i rozpowszechniać. Jeśli utwór opatrzony jest dodatkowymi materiałami
+ (przypisy, motywy literackie etc.), które podlegają prawu autorskiemu, to
+ te dodatkowe materiały udostępnione są na licencji
+ <a href="http://creativecommons.org/licenses/by-sa/3.0/">Creative Commons
+ Uznanie Autorstwa – Na Tych Samych Warunkach 3.0 PL</a>.
+ </xsl:otherwise>
+ </xsl:choose>
+ </p>
+
+ <p class="info">Źródło: <a>
+ <xsl:attribute name="href">
+ <xsl:value-of select="//dc:identifier.url" />
+ </xsl:attribute>
+ <xsl:attribute name="title">
+ <xsl:value-of select="wl:person_name(//dc:creator/text())" />, <xsl:value-of select="//dc:title" />
+ </xsl:attribute>
+ <xsl:value-of select="//dc:identifier.url" />
+ </a></p>
+
+ <xsl:if test="//dc:source" >
+ <p class="info">Tekst opracowany na podstawie: <xsl:value-of select="//dc:source" /></p>
+ </xsl:if>
+
+ <xsl:if test="//dc:description" >
+ <p class="info"><xsl:value-of select="//dc:description" /></p>
+ </xsl:if>
+
+ <xsl:call-template name="editors" />
+
+ <p class="info"> </p>
+ <p class="minor info">
+ Plik wygenerowany dnia <span id="file_date"><xsl:value-of select="substring(date:date(), 1, 10)" /></span>.
+ </p>
+
+ </div>
+ </body>
+ </html>
+ </xsl:template>
+
+ <xsl:template match="text()" >
+ <xsl:value-of select="." disable-output-escaping="yes" />
+ </xsl:template>
+
+ <xsl:template name="editors">
+ <xsl:if test="//dc:contributor.editor[text()]|//dc:contributor.technical_editor[text()]">
+ <p class="info">
+ <xsl:text>Opracowanie redakcyjne i przypisy: </xsl:text>
+ <xsl:for-each select="//dc:contributor.editor[text()]|//dc:contributor.technical_editor[text() and not(//dc:contributor.editor/text()=text())]">
+ <xsl:sort />
+ <xsl:if test="position() != 1">, </xsl:if>
+ <xsl:apply-templates mode="person" />
+ </xsl:for-each>.
+ </p>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template match="dc:contributor.editor|dc:contributor.technical_editor">
+ <br /><xsl:apply-templates mode='person' />
+ </xsl:template>
+
+ <xsl:template match="text()" mode="person">
+ <xsl:value-of select="wl:person_name(.)" />
+ </xsl:template>
</xsl:stylesheet>
\ No newline at end of file
-<?xml version="1.0" encoding="utf-8"?>\r
-<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">\r
- <xsl:output method="html" version="1.0" encoding="utf-8" />\r
- <xsl:output doctype-system="http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd" />\r
- <xsl:output doctype-public="-//W3C//DTD XHTML 1.1//EN" />\r
-\r
- <xsl:template match="/" >\r
- <xsl:element name="html" xmlns="http://www.w3.org/1999/xhtml">\r
- <xsl:element name="head">\r
- <link rel="stylesheet" href="style.css" type="text/css" />\r
- <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />\r
- <title>\r
- WolneLektury.pl\r
- </title>\r
- </xsl:element>\r
- <xsl:element name="body" xmlns="http://www.w3.org/1999/xhtml">\r
- <xsl:element name="div" xmlns="http://www.w3.org/1999/xhtml">\r
- <xsl:attribute name="id">book-text</xsl:attribute>\r
- <xsl:if test="//nazwa_utworu">\r
- <!--h1 xmlns="http://www.w3.org/1999/xhtml"-->\r
- <xsl:apply-templates select=" //nazwa_utworu" mode="poczatek"/>\r
- <xsl:apply-templates select=" //podtytul" mode="poczatek"/>\r
- <!--/h1-->\r
- </xsl:if>\r
- <xsl:apply-templates />\r
- </xsl:element>\r
- </xsl:element>\r
- </xsl:element>\r
- </xsl:template>\r
-\r
- <!--===========================================================-->\r
- <!-- Tagi BLOKOWE -->\r
- <!--===========================================================-->\r
-\r
- <xsl:template match="nota">\r
- <div class="note" xmlns="http://www.w3.org/1999/xhtml">\r
- <xsl:apply-templates />\r
- </div>\r
- </xsl:template>\r
-\r
- <xsl:template match="lista_osob" >\r
- <div class="person-list" xmlns="http://www.w3.org/1999/xhtml">\r
- <div class="h3" xmlns="http://www.w3.org/1999/xhtml">\r
- <xsl:apply-templates select="child::naglowek_listy" />\r
- </div>\r
- <ol xmlns="http://www.w3.org/1999/xhtml">\r
- <xsl:apply-templates select="lista_osoba" />\r
- </ol>\r
- </div>\r
- </xsl:template>\r
-\r
- <xsl:template match="dedykacja">\r
- <div class="dedication" xmlns="http://www.w3.org/1999/xhtml">\r
- <xsl:apply-templates />\r
- </div>\r
- </xsl:template>\r
-\r
- <xsl:template match="kwestia">\r
- <div class="kwestia" xmlns="http://www.w3.org/1999/xhtml">\r
- <xsl:apply-templates select="strofa|akapit|didaskalia|akap " />\r
- </div>\r
- </xsl:template>\r
-\r
- <xsl:template match="dlugi_cytat|poezja_cyt">\r
- <div class="block" xmlns="http://www.w3.org/1999/xhtml">\r
- <xsl:apply-templates />\r
- </div>\r
- </xsl:template>\r
-\r
- <xsl:template match="motto">\r
- <div class="motto" xmlns="http://www.w3.org/1999/xhtml">\r
- <xsl:apply-templates />\r
- </div>\r
- </xsl:template>\r
-\r
- <!--===========================================================-->\r
- <!-- Tagi PARAGRAFOWE -->\r
- <!--===========================================================-->\r
-\r
- <xsl:template match="autor_utworu" mode="poczatek">\r
- <h2 class="author" xmlns="http://www.w3.org/1999/xhtml">\r
- <xsl:apply-templates />\r
- </h2>\r
- </xsl:template>\r
-\r
- <xsl:template match="autor_utworu" />\r
-\r
- <xsl:template match="dzielo_nadrzedne" mode="poczatek">\r
- <h2 class="collection" xmlns="http://www.w3.org/1999/xhtml">\r
- <xsl:apply-templates />\r
- </h2>\r
- </xsl:template>\r
-\r
- <xsl:template match="dzielo_nadrzedne" />\r
-\r
- <xsl:template match="nazwa_utworu" mode="poczatek" >\r
- <h2 class="intitle" xmlns="http://www.w3.org/1999/xhtml">\r
- <xsl:apply-templates />\r
- </h2>\r
- </xsl:template>\r
-\r
- <xsl:template match="nazwa_utworu" />\r
-\r
- <xsl:template match="podtytul" mode="poczatek">\r
- <h2 class="insubtitle" xmlns="http://www.w3.org/1999/xhtml">\r
- <xsl:apply-templates />\r
- </h2>\r
- </xsl:template>\r
-\r
- <xsl:template match="podtytul" />\r
-\r
- <xsl:template match="naglowek_czesc|srodtytul">\r
- <h2 class="h2" xmlns="http://www.w3.org/1999/xhtml">\r
- <xsl:apply-templates />\r
- </h2>\r
- </xsl:template>\r
-\r
- <xsl:template match="naglowek_akt">\r
- <h2 class="h2" xmlns="http://www.w3.org/1999/xhtml">\r
- <xsl:apply-templates />\r
- </h2>\r
- </xsl:template>\r
-\r
- <xsl:template match="naglowek_scena">\r
- <a id="sub{@sub}" xmlns="http://www.w3.org/1999/xhtml"></a>\r
- <h2 class="h3" xmlns="http://www.w3.org/1999/xhtml">\r
- <xsl:apply-templates />\r
- </h2>\r
- </xsl:template>\r
-\r
- <xsl:template match="naglowek_podrozdzial">\r
- <a id="sub{@sub}" xmlns="http://www.w3.org/1999/xhtml"></a>\r
- <h2 class="h4" xmlns="http://www.w3.org/1999/xhtml">\r
- <xsl:apply-templates />\r
- </h2>\r
- </xsl:template>\r
-\r
- <xsl:template match="naglowek_rozdzial">\r
- <h2 class="h3" xmlns="http://www.w3.org/1999/xhtml">\r
- <xsl:apply-templates />\r
- </h2>\r
- </xsl:template>\r
-\r
- <xsl:template match="naglowek_osoba">\r
- <h2 class="h4" xmlns="http://www.w3.org/1999/xhtml">\r
- <xsl:apply-templates />\r
- </h2>\r
- </xsl:template>\r
-\r
- <xsl:template match="miejsce_czas">\r
- <div class="place-and-time" xmlns="http://www.w3.org/1999/xhtml">\r
- <xsl:apply-templates />\r
- </div>\r
- </xsl:template>\r
-\r
- <xsl:template match="didaskalia">\r
- <div class="didaskalia" xmlns="http://www.w3.org/1999/xhtml">\r
- <xsl:apply-templates />\r
- </div>\r
- </xsl:template>\r
-\r
- <xsl:template match="akap|akap_dialog|akap_cd">\r
- <p class="paragraph" xmlns="http://www.w3.org/1999/xhtml">\r
- <xsl:apply-templates />\r
- </p>\r
- </xsl:template>\r
-\r
- <xsl:template match="strofa">\r
- <div class="stanza" xmlns="http://www.w3.org/1999/xhtml">\r
- <xsl:apply-templates />\r
- </div><div xmlns="http://www.w3.org/1999/xhtml"> </div>\r
- </xsl:template>\r
-\r
- <xsl:template match="wers_normalny">\r
- <div class="verse" xmlns="http://www.w3.org/1999/xhtml">\r
- <xsl:apply-templates />\r
-  </div>\r
- </xsl:template>\r
-\r
- <xsl:template match="wers_akap">\r
- <div class="verse" style="margin-left: 1em;" xmlns="http://www.w3.org/1999/xhtml">\r
- <xsl:apply-templates />\r
-  </div>\r
- </xsl:template>\r
-\r
- <xsl:template match="wers_wciety">\r
- <div class="verse" style='margin-left:1em;' xmlns="http://www.w3.org/1999/xhtml">\r
- <xsl:apply-templates />\r
-  </div>\r
- </xsl:template>\r
-\r
- <xsl:template match="wers_wciety[@typ!='']">\r
- <div class="verse" xmlns="http://www.w3.org/1999/xhtml">\r
- <xsl:attribute name="style">\r
- margin-left: <xsl:value-of select="@typ" />em;\r
- </xsl:attribute>\r
- <xsl:apply-templates />\r
-  </div>\r
- </xsl:template>\r
-\r
- <xsl:template match="wers_cd">\r
- <div class="verse" style="margin-left: 12em;" xmlns="http://www.w3.org/1999/xhtml">\r
- <xsl:apply-templates />\r
-  </div>\r
- </xsl:template>\r
-\r
- <xsl:template match="motto_podpis">\r
- <div class="motto_podpis" xmlns="http://www.w3.org/1999/xhtml">\r
- <xsl:apply-templates />\r
- </div>\r
- </xsl:template>\r
-\r
- <!--===========================================================-->\r
- <!-- Tagi LINIOWE -->\r
- <!--===========================================================-->\r
-\r
- <xsl:template match="slowo_obce">\r
- <em class="foreign-word" xmlns="http://www.w3.org/1999/xhtml">\r
- <xsl:apply-templates />\r
- </em>\r
- </xsl:template>\r
-\r
- <xsl:template match="mat" >\r
- <em class="math" xmlns="http://www.w3.org/1999/xhtml">\r
- <xsl:apply-templates />\r
- </em>\r
- </xsl:template>\r
-\r
- <xsl:template match="didask_tekst" >\r
- <em class="didaskalia" xmlns="http://www.w3.org/1999/xhtml">\r
- <xsl:apply-templates />\r
- </em>\r
- </xsl:template>\r
-\r
- <xsl:template match="tytul_dziela" >\r
- <em class="book-title" xmlns="http://www.w3.org/1999/xhtml">\r
- <xsl:if test="@typ = '1'" >„</xsl:if>\r
- <xsl:apply-templates />\r
- <xsl:if test="@typ = '1'">”</xsl:if>\r
- </em>\r
- </xsl:template>\r
-\r
- <xsl:template match="wyroznienie" >\r
- <em class="author-emphasis" xmlns="http://www.w3.org/1999/xhtml">\r
- <xsl:apply-templates />\r
- </em>\r
- </xsl:template>\r
-\r
- <xsl:template match="osoba" >\r
- <em class="person" xmlns="http://www.w3.org/1999/xhtml">\r
- <xsl:apply-templates />\r
- </em>\r
- </xsl:template>\r
-\r
- <xsl:template match="naglowek_listy" >\r
- <xsl:apply-templates />\r
- </xsl:template>\r
-\r
- <xsl:template match="lista_osoba" >\r
- <li xmlns="http://www.w3.org/1999/xhtml">\r
- <xsl:apply-templates />\r
- </li>\r
- </xsl:template>\r
-\r
- <!--===========================================================-->\r
- <!-- Tagi STANDALONE -->\r
- <!--===========================================================-->\r
-\r
- <xsl:template match="sekcja_swiatlo">\r
- <p class="spacer" xmlns="http://www.w3.org/1999/xhtml"> </p>\r
- </xsl:template>\r
-\r
- <xsl:template match="sekcja_asterysk">\r
- <p class="spacer-asterisk" xmlns="http://www.w3.org/1999/xhtml">*</p>\r
- </xsl:template>\r
-\r
- <xsl:template match="separator_linia">\r
- <hr class="spacer-line" xmlns="http://www.w3.org/1999/xhtml"></hr>\r
- </xsl:template>\r
-\r
- <!--===========================================================-->\r
- <!-- Tagi SPECJALNE -->\r
- <!--===========================================================-->\r
-\r
- <xsl:template match="motyw" />\r
-\r
- <!--===========================================================-->\r
- <!-- Tagi IGNOROWANE -->\r
- <!--===========================================================-->\r
-\r
- <xsl:template match="extra" />\r
-\r
- <xsl:template match="pe|pa|pr|pt" >\r
- <a id="anchor-{.}" class="anchor" href="annotations.html#annotation-{.}" \r
- xmlns="http://www.w3.org/1999/xhtml">[<xsl:apply-templates />]</a>\r
- </xsl:template>\r
-\r
- <xsl:template match="uwaga" />\r
-\r
- <xsl:template match="nota_red" />\r
-\r
- <!--pominięcie tych metadanych-->\r
- <xsl:template match="rdf:RDF" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" />\r
-\r
- <!--===========================================================-->\r
- <!-- Tagi TEKSTOWE -->\r
- <!--===========================================================-->\r
-\r
- <xsl:template match="text()" >\r
- <xsl:value-of select="." disable-output-escaping="yes"/>\r
- </xsl:template>\r
-\r
- <xsl:template match="text()" >\r
- <xsl:value-of select="." disable-output-escaping="yes"/>\r
- </xsl:template>\r
-\r
+<?xml version="1.0" encoding="utf-8"?>
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+ <xsl:output method="html" version="1.0" encoding="utf-8" />
+ <xsl:output doctype-system="http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd" />
+ <xsl:output doctype-public="-//W3C//DTD XHTML 1.1//EN" />
+
+ <xsl:template match="/" >
+ <xsl:element name="html" xmlns="http://www.w3.org/1999/xhtml">
+ <xsl:element name="head">
+ <link rel="stylesheet" href="style.css" type="text/css" />
+ <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
+ <title>
+ WolneLektury.pl
+ </title>
+ </xsl:element>
+ <xsl:element name="body" xmlns="http://www.w3.org/1999/xhtml">
+ <xsl:element name="div" xmlns="http://www.w3.org/1999/xhtml">
+ <xsl:attribute name="id">book-text</xsl:attribute>
+ <xsl:if test="//nazwa_utworu">
+ <!--h1 xmlns="http://www.w3.org/1999/xhtml"-->
+ <xsl:apply-templates select=" //nazwa_utworu" mode="poczatek"/>
+ <xsl:apply-templates select=" //podtytul" mode="poczatek"/>
+ <!--/h1-->
+ </xsl:if>
+ <xsl:apply-templates />
+ </xsl:element>
+ </xsl:element>
+ </xsl:element>
+ </xsl:template>
+
+ <!--===========================================================-->
+ <!-- Tagi BLOKOWE -->
+ <!--===========================================================-->
+
+ <xsl:template match="nota">
+ <div class="note" xmlns="http://www.w3.org/1999/xhtml">
+ <xsl:apply-templates />
+ </div>
+ </xsl:template>
+
+ <xsl:template match="lista_osob" >
+ <div class="person-list" xmlns="http://www.w3.org/1999/xhtml">
+ <div class="h3" xmlns="http://www.w3.org/1999/xhtml">
+ <xsl:apply-templates select="child::naglowek_listy" />
+ </div>
+ <ol xmlns="http://www.w3.org/1999/xhtml">
+ <xsl:apply-templates select="lista_osoba" />
+ </ol>
+ </div>
+ </xsl:template>
+
+ <xsl:template match="dedykacja">
+ <div class="dedication" xmlns="http://www.w3.org/1999/xhtml">
+ <xsl:apply-templates />
+ </div>
+ </xsl:template>
+
+ <xsl:template match="kwestia">
+ <div class="kwestia" xmlns="http://www.w3.org/1999/xhtml">
+ <xsl:apply-templates select="strofa|akapit|didaskalia|akap " />
+ </div>
+ </xsl:template>
+
+ <xsl:template match="dlugi_cytat|poezja_cyt">
+ <div class="block" xmlns="http://www.w3.org/1999/xhtml">
+ <xsl:apply-templates />
+ </div>
+ </xsl:template>
+
+ <xsl:template match="motto">
+ <div class="motto" xmlns="http://www.w3.org/1999/xhtml">
+ <xsl:apply-templates />
+ </div>
+ </xsl:template>
+
+ <!--===========================================================-->
+ <!-- Tagi PARAGRAFOWE -->
+ <!--===========================================================-->
+
+ <xsl:template match="autor_utworu" mode="poczatek">
+ <h2 class="author" xmlns="http://www.w3.org/1999/xhtml">
+ <xsl:apply-templates />
+ </h2>
+ </xsl:template>
+
+ <xsl:template match="autor_utworu" />
+
+ <xsl:template match="dzielo_nadrzedne" mode="poczatek">
+ <h2 class="collection" xmlns="http://www.w3.org/1999/xhtml">
+ <xsl:apply-templates />
+ </h2>
+ </xsl:template>
+
+ <xsl:template match="dzielo_nadrzedne" />
+
+ <xsl:template match="nazwa_utworu" mode="poczatek" >
+ <h2 class="intitle" xmlns="http://www.w3.org/1999/xhtml">
+ <xsl:apply-templates />
+ </h2>
+ </xsl:template>
+
+ <xsl:template match="nazwa_utworu" />
+
+ <xsl:template match="podtytul" mode="poczatek">
+ <h2 class="insubtitle" xmlns="http://www.w3.org/1999/xhtml">
+ <xsl:apply-templates />
+ </h2>
+ </xsl:template>
+
+ <xsl:template match="podtytul" />
+
+ <xsl:template match="naglowek_czesc|srodtytul">
+ <h2 class="h2" xmlns="http://www.w3.org/1999/xhtml">
+ <xsl:apply-templates />
+ </h2>
+ </xsl:template>
+
+ <xsl:template match="naglowek_akt">
+ <h2 class="h2" xmlns="http://www.w3.org/1999/xhtml">
+ <xsl:apply-templates />
+ </h2>
+ </xsl:template>
+
+ <xsl:template match="naglowek_scena">
+ <a id="sub{@sub}" xmlns="http://www.w3.org/1999/xhtml"></a>
+ <h2 class="h3" xmlns="http://www.w3.org/1999/xhtml">
+ <xsl:apply-templates />
+ </h2>
+ </xsl:template>
+
+ <xsl:template match="naglowek_podrozdzial">
+ <a id="sub{@sub}" xmlns="http://www.w3.org/1999/xhtml"></a>
+ <h2 class="h4" xmlns="http://www.w3.org/1999/xhtml">
+ <xsl:apply-templates />
+ </h2>
+ </xsl:template>
+
+ <xsl:template match="naglowek_rozdzial">
+ <h2 class="h3" xmlns="http://www.w3.org/1999/xhtml">
+ <xsl:apply-templates />
+ </h2>
+ </xsl:template>
+
+ <xsl:template match="naglowek_osoba">
+ <h2 class="h4" xmlns="http://www.w3.org/1999/xhtml">
+ <xsl:apply-templates />
+ </h2>
+ </xsl:template>
+
+ <xsl:template match="miejsce_czas">
+ <div class="place-and-time" xmlns="http://www.w3.org/1999/xhtml">
+ <xsl:apply-templates />
+ </div>
+ </xsl:template>
+
+ <xsl:template match="didaskalia">
+ <div class="didaskalia" xmlns="http://www.w3.org/1999/xhtml">
+ <xsl:apply-templates />
+ </div>
+ </xsl:template>
+
+ <xsl:template match="akap|akap_dialog|akap_cd">
+ <p class="paragraph" xmlns="http://www.w3.org/1999/xhtml">
+ <xsl:apply-templates />
+ </p>
+ </xsl:template>
+
+ <xsl:template match="strofa">
+ <div class="stanza" xmlns="http://www.w3.org/1999/xhtml">
+ <xsl:apply-templates />
+ </div><div xmlns="http://www.w3.org/1999/xhtml"> </div>
+ </xsl:template>
+
+ <xsl:template match="wers_normalny">
+ <div class="verse" xmlns="http://www.w3.org/1999/xhtml">
+ <xsl:apply-templates />
+  </div>
+ </xsl:template>
+
+ <xsl:template match="wers_akap">
+ <div class="verse" style="margin-left: 1em;" xmlns="http://www.w3.org/1999/xhtml">
+ <xsl:apply-templates />
+  </div>
+ </xsl:template>
+
+ <xsl:template match="wers_wciety">
+ <div class="verse" style='margin-left:1em;' xmlns="http://www.w3.org/1999/xhtml">
+ <xsl:apply-templates />
+  </div>
+ </xsl:template>
+
+ <xsl:template match="wers_wciety[@typ!='']">
+ <div class="verse" xmlns="http://www.w3.org/1999/xhtml">
+ <xsl:attribute name="style">
+ margin-left: <xsl:value-of select="@typ" />em;
+ </xsl:attribute>
+ <xsl:apply-templates />
+  </div>
+ </xsl:template>
+
+ <xsl:template match="wers_cd">
+ <div class="verse" style="margin-left: 12em;" xmlns="http://www.w3.org/1999/xhtml">
+ <xsl:apply-templates />
+  </div>
+ </xsl:template>
+
+ <xsl:template match="motto_podpis">
+ <div class="motto_podpis" xmlns="http://www.w3.org/1999/xhtml">
+ <xsl:apply-templates />
+ </div>
+ </xsl:template>
+
+ <!--===========================================================-->
+ <!-- Tagi LINIOWE -->
+ <!--===========================================================-->
+
+ <xsl:template match="slowo_obce">
+ <em class="foreign-word" xmlns="http://www.w3.org/1999/xhtml">
+ <xsl:apply-templates />
+ </em>
+ </xsl:template>
+
+ <xsl:template match="mat" >
+ <em class="math" xmlns="http://www.w3.org/1999/xhtml">
+ <xsl:apply-templates />
+ </em>
+ </xsl:template>
+
+ <xsl:template match="didask_tekst" >
+ <em class="didaskalia" xmlns="http://www.w3.org/1999/xhtml">
+ <xsl:apply-templates />
+ </em>
+ </xsl:template>
+
+ <xsl:template match="tytul_dziela" >
+ <em class="book-title" xmlns="http://www.w3.org/1999/xhtml">
+ <xsl:if test="@typ = '1'" >„</xsl:if>
+ <xsl:apply-templates />
+ <xsl:if test="@typ = '1'">”</xsl:if>
+ </em>
+ </xsl:template>
+
+ <xsl:template match="wyroznienie" >
+ <em class="author-emphasis" xmlns="http://www.w3.org/1999/xhtml">
+ <xsl:apply-templates />
+ </em>
+ </xsl:template>
+
+ <xsl:template match="osoba" >
+ <em class="person" xmlns="http://www.w3.org/1999/xhtml">
+ <xsl:apply-templates />
+ </em>
+ </xsl:template>
+
+ <xsl:template match="naglowek_listy" >
+ <xsl:apply-templates />
+ </xsl:template>
+
+ <xsl:template match="lista_osoba" >
+ <li xmlns="http://www.w3.org/1999/xhtml">
+ <xsl:apply-templates />
+ </li>
+ </xsl:template>
+
+ <!--===========================================================-->
+ <!-- Tagi STANDALONE -->
+ <!--===========================================================-->
+
+ <xsl:template match="sekcja_swiatlo">
+ <p class="spacer" xmlns="http://www.w3.org/1999/xhtml"> </p>
+ </xsl:template>
+
+ <xsl:template match="sekcja_asterysk">
+ <p class="spacer-asterisk" xmlns="http://www.w3.org/1999/xhtml">*</p>
+ </xsl:template>
+
+ <xsl:template match="separator_linia">
+ <hr class="spacer-line" xmlns="http://www.w3.org/1999/xhtml"></hr>
+ </xsl:template>
+
+ <!--===========================================================-->
+ <!-- Tagi SPECJALNE -->
+ <!--===========================================================-->
+
+ <xsl:template match="motyw" />
+
+ <!--===========================================================-->
+ <!-- Tagi IGNOROWANE -->
+ <!--===========================================================-->
+
+ <xsl:template match="extra" />
+
+ <xsl:template match="pe|pa|pr|pt" >
+ <a id="anchor-{.}" class="anchor" href="annotations.html#annotation-{.}"
+ xmlns="http://www.w3.org/1999/xhtml">[<xsl:apply-templates />]</a>
+ </xsl:template>
+
+ <xsl:template match="uwaga" />
+
+ <xsl:template match="nota_red" />
+
+ <!--pominięcie tych metadanych-->
+ <xsl:template match="rdf:RDF" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" />
+
+ <!--===========================================================-->
+ <!-- Tagi TEKSTOWE -->
+ <!--===========================================================-->
+
+ <xsl:template match="text()" >
+ <xsl:value-of select="." disable-output-escaping="yes"/>
+ </xsl:template>
+
+ <xsl:template match="text()" >
+ <xsl:value-of select="." disable-output-escaping="yes"/>
+ </xsl:template>
+
</xsl:stylesheet>
\ No newline at end of file
-<?xml version="1.0" encoding="UTF-8"?>\r
-<xsl:stylesheet version="1.0"\r
- xmlns="http://www.w3.org/1999/xhtml"\r
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"\r
- xmlns:dc="http://purl.org/dc/elements/1.1/"\r
- xmlns:wl="http://wolnelektury.pl/functions">\r
- <xsl:output method="html" version="1.0" encoding="utf-8" />\r
- <xsl:output doctype-system="http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd" />\r
- <xsl:output doctype-public="-//W3C//DTD XHTML 1.1//EN" />\r
-\r
- <xsl:template match="/">\r
- <html>\r
- <head>\r
- <link rel="stylesheet" href="style.css" type="text/css" />\r
- <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />\r
- <title>\r
- <xsl:text>Strona tytułowa</xsl:text>\r
- </title>\r
- </head>\r
- <body>\r
- <div id="book-text" >\r
- <div class='title-page'>\r
- <xsl:choose>\r
- <xsl:when test="//autor_utworu | //nazwa_utworu">\r
- <xsl:apply-templates select="//autor_utworu" mode="poczatek"/>\r
- <xsl:apply-templates select="//nazwa_utworu | //podtytul | //dzielo_nadrzedne" mode="poczatek"/>\r
- </xsl:when>\r
- <xsl:otherwise>\r
- <xsl:apply-templates select="//dc:creator" mode="poczatek"/>\r
- <xsl:apply-templates select="//dc:title | //podtytul | //dzielo_nadrzedne" mode="poczatek"/>\r
- </xsl:otherwise>\r
- </xsl:choose>\r
- </div>\r
-\r
- <p class="info"> </p>\r
-\r
- <xsl:call-template name="translators" />\r
-\r
- <xsl:if test="not(utwor/@less-advertising)">\r
- <p class="info">\r
- <a>\r
- <xsl:attribute name="href">\r
- <xsl:value-of select="//dc:identifier.url" />\r
- </xsl:attribute>\r
- Ta lektura</a>,\r
- podobnie jak tysiące innych, jest dostępna on-line na stronie\r
- <a href="http://www.wolnelektury.pl/">wolnelektury.pl</a>.\r
- </p>\r
- </xsl:if>\r
-\r
- <p class="info">\r
- Utwór opracowany został w ramach projektu<a href="http://www.wolnelektury.pl/"> Wolne Lektury</a> przez<a href="http://www.nowoczesnapolska.org.pl/"> fundację Nowoczesna Polska</a>.\r
- </p>\r
-\r
- <p class="footer info">\r
- <a href="http://www.wolnelektury.pl/"><img src="logo_wolnelektury.png" alt="WolneLektury.pl" /></a>\r
- </p>\r
- </div>\r
- </body>\r
- </html>\r
- </xsl:template>\r
-\r
- <xsl:template match="text()" >\r
- <xsl:value-of select="." disable-output-escaping="yes" />\r
- </xsl:template>\r
-\r
- <xsl:template match="node()" mode="poczatek">\r
- <xsl:value-of select="." />\r
- </xsl:template>\r
-\r
- <xsl:template match="dc:creator" mode="poczatek">\r
- <h2 class="author">\r
- <xsl:apply-templates mode='person' />\r
- </h2>\r
- </xsl:template>\r
-\r
- <xsl:template match="dc:creator/text()">\r
- <h2 class="author" >\r
- <xsl:apply-templates mode='person' />\r
- </h2>\r
- </xsl:template>\r
-\r
- <xsl:template name="translators">\r
- <xsl:if test="//dc:contributor.translator">\r
- <p class="info">\r
- <xsl:text>tłum. </xsl:text>\r
- <xsl:for-each select="//dc:contributor.translator">\r
- <xsl:if test="position() != 1">, </xsl:if>\r
- <xsl:apply-templates mode="person" />\r
- </xsl:for-each>\r
- </p>\r
- </xsl:if>\r
- </xsl:template>\r
-\r
- <xsl:template match="text()" mode="person">\r
- <xsl:value-of select="wl:person_name(.)" />\r
- </xsl:template>\r
-\r
- <xsl:template match="autor_utworu" mode="poczatek">\r
- <h2 class="author" >\r
- <xsl:apply-templates />\r
- </h2>\r
- </xsl:template>\r
-\r
- <xsl:template match="dzielo_nadrzedne" mode="poczatek">\r
- <h2 class="collection" >\r
- <xsl:apply-templates />\r
- </h2>\r
- </xsl:template>\r
-\r
- <xsl:template match="nazwa_utworu" mode="poczatek" >\r
- <h1 class="title" >\r
- <xsl:apply-templates />\r
- </h1>\r
- </xsl:template>\r
-\r
- <xsl:template match="dc:title" mode="poczatek" >\r
- <h1 class="title" >\r
- <xsl:apply-templates />\r
- </h1>\r
- </xsl:template>\r
-\r
- <xsl:template match="podtytul" mode="poczatek">\r
- <h2 class="subtitle" >\r
- <xsl:apply-templates />\r
- </h2>\r
- </xsl:template>\r
-\r
- <xsl:template match="pe|pa|pr|pt" />\r
-\r
- <xsl:template match="extra" />\r
-\r
- <xsl:template match="motyw" />\r
-\r
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet version="1.0"
+ xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:wl="http://wolnelektury.pl/functions">
+ <xsl:output method="html" version="1.0" encoding="utf-8" />
+ <xsl:output doctype-system="http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd" />
+ <xsl:output doctype-public="-//W3C//DTD XHTML 1.1//EN" />
+
+ <xsl:template match="/">
+ <html>
+ <head>
+ <link rel="stylesheet" href="style.css" type="text/css" />
+ <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
+ <title>
+ <xsl:text>Strona tytułowa</xsl:text>
+ </title>
+ </head>
+ <body>
+ <div id="book-text" >
+ <div class='title-page'>
+ <xsl:choose>
+ <xsl:when test="//autor_utworu | //nazwa_utworu">
+ <xsl:apply-templates select="//autor_utworu" mode="poczatek"/>
+ <xsl:apply-templates select="//nazwa_utworu | //podtytul | //dzielo_nadrzedne" mode="poczatek"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:apply-templates select="//dc:creator" mode="poczatek"/>
+ <xsl:apply-templates select="//dc:title | //podtytul | //dzielo_nadrzedne" mode="poczatek"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </div>
+
+ <p class="info"> </p>
+
+ <xsl:call-template name="translators" />
+
+ <xsl:if test="not(utwor/@less-advertising)">
+ <p class="info">
+ <a>
+ <xsl:attribute name="href">
+ <xsl:value-of select="//dc:identifier.url" />
+ </xsl:attribute>
+ Ta lektura</a>,
+ podobnie jak tysiące innych, jest dostępna on-line na stronie
+ <a href="http://www.wolnelektury.pl/">wolnelektury.pl</a>.
+ </p>
+ </xsl:if>
+
+ <p class="info">
+ Utwór opracowany został w ramach projektu<a href="http://www.wolnelektury.pl/"> Wolne Lektury</a> przez<a href="http://www.nowoczesnapolska.org.pl/"> fundację Nowoczesna Polska</a>.
+ </p>
+
+ <p class="footer info">
+ <a href="http://www.wolnelektury.pl/"><img src="logo_wolnelektury.png" alt="WolneLektury.pl" /></a>
+ </p>
+ </div>
+ </body>
+ </html>
+ </xsl:template>
+
+ <xsl:template match="text()" >
+ <xsl:value-of select="." disable-output-escaping="yes" />
+ </xsl:template>
+
+ <xsl:template match="node()" mode="poczatek">
+ <xsl:value-of select="." />
+ </xsl:template>
+
+ <xsl:template match="dc:creator" mode="poczatek">
+ <h2 class="author">
+ <xsl:apply-templates mode='person' />
+ </h2>
+ </xsl:template>
+
+ <xsl:template match="dc:creator/text()">
+ <h2 class="author" >
+ <xsl:apply-templates mode='person' />
+ </h2>
+ </xsl:template>
+
+ <xsl:template name="translators">
+ <xsl:if test="//dc:contributor.translator">
+ <p class="info">
+ <xsl:text>tłum. </xsl:text>
+ <xsl:for-each select="//dc:contributor.translator">
+ <xsl:if test="position() != 1">, </xsl:if>
+ <xsl:apply-templates mode="person" />
+ </xsl:for-each>
+ </p>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template match="text()" mode="person">
+ <xsl:value-of select="wl:person_name(.)" />
+ </xsl:template>
+
+ <xsl:template match="autor_utworu" mode="poczatek">
+ <h2 class="author" >
+ <xsl:apply-templates />
+ </h2>
+ </xsl:template>
+
+ <xsl:template match="dzielo_nadrzedne" mode="poczatek">
+ <h2 class="collection" >
+ <xsl:apply-templates />
+ </h2>
+ </xsl:template>
+
+ <xsl:template match="nazwa_utworu" mode="poczatek" >
+ <h1 class="title" >
+ <xsl:apply-templates />
+ </h1>
+ </xsl:template>
+
+ <xsl:template match="dc:title" mode="poczatek" >
+ <h1 class="title" >
+ <xsl:apply-templates />
+ </h1>
+ </xsl:template>
+
+ <xsl:template match="podtytul" mode="poczatek">
+ <h2 class="subtitle" >
+ <xsl:apply-templates />
+ </h2>
+ </xsl:template>
+
+ <xsl:template match="pe|pa|pr|pt" />
+
+ <xsl:template match="extra" />
+
+ <xsl:template match="motyw" />
+
</xsl:stylesheet>
\ No newline at end of file
ns[f.__name__] = f
-def reg_substitute_entities():
+def reg_substitute_entities():
ENTITY_SUBSTITUTIONS = [
(u'---', u'—'),
(u'--', u'–'),
def insert_tags(doc, split_re, tagname, exclude=None):
- """ inserts <tagname> for every occurence of `split_re' in text nodes in the `doc' tree
+ """ inserts <tagname> for every occurence of `split_re' in text nodes in the `doc' tree
>>> t = etree.fromstring('<a><b>A-B-C</b>X-Y-Z</a>');
>>> insert_tags(t, re.compile('-'), 'd');
def substitute_hyphens(doc):
- insert_tags(doc,
+ insert_tags(doc,
re.compile("(?<=[^-\s])-(?=[^-\s])"),
"dywiz",
exclude=[DCNS("identifier.url"), DCNS("rights.license")]
def fix_hanging(doc):
- insert_tags(doc,
+ insert_tags(doc,
re.compile("(?<=\s\w)\s+"),
"nbsp",
exclude=[DCNS("identifier.url"), DCNS("rights.license")]
def package_available(package, args='', verbose=False):
- """ check if a verion of a latex package accepting given args is available """
+ """ check if a verion of a latex package accepting given args is available """
tempdir = mkdtemp('-wl2pdf-test')
fpath = os.path.join(tempdir, 'test.tex')
f = open(fpath, 'w')
return p == 0
-def transform(provider, slug=None, file_path=None,
+def transform(provider, slug=None, file_path=None,
output_file=None, output_dir=None, make_dir=False, verbose=False, save_tex=None, morefloats=None):
""" produces a PDF file with XeLaTeX
def load_including_children(provider, slug=None, uri=None, file_path=None):
- """ makes one big xml file with children inserted at end
+ """ makes one big xml file with children inserted at end
either slug or uri must be provided
"""
<?xml version="1.0" encoding="utf-8"?>
<!--
-
+
This file is part of Librarian, licensed under GNU Affero GPLv3 or later.
Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
-
+
-->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:wl="http://wolnelektury.pl/functions"
<!-- = (can contain other block tags, paragraph tags, standalone tags and special tags) = -->
<!-- ==================================================================================== -->
-<xsl:template
+<xsl:template
match="powiesc|opowiadanie|liryka_l|liryka_lp|dramat_wierszowany_l|dramat_wierszowany_lp|dramat_wspolczesny|nota|dedykacja|dlugi_cytat|poezja_cyt|motto">
<cmd>
<xsl:attribute name="name">
<!-- ========================================== -->
<!-- only in root -->
-<xsl:template
+<xsl:template
match="autor_utworu|dzielo_nadrzedne|nazwa_utworu|podtytul"
mode="title">
<cmd>
</xsl:template>
-<xsl:template
+<xsl:template
match="naglowek_akt|naglowek_czesc|srodtytul|naglowek_osoba|naglowek_podrozdzial|naglowek_scena|naglowek_rozdzial|miejsce_czas|didaskalia|lista_osoba|akap|akap_dialog|akap_cd|motto_podpis|naglowek_listy">
<cmd>
<xsl:attribute name="name">
license_description = parsed_dc.license_description
license = parsed_dc.license
if license:
- license_description = u"Ten utwór jest udostepniony na licencji %s: \n%s" % (license_description, license)
+ license_description = u"Ten utwór jest udostepniony na licencji %s: \n%s" % (license_description, license)
else:
license_description = u"Ten utwór nie jest chroniony prawem autorskim i znajduje się w domenie publicznej, co oznacza że możesz go swobodnie wykorzystywać, publikować i rozpowszechniać. Jeśli utwór opatrzony jest dodatkowymi materiałami (przypisy, motywy literackie etc.), które podlegają prawu autorskiemu, to te dodatkowe materiały udostępnione są na licencji Creative Commons Uznanie Autorstwa – Na Tych Samych Warunkach 3.0 PL (http://creativecommons.org/licenses/by-sa/3.0/)"
else:
source = ''
- contributors = ', '.join(person.readable() for person in
+ contributors = ', '.join(person.readable() for person in
sorted(set(p for p in (parsed_dc.technical_editors + parsed_dc.editors) if p)))
if contributors:
contributors = "\n\nOpracowanie redakcyjne i przypisy: %s" % contributors
<?xml version="1.0" encoding="utf-8"?>
<!--
-
+
This file is part of Librarian, licensed under GNU Affero GPLv3 or later.
Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
-
+
-->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:wl="http://wolnelektury.pl/functions"
<xsl:apply-templates select="*|text()" mode="inline" />
</xsl:variable>
<xsl:text>
-
+
/ </xsl:text><xsl:value-of select="wl:wrap_words(wl:strip($content), $wrapping)" /><xsl:text> /</xsl:text>
</xsl:template>
<xsl:text>
</xsl:text>
<xsl:choose>
- <xsl:when test="count(br) > 0">
+ <xsl:when test="count(br) > 0">
<xsl:call-template name="verse">
<xsl:with-param name="verse-content" select="br[1]/preceding-sibling::text() | br[1]/preceding-sibling::node()" />
<xsl:with-param name="verse-type" select="br[1]/preceding-sibling::*[name() = 'wers_wciety' or name() = 'wers_akap' or name() = 'wers_cd'][1]" />
- </xsl:call-template>
+ </xsl:call-template>
<xsl:for-each select="br">
<!-- Each BR tag "consumes" text after it -->
<xsl:variable name="lnum" select="count(preceding-sibling::br)" />
<xsl:call-template name="verse">
- <xsl:with-param name="verse-content"
+ <xsl:with-param name="verse-content"
select="following-sibling::text()[count(preceding-sibling::br) = $lnum+1] | following-sibling::node()[count(preceding-sibling::br) = $lnum+1]" />
<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]" />
</xsl:call-template>
<xsl:call-template name="verse">
<xsl:with-param name="verse-content" select="text() | node()" />
<xsl:with-param name="verse-type" select="wers_wciety|wers_akap|wers_cd[1]" />
- </xsl:call-template>
+ </xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<?xml version="1.0" encoding="utf-8"?>
<!--
-
+
This file is part of Librarian, licensed under GNU Affero GPLv3 or later.
Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
-
+
-->
<config>
<types>
<wers_cd />
<wers_akap />
<wers_wciety />
- </paragraph-elements>
-
+ </paragraph-elements>
+
<header-1-elements element="h1" mixed="true">
- <!-- placeholder -->
+ <!-- placeholder -->
<dzielo_nadrzedne />
</header-1-elements>
-
+
<header-2-elements element="h2" mixed="true">
- <naglowek_akt />
+ <naglowek_akt />
<naglowek_czesc />
<autor_utworu />
<nazwa_utworu />
<srodtytul />
</header-2-elements>
-
+
<header-3-elements element="h3" mixed="true">
<naglowek_scena />
<naglowek_rozdzial />
<podtytul />
</header-3-elements>
-
+
<header-4-elements element="h4" mixed="true">
<naglowek_osoba />
<naglowek_podrozdzial />
<pr />
<pt />
</annotations>
-
+
<no-show-elements>
<begin />
<end />
<extra />
<uwaga />
- <motyw />
+ <motyw />
<br />
<pa />
<pe />
<?xml version="1.0" encoding="utf-8"?>
<!--
-
+
This file is part of Librarian, licensed under GNU Affero GPLv3 or later.
Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
-
+
-->
<xsl:stylesheet version="1.0"
xmlns="http://nowoczesnapolska.org.pl/ML/Lektury/1.1"
-
+
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:wlf="http://wolnelektury.pl/functions"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/"
exclude-result-prefixes="wlf xsl"
<!-- Normalization Stylsheet for Wolne Lektury XML -->
<xsl:output method="xml" encoding="utf-8" indent="yes" />
-
+
<xsl:strip-space elements="rdf:RDF rdf:Description meta doc main-text strofa stanza drama-line wlml:*" />
<xsl:param name="normalize-text" select="boolean(1)" />
</main-text>
<annotations>
- <xsl:apply-templates select="//pr|pt|pe|pa" mode="annotations" />
+ <xsl:apply-templates select="//pr|pt|pe|pa" mode="annotations" />
</annotations>
</doc>
- </xsl:template>
+ </xsl:template>
<xsl:template match="strofa">
<xsl:element name="stanza" namespace="http://nowoczesnapolska.org.pl/ML/Lektury/1.1">
<xsl:template match="akap_dialog">
<xsl:element name="pd">
- <xsl:variable name="prolog" select="./text()[1]" />
+ <xsl:variable name="prolog" select="./text()[1]" />
<xsl:value-of select="wlf:fix-dialog-line($prolog)" />
<xsl:apply-templates select="@*|*|text()[. != $prolog]" />
</xsl:element>
<xsl:when test="starts-with(., '.')">
<xsl:attribute name="type">dot</xsl:attribute>
</xsl:when>
- </xsl:choose>
+ </xsl:choose>
</xsl:element>
</xsl:template>
<xsl:template match="motto">
<xsl:element name="motto">
<xsl:apply-templates select="@*|node()" />
-
+
<xsl:variable name="sign" select="following-sibling::*[1][name() = 'motto_podpis']" />
<signature>
<xsl:apply-templates select="$sign/node()" />
</xsl:template>
<xsl:template match="motto_podpis[preceding-sibling::*[1][name() = 'motto']]" />
-
+
<xsl:template match="lista_osob">
<person-list>
<xsl:apply-templates select="@*|node()" />
<xsl:template match="sekcja_swiatlo">
<vertical-space />
</xsl:template>
-
+
<xsl:template match="sekcja_asterysk">
<vertical-space type="asterisk" />
</xsl:template>
</xsl:template>
<xsl:template match="naglowek_osoba[following-sibling::*[1][name() = 'kwestia']]" />
-
+
<!-- Inne -->
<xsl:template match="osoba">
<xsl:element name="person-ref">
<!-- Copy attributes -->
<xsl:template match="@*|comment()">
<xsl:copy />
- </xsl:template>
+ </xsl:template>
<!-- Inside RDF meta-data, leave the text unchanged -->
<xsl:template match="rdf:RDF//text()">
<!-- Ignoruj RDF poza meta -->
<xsl:template match="rdf:*|dc:*" />
-
+
<xsl:template match="@*|node()" mode="meta">
<xsl:copy>
<xsl:apply-templates match="@*|node()" mode="meta" />
<xsl:template match="node()">
<xsl:message>
<xsl:text>Nieprzetworzony węzeł:</xsl:text>
- <xsl:value-of select="." />
+ <xsl:value-of select="." />
</xsl:message>
<unparsed-node>
<xsl:copy-of select="." />
</unparsed-node>
</xsl:template>
-
+
</xsl:stylesheet>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<!--
-
+
This file is part of Librarian, licensed under GNU Affero GPLv3 or later.
Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
-
+
-->
<xsl:stylesheet
version="1.0"
-
+
xmlns="http://www.w3.org/1999/xhtml"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:wl="http://wolnelektury.pl/functions"
exclude-result-prefixes="wl" >
indent="yes"
omit-xml-declaration = "yes" />
- <!--
+ <!--
Dokument ten opisuje podstawowe przekształcenia potrzebne
do zamiany dokumentu WLML 1.0 na poprawnie sformatowany
dokument XHMTL.
<xsl:param name="element" />
<xsl:param name="mypath" />
<xsl:param name="mixed" />
-
+
<xsl:for-each select="child::node()">
<xsl:apply-templates select="." mode="element-tag">
<xsl:with-param name="offset" select="count(preceding-sibling::*)" />
</xsl:apply-templates>
</xsl:for-each>
</xsl:template>
-
+
<xsl:template name="generic-content">
<xsl:param name="element" />
<xsl:param name="mypath" />
<xsl:with-param name="mixed" select="$mixed" />
</xsl:call-template>
</xsl:template>
-
+
<!-- Generyczne szablony -->
<xsl:template name="generic" >
<xsl:param name="element" />
<xsl:variable name="tag" select="name($element)" />
<xsl:variable name="group" select="$config//types/*[@element and child::*[local-name() = $tag]]" />
-
+
<xsl:choose>
<!-- ignore namespaced elements -->
<xsl:when test="namespace-uri()" />
<xsl:when test="$group/@element">
-
+
<xsl:element name="{$group/@element}" namespace="http://www.w3.org/1999/xhtml">
<xsl:apply-templates select="$element" mode="element-content" >
<xsl:with-param name="mypath" select="$mypath" />
<xsl:template match="pr|pa|pe|pt" mode="element-tag">
<a href="#annotation-{generate-id(.)}"><span class="annotation"/></a><a name="anchor-{generate-id(.)}" />
- </xsl:template>
+ </xsl:template>
<xsl:template match="dlugi_cytat|poezja_cyt" mode="element-tag">
<xsl:param name="offset" />
<xsl:variable name="mypath"
select="concat($parent-path, '/', name(), '[',string($offset),']')" />
-
+
<xsl:call-template name="generic-descent">
<xsl:with-param name="element" select="current()" />
<xsl:with-param name="mypath" select="$mypath" />
<xsl:with-param name="mixed" select="$mixed"/>
</xsl:call-template>
</xsl:template>
-
+
<xsl:template match="text()" mode="element-tag">
<xsl:param name="mixed" />
<xsl:choose>
-
+
<xsl:when test="not($mixed)">
<xsl:choose>
<xsl:when test="not(normalize-space(.))" />
</xsl:otherwise>
</xsl:choose>
</xsl:when>
-
+
<xsl:otherwise>
<xsl:value-of select="wl:substitute_entities(.)">
<xsl:fallback>
</xsl:otherwise>
</xsl:choose>
-
+
</xsl:template>
<xsl:template match="node()" />
-
+
</xsl:stylesheet>
<?xml version="1.0" encoding="utf-8"?>
<!--
-
+
This file is part of Librarian, licensed under GNU Affero GPLv3 or later.
Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
-
+
-->
-<xsl:stylesheet version="1.0"
- xmlns="http://www.w3.org/1999/xhtml"
+<xsl:stylesheet version="1.0"
+ xmlns="http://www.w3.org/1999/xhtml"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
- <xsl:param name="with-paths" select="boolean(0)" />
+ <xsl:param name="with-paths" select="boolean(0)" />
<xsl:param name="with-annotations" select="boolean(1)" />
-
+
<xsl:include href="wl2html_base.xslt" />
<xsl:output encoding="utf-8" indent="yes" omit-xml-declaration = "yes" />
<xsl:if test="with-toc" />
- <xsl:apply-templates select="/utwor" mode="element-tag">
+ <xsl:apply-templates select="/utwor" mode="element-tag">
<xsl:with-param name="parentpath" select="''" />
<xsl:with-param name="offset" select="0" />
<xsl:with-param name="mixed" select="false()" />
<?xml version="1.0" encoding="utf-8"?>
<!--
-
+
This file is part of Librarian, licensed under GNU Affero GPLv3 or later.
Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
-
+
-->
-<xsl:stylesheet version="1.0"
- xmlns="http://www.w3.org/1999/xhtml"
+<xsl:stylesheet version="1.0"
+ xmlns="http://www.w3.org/1999/xhtml"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:param name="with-paths" select="boolean(0)" />
<xsl:param name="base-path" select="'.'"/>
<xsl:param name="base-offset" select="0" />
-
- <xsl:include href="wl2html_base.xslt" />
-
+
+ <xsl:include href="wl2html_base.xslt" />
+
<xsl:output
encoding="utf-8"
indent="yes"
<xsl:with-param name="mixed" select="true()" />
</xsl:apply-templates>
</chunk>
- </xsl:template>
-
+ </xsl:template>
+
</xsl:stylesheet>
\ No newline at end of file
# -*- coding: utf-8 -*-
#
# This file is part of Librarian, licensed under GNU Affero GPLv3 or later.
-# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
+# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
#
import os.path
import optparse
'name': e.__class__.__name__,
'message': e.message
}
-
\ No newline at end of file
# -*- coding: utf-8 -*-
#
# This file is part of Librarian, licensed under GNU Affero GPLv3 or later.
-# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
+# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
#
import os
import optparse
help='print status messages to stdout')
parser.add_option('-i', '--ignore-dublin-core', action='store_false', dest='parse_dublincore', default=True,
help='don\'t try to parse dublin core metadata')
-
+
options, input_filenames = parser.parse_args()
if len(input_filenames) < 1:
for input_filename in input_filenames:
if options.verbose:
print input_filename
-
+
output_filename = os.path.splitext(input_filename)[0] + '.html'
try:
html.transform(input_filename, output_filename, parse_dublincore=options.parse_dublincore, flags=('full-page',))
# -*- coding: utf-8 -*-
#
# This file is part of Librarian, licensed under GNU Affero GPLv3 or later.
-# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
+# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
#
import os
import optparse
help='print status messages to stdout')
parser.add_option('-i', '--ignore-dublin-core', action='store_false', dest='parse_dublincore', default=True,
help='don\'t try to parse dublin core metadata')
-
+
options, input_filenames = parser.parse_args()
if len(input_filenames) < 1:
for input_filename in input_filenames:
if options.verbose:
print input_filename
-
+
output_filename = os.path.splitext(input_filename)[0] + '.html'
try:
html.transform(input_filename, output_filename, parse_dublincore=options.parse_dublincore,\
# -*- coding: utf-8 -*-
#
# This file is part of Librarian, licensed under GNU Affero GPLv3 or later.
-# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
+# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
#
import os.path
import optparse
xml.append(product_elem)
cover.virtualo_cover(
- u' '.join(info.author.first_names + (info.author.last_name,)),
+ u' '.join(info.author.first_names + (info.author.last_name,)),
info.title
).save(os.path.join(outfile_dir, slug+'.jpg'))
outfile = os.path.join(outfile_dir, '1.epub')
xml_file.close()
-def asbis(filenames, output_dir, verbose):
+def prestigio(filenames, output_dir, verbose):
try:
for main_input in input_filenames:
if options.verbose:
pass
outfile = os.path.join(output_dir, slug + '.epub')
epub.transform(provider, file_path=main_input, output_file=outfile,
- cover_fn=cover.asbis_cover, flags=('less-advertising',))
+ cover_fn=cover.prestigio_cover, flags=('less-advertising',))
except ParseError, e:
print '%(file)s:%(name)s:%(message)s' % {
'file': main_input,
help='specifies the directory for output')
parser.add_option('--virtualo', action='store_true', dest='virtualo', default=False,
help='prepare files for Virtualo API')
- parser.add_option('--asbis', action='store_true', dest='asbis', default=False,
- help='prepare files for Asbis')
+ parser.add_option('--prestigio', action='store_true', dest='prestigio', default=False,
+ help='prepare files for prestigio')
options, input_filenames = parser.parse_args()
if options.virtualo:
virtualo(input_filenames, options.output_dir, options.verbose)
- if options.asbis:
- asbis(input_filenames, options.output_dir, options.verbose)
-
\ No newline at end of file
+ if options.prestigio:
+ prestigio(input_filenames, options.output_dir, options.verbose)
# -*- coding: utf-8 -*-
#
# This file is part of Librarian, licensed under GNU Affero GPLv3 or later.
-# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
+# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
#
import os.path
from optparse import OptionParser
else:
output_dir = path
- pdf.transform(provider,
- file_path=main_input,
- output_file=output_file,
+ pdf.transform(provider,
+ file_path=main_input,
+ output_file=output_file,
output_dir=output_dir,
verbose=options.verbose,
make_dir=options.make_dir,
# -*- coding: utf-8 -*-
#
# This file is part of Librarian, licensed under GNU Affero GPLv3 or later.
-# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
+# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
#
import os
import optparse
help='set line wrap column')
parser.add_option('-i', '--ignore-dublin-core', action='store_false', dest='parse_dublincore', default=True,
help='don\'t try to parse dublin core metadata')
-
+
options, input_filenames = parser.parse_args()
-
+
if len(input_filenames) < 1:
parser.print_help()
exit(1)
for input_filename in input_filenames:
if options.verbose:
print input_filename
-
+
output_filename = os.path.splitext(input_filename)[0] + '.txt'
try:
output_file = open(output_filename, 'w')
# -*- coding: utf-8 -*-
#
# This file is part of Librarian, licensed under GNU Affero GPLv3 or later.
-# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
+# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
#
import os
import optparse
# Parse commandline arguments
usage = """Usage: %prog [options] SOURCE [SOURCE...]
Extract theme fragments from SOURCE."""
-
+
parser = optparse.OptionParser(usage=usage)
-
+
parser.add_option('-v', '--verbose', action='store_true', dest='verbose', default=False,
help='print status messages to stdout')
-
+
options, input_filenames = parser.parse_args()
-
+
if len(input_filenames) < 1:
parser.print_help()
exit(1)
-
+
# Do some real work
for input_filename in input_filenames:
if options.verbose:
print input_filename
-
+
output_filename = os.path.splitext(input_filename)[0] + '.fragments.html'
-
+
closed_fragments, open_fragments = html.extract_fragments(input_filename)
for fragment_id in open_fragments:
# -*- coding: utf-8 -*-
#
# This file is part of Librarian, licensed under GNU Affero GPLv3 or later.
-# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
+# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
#
import os
import optparse
help='print status messages to stdout')
parser.add_option('-f', '--force', action='store_true', dest='force', default=False,
help='overwrite current identifiers')
-
+
options, input_filenames = parser.parse_args()
if len(input_filenames) < 1:
for input_filename in input_filenames:
if options.verbose:
print input_filename
-
+
doc = etree.parse(input_filename)
try:
title = doc.find('//{http://purl.org/dc/elements/1.1/}title').text
except AttributeError:
print '%s:error:Book title not found. Skipping.' % input_filename
continue
-
+
parent = ''
try:
parent_url = doc.find('//{http://purl.org/dc/elements/1.1/}relation.isPartOf').text
pass
except IndexError:
print '%s:error:Invalid parent URL "%s". Skipping.' % (input_filename, parent_url)
-
+
book_url = doc.find('//{http://purl.org/dc/elements/1.1/}identifier.url')
if book_url is None:
book_description = doc.find('//{http://www.w3.org/1999/02/22-rdf-syntax-ns#}Description')
if not options.force and book_url.text.startswith('http://'):
print '%s:Notice:Book already has identifier URL "%s". Skipping.' % (input_filename, book_url.text)
continue
-
+
book_url.text = BOOK_URL + slughifi(parent + title)[:60]
doc.write(input_filename, xml_declaration=True, pretty_print=True, encoding='utf-8')
/*
* This file is part of Librarian, licensed under GNU Affero GPLv3 or later.
* Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
- *
+ *
*/
body {
font-size: 16px;
/*
* This file is part of Librarian, licensed under GNU Affero GPLv3 or later.
* Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
- *
+ *
*/
body {
font-size: 16px;
maintainer_email='radek.czajka@gmail.com',
url='http://github.com/fnp/librarian',
packages=['librarian'],
- package_data={'librarian': ['xslt/*.xslt', 'epub/*', 'pdf/*', 'fonts/*', 'res/*'] +
+ package_data={'librarian': ['xslt/*.xslt', 'epub/*', 'pdf/*', 'fonts/*', 'res/*'] +
whole_tree(os.path.join(os.path.dirname(__file__), 'librarian'), 'font-optimizer')},
include_package_data=True,
install_requires=['lxml>=2.2'],