super(WLCover, self).__init__(book_info, format=format, width=width, height=height)
self.kind = book_info.kind
self.epoch = book_info.epoch
- self.with_logo = with_logo
if book_info.cover_url:
url = book_info.cover_url
bg_src = None
__metaclass__ = DCInfo
FIELDS = (
- Field( DCNS('creator'), 'authors', as_person, salias='author', multiple=True),
+ Field( DCNS('creator'), 'authors', as_person, salias='author', multiple=True, required=False),
Field( DCNS('title'), 'title'),
Field( DCNS('type'), 'type', required=False, multiple=True),
Field( DCNS('source'), 'source_name', required=False),
Field( DCNS('source.URL'), 'source_url', required=False),
- Field( DCNS('identifier.url'), 'url', WLURI, strict=as_wluri_strict),
+ Field( DCNS('identifier.url'), 'url', WLURI, strict=as_wluri_strict, required=False),
Field( DCNS('rights.license'), 'license', required=False),
Field( DCNS('rights'), 'license_description'),
)
cover = WLCover
cover_file = StringIO()
- bound_cover = cover(document.book_info)
- bound_cover.save(cover_file)
- cover_name = 'cover.%s' % bound_cover.ext()
- zip.writestr(os.path.join('OPS', cover_name), cover_file.getvalue())
+ c = cover(document.book_info)
+ c.save(cover_file)
+ c_name = 'cover.%s' % c.ext()
+ zip.writestr(os.path.join('OPS', c_name), cover_file.getvalue())
del cover_file
cover_tree = etree.parse(get_resource('epub/cover.html'))
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
- <title>Okładka</title>
+ <title>Cover</title>
<style type="text/css"> img { max-width: 100%; } </style>
</head>
<body style="oeb-column-number: 1;">
<div id="cover-image">
- <img alt="Okładka" />
+ <img alt="Cover" />
</div>
</body>
</html>
\ No newline at end of file
<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>
+ <title>Future of Copyright</title>
</head>
<body>
- <h1>Spis treści</h1>
+ <h1>Table of Contents</h1>
%s
</body>
</html>
<body>
<div id="book-text" xmlns="http://www.w3.org/1999/xhtml">
<div class='title-page'>
- <xsl:apply-templates select="//dc:title" mode="poczatek"/>
+ <xsl:apply-templates select="//dzielo_nadrzedne" mode="poczatek"/>
+ <xsl:apply-templates select="//autor_utworu" mode="poczatek"/>
+ <xsl:apply-templates select="//nazwa_utworu" mode="poczatek"/>
+ <!--xsl:apply-templates select="//dc:title" mode="poczatek"/-->
</div>
</div>
</body>
</h1>
</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:stylesheet>
<dc:subject>
<xsl:apply-templates select="//dc:identifier.url" />
</dc:subject>
- <dc:creator>
+ <!--dc:creator>
<xsl:apply-templates select="//dc:creator" />
- </dc:creator>
+ </dc:creator-->
<dc:publisher>
<xsl:apply-templates select="//dc:publisher" />
</dc:publisher>
</dc:date>
</metadata>
<manifest>
+ <item id="logo" href="logo.png" media-type="image/png" />
<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="jedenprocent" href="jedenprocent.png" media-type="image/png" />
</manifest>
<spine toc="toc">
<itemref idref="titlePage" />
</p>
</xsl:if>
+ <div class="info">
+ <img src="jedenprocent.png" alt="Logo 1%" />
+ <div>Przekaż 1% podatku na rozwój Wolnych Lektur.</div>
+ <div>Nazwa organizacji: Fundacja Nowoczesna Polska</div>
+ <div>KRS 0000070056</div>
+ </div>
+
<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>.
</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>
--- /dev/null
+<?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>
+ Future of Copyright
+ </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>
+
+<h2 xmlns="http://www.w3.org/1999/xhtml" class="intitle">Dear readers!</h2>
+
+<p xmlns="http://www.w3.org/1999/xhtml" class="paragraph">It is our great pleasure to present you the “Future of Copyright
+Anthology”, a collection of 10 best short stories sent in for the “Future
+of Copyright” contest organized by Modern Poland Foundation. These works
+have been selected by our jury – Prof. Michael Geist, Piotr Czerski and
+Jarosław Lipszyc.</p>
+
+<p xmlns="http://www.w3.org/1999/xhtml" class="paragraph">The main prize in this contest was founded by you, the readers, on the
+Indiegogo crowdfunding platform. We are proud to announce that this
+prize goes to Aymeric Mansoux, author of “Morphology of a copyright
+tale”, in appreciation of the originality, power and the strong message
+of this work. Moreover, the jury decided to grant an honorable mention
+to Togi, author of the work “Give”.</p>
+
+<p xmlns="http://www.w3.org/1999/xhtml" class="paragraph">We would like to thank you for your crowdfunding support and a high
+standard of the submitted works. We were pleasantly surprised by the
+interest shown in the competition, and we have decided to hold
+its second edition next
+year. We hope that with your help it will be even more successful and
+the collected works will provide a strong voice in the debate on the future
+of copyright law and system.</p>
+
+<p xmlns="http://www.w3.org/1999/xhtml" class="paragraph">Modern Poland Foundation Team</p>
+
+<p xmlns="http://www.w3.org/1999/xhtml" class="paragraph">
+<img xmlns="http://www.w3.org/1999/xhtml" alt="Modern Poland Foundation" src="logo.png" />
+</p>
+
+<p xmlns="http://www.w3.org/1999/xhtml" class="paragraph"><a xmlns="http://www.w3.org/1999/xhtml" href="http://nowoczesnapolska.org.pl">http://nowoczesnapolska.org.pl</a></p>
+
+ </xsl:element>
+ </xsl:element>
+ </xsl:element>
+ </xsl:template>
+</xsl:stylesheet>
\ No newline at end of file
<link rel="stylesheet" href="style.css" type="text/css" />
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
<title>
- WolneLektury.pl
+ Future of Copyright
</title>
</xsl:element>
<xsl:element name="body" 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"/>
+ <xsl:apply-templates select="//dzielo_nadrzedne" mode="poczatek"/>
+ <xsl:apply-templates select="//autor_utworu" mode="poczatek"/>
+ <xsl:apply-templates select="//nazwa_utworu" mode="poczatek"/>
+ <xsl:apply-templates select="//podtytul" mode="poczatek"/>
<!--/h1-->
</xsl:if>
<xsl:apply-templates />
</xsl:template>
<xsl:template match="naglowek_scena">
- <a id="sub{@sub}" xmlns="http://www.w3.org/1999/xhtml"></a>
+ <a 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>
+ <a xmlns="http://www.w3.org/1999/xhtml"></a>
<h2 class="h4" xmlns="http://www.w3.org/1999/xhtml">
<xsl:apply-templates />
</h2>
<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>
+ <xsl:text>Title page</xsl:text>
</title>
</head>
<body>
<p class="info">[Kopia robocza]</p>
</xsl:if>
- <xsl:if test="not(utwor/@less-advertising)">
+ <!--xsl:if test="not(utwor/@less-advertising)">
<p class="info">
<a>
<xsl:attribute name="href">
podobnie jak tysiące innych, jest dostępna on-line na stronie
<a href="http://www.wolnelektury.pl/">wolnelektury.pl</a>.
</p>
- </xsl:if>
+ </xsl:if-->
<p class="info">
+ <xsl:choose>
+ <xsl:when test="//dc:contributor">Thank you for your contribution, <xsl:value-of select="//dc:contributor"/>!</xsl:when>
+ <xsl:otherwise>Thank you for all your contributions!</xsl:otherwise>
+ </xsl:choose>
+ <br/>You made this book possible.
+ </p>
+
+
+ <!--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>
+ </p-->
</div>
</body>
</html>
(u'---', u'—'),
(u'--', u'–'),
(u'...', u'…'),
- (u',,', u'„'),
+ #(u',,', u'„'),
+ (u',,', u'“'),
(u'"', u'”'),
]
if not cover:
cover = WLCover
cover_file = NamedTemporaryFile(suffix='.png', delete=False)
- bound_cover = cover(book_info)
- bound_cover.save(cover_file)
+ c = cover(book_info)
+ c.save(cover_file)
if bound_cover.uses_dc_cover:
- if document.book_info.cover_by:
+ if document.remobook_info.cover_by:
document.edoc.getroot().set('data-cover-by', document.book_info.cover_by)
if document.book_info.cover_source:
document.edoc.getroot().set('data-cover-source', document.book_info.cover_source)
\RequirePackage{setspace}
\RequirePackage{type1cm}
+\RequirePackage{amssymb}
+\RequirePackage{amsmath}
+
\DeclareOption{13pt}{%
\AtEndOfClass{%
% font size definitions, similar to ones in /usr/share/texmf-texlive/tex/latex/base/
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{book}}
\ProcessOptions\relax
-\LoadClass[a4paper,oneside]{book}
+\LoadClass[a4paper]{book}
\usepackage{trace}
-
+\usepackage{caption}
+\usepackage{tabularx}
\usepackage[MeX]{polski}
-
+\usepackage{icomma}
\usepackage[xetex]{graphicx}
\usepackage{fontspec}
\usepackage{xunicode}
\setlength{\marginparsep}{2em}
\setlength{\marginparwidth}{8.5em}
-\setlength{\oddsidemargin}{0pt}
+\setlength{\oddsidemargin}{36mm}
+\setlength{\evensidemargin}{0pt}
\setlength{\voffset}{0pt}
\setlength{\topmargin}{0pt}
\setlength{\headheight}{0pt}
\fancyhf{}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
-\lfoot{{\footnotesize \textsc{\@author} \emph{\@title}}}
+
+%\lfoot{{\footnotesize \textsc{\@author} \emph{\@title}}}
\cfoot{}
-\rfoot{{\footnotesize \thepage}}
+%\rfoot{{\footnotesize \thepage}}
+\fancyfoot[LO,RE]{{\footnotesize \textsc{\@author} \emph{\@title}}}
+\fancyfoot[LE,RO]{{\footnotesize \thepage}}
\clubpenalty=100000
\widowpenalty=100000
\includegraphics[height=\pdfpageheight,width=\pdfpagewidth]{cover.png}}}
\clearpage
- \setlength{\pdfpagewidth}{210mm}
- \setlength{\pdfpageheight}{297mm}
+
+%% Strona tytułowa %% XXX
+ \hspace{-36mm}\parbox{16cm}{
+ {\addfontfeature{LetterSpace=-4.0}{\scalefont{4}%
+ \noindent Philippe Aigrain}}
+
+ {\addfontfeature{LetterSpace=-4.0}{\scalefont{2.5}%
+ przy współpracy Suzanne Aigrain
+ }}
+
+ \vspace{2em}
+ {\addfontfeature{LetterSpace=-4.0}{\scalefont{6}%
+ Dzielenie się
+ }}
+
+ \vspace{2em}
+ {\addfontfeature{LetterSpace=-4.0}{\scalefont{3}%
+ Kultura i gospodarka epoki internetu
+ }}
+ }
+
+ \setlength{\pdfpagewidth}{210mm}
+ \setlength{\pdfpageheight}{297mm}
}
}
}
+\usepackage{printlen}
+
\newcommand{\editorialsection}{
- \begin{figure}[b!]
- {
- \footnotesize
- \color{theme}
- \noindent \rule{\linewidth}{0.4pt}
+%% XXX % sprawdzic czy czegos nie zgubilem z master
+%% szczegolnie jesli chodzi o makra wstawiajace dane z DC, jak np \editors
+\clearpage
+ \thispagestyle{empty}
- \rightsinfo
- \vspace{.6em}
+% Pusta strona
+\clearpage
+ \thispagestyle{empty}
- Źródło: \href{\bookurl}{\bookurl}
+\vspace{2em}
+ \hspace{0mm}\parbox{16cm}{
+\centering
+ {\addfontfeature{LetterSpace=-4.0}{\scalefont{6}%
+ Dzielenie się
+ }}
- \vspace{.6em}
- \sourceinfo
+ \vspace{2em}
+ {\addfontfeature{LetterSpace=-4.0}{\scalefont{3}%
+ Kultura i gospodarka epoki internetu
+ }}
+}
- \description
- \vspace{.6em}
+\clearpage
+ \thispagestyle{empty}
- \editors
+\clearpage
+ \thispagestyle{empty}
- \ifdefined\coverby
- \vspace{.6em}
- \coverby
- \fi
+%\parbox{10cm}{
+% \centering
- \vspace{.6em}
- \emph{Wesprzyj Wolne Lektury!}
+ \hspace{-36mm}\parbox{16cm}{
+\centering
- Wolne Lektury to projekt fundacji Nowoczesna Polska – organizacji
- pożytku publicznego działającej na rzecz wolności korzystania
- z dóbr kultury.
+ {\addfontfeature{LetterSpace=-4.0}{\scalefont{4}%
+ \noindent Philippe Aigrain
+ }}
- Co roku do domeny publicznej przechodzi twórczość kolejnych autorów.
- Dzięki Twojemu wsparciu będziemy je mogli udostępnić wszystkim bezpłatnie.
+ {\addfontfeature{LetterSpace=-4.0}{\scalefont{2.5}%
+ przy współpracy Suzanne Aigrain
+ }}
+
+ \vspace{2em}
+ {\addfontfeature{LetterSpace=-4.0}{\scalefont{6}%
+ Dzielenie się
+ }}
+
+ \vspace{2em}
+ {\addfontfeature{LetterSpace=-4.0}{\scalefont{4}%
+ Kultura i gospodarka epoki internetu
+ }}
- \vspace{.6em}
- \emph{Jak możesz pomóc?}
+ \vspace{2em}
+ {\addfontfeature{LetterSpace=-4.0}{\scalefont{2}%
+ Z języka angielskiego przełożył \\
+ \emph{Wojciech Pędzich}
+ }}
- Przekaż 1\% podatku na rozwój Wolnych Lektur:
- Fundacja Nowoczesna Polska, KRS 0000070056.
+\vspace{22em}
- Pomóż uwolnić konkretną książkę, wspierając
- \href{http://www.wolnelektury.pl/wesprzyj/}{zbiórkę na stronie wolnelektury.pl}.
+\includegraphics[scale=.2]{logo.eps}
+}
Przekaż darowiznę na konto:
\href{http://nowoczesnapolska.org.pl/pomoz-nam/wesprzyj-nas/}{szczegóły na stronie Fundacji}.
- \color{black}
- }
- \end{figure}
+\clearpage
+ \thispagestyle{empty}
+
+\noindent Tytuł oryginału
+
+\noindent \emph{Sharing. Culture and the Economy in the Internet Age}
+
+\vspace{1em}
+
+\noindent \editors
+
+\vspace{1em}
+
+
+\noindent \rightsinfo
+
+\vspace{1em}
+
+\noindent \coverby
+
+
+%\set\textwidth=450pt
+%\printlength\textwidth
+
+
+%% {\scalefont{1.5}Drogi czytelniku!}
+
+
+
+%% \vspace{1em}
+
+\vspace{1em}
+
+\noindent Tłumaczenie książki powstało w ramach projektu "Przyszłość prawa autorskiego" finansowanego przez {\it Trust for Civil Society in Central and Eastern Europe}.
+
+\vspace{1em}
+
+\noindent \includegraphics[scale=.4]{cce_trust.eps}
+
+\vspace{1em}
+
+\noindent Wydawca: Fundacja Nowoczesna Polska, Warszawa 2012
+
+\vspace{1em}
+\includegraphics[scale=.2]{logo.eps}
+\vspace{1em}
+
+\noindent \href{http://nowoczesnapolska.org.pl/}{http://nowoczesnapolska.org.pl/}
+
+
+
+%\vspace{4em}
+%\box{\tableofcontents}
+
+%% \begin{figure}[b!]
+%% {
+%% \footnotesize
+%% \color{theme}
+%% \noindent \rule{\linewidth}{0.4pt}
+
+%% \rightsinfo
+%% % \vspace{.6em}
+
+%% %Źródło: \href{\bookurl}{\bookurl}
+
+%% %\vspace{.6em}
+%% %\sourceinfo
+
+%% %\description
+%% %\vspace{.6em}
+
+%% Opublikowano przez \href{http://nowoczesnapolska.org.pl}{Fundację Nowoczesna Polska}, 2012.
+
+%% \editors
+
+%% %\vspace{.6em}
+%% \coverby
+
+%% \color{black}
+%% }
+%% \end{figure}
+\clearpage
}
\subsection*{\typosubsubsection{#1}}%
}
+\newcommand{\podtytulpodutworu}[1]{%
+\subsection*{\typosubsubsection{#1}}%
+}
+
\newcommand{\translator}[1]{%
\subsection*{\typosubsubsection{tłum. #1}}%
}
\vspace{.6em}
</xsl:if>}
\def\description{<xsl:apply-templates select=".//dc:description" mode="inline" />}
+ \def\editors{<xsl:call-template name="editors" />}
</TeXML>
</xsl:template>
# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
#
from librarian.book2anything import Book2Anything, Option
+import os.path
+from optparse import OptionParser
class Book2Pdf(Book2Anything):