From: Marcin Koziej Date: Wed, 7 Aug 2013 10:03:14 +0000 (+0200) Subject: Merge changes from master to Aigrain publishing code - that will be used for new... X-Git-Url: https://git.mdrn.pl/librarian.git/commitdiff_plain/f318053fb3349c5364cfb866b2a3d33c2423e12a?hp=b56beb67ff25d7a6ae42c841b9f10e681a748e22 Merge changes from master to Aigrain publishing code - that will be used for new publishing code for few publications Summer/Autumn 2013 --- diff --git a/librarian/cover.py b/librarian/cover.py index 8b770ca..dfd451b 100644 --- a/librarian/cover.py +++ b/librarian/cover.py @@ -258,7 +258,6 @@ class WLCover(Cover): 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 diff --git a/librarian/dcparser.py b/librarian/dcparser.py index eddd8e5..3e6ac1b 100644 --- a/librarian/dcparser.py +++ b/librarian/dcparser.py @@ -163,7 +163,7 @@ class WorkInfo(object): __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), @@ -181,7 +181,7 @@ class WorkInfo(object): 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'), ) diff --git a/librarian/epub.py b/librarian/epub.py index eab2b18..223bde9 100644 --- a/librarian/epub.py +++ b/librarian/epub.py @@ -446,10 +446,10 @@ def transform(wldoc, verbose=False, 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')) diff --git a/librarian/epub/cover.html b/librarian/epub/cover.html index 784067c..3233201 100644 --- a/librarian/epub/cover.html +++ b/librarian/epub/cover.html @@ -2,12 +2,12 @@ - Okładka + Cover
- Okładka + Cover
\ No newline at end of file diff --git a/librarian/epub/toc.html b/librarian/epub/toc.html index 69d8724..1c2887d 100755 --- a/librarian/epub/toc.html +++ b/librarian/epub/toc.html @@ -2,10 +2,10 @@ - WolneLektury.pl + Future of Copyright -

Spis treści

+

Table of Contents

%s diff --git a/librarian/epub/xsltChunkTitle.xsl b/librarian/epub/xsltChunkTitle.xsl index 8c0e09a..1a997b6 100644 --- a/librarian/epub/xsltChunkTitle.xsl +++ b/librarian/epub/xsltChunkTitle.xsl @@ -16,7 +16,10 @@
- + + + +
@@ -37,4 +40,24 @@ + +

+ +

+
+ + +

+ +

+
+ + +

+ +

+
+ + + diff --git a/librarian/epub/xsltContent.xsl b/librarian/epub/xsltContent.xsl index 83eb376..eb14524 100644 --- a/librarian/epub/xsltContent.xsl +++ b/librarian/epub/xsltContent.xsl @@ -15,9 +15,9 @@ - + @@ -26,11 +26,10 @@ + diff --git a/librarian/epub/xsltLast.xsl b/librarian/epub/xsltLast.xsl index 9b52203..f6802d8 100644 --- a/librarian/epub/xsltLast.xsl +++ b/librarian/epub/xsltLast.xsl @@ -81,6 +81,13 @@

+
+ Logo 1% +
Przekaż 1% podatku na rozwój Wolnych Lektur.
+
Nazwa organizacji: Fundacja Nowoczesna Polska
+
KRS 0000070056
+
+

 

Plik wygenerowany dnia . @@ -103,6 +110,10 @@ + +
+
+ diff --git a/librarian/epub/xsltScheme-FoC.xsl b/librarian/epub/xsltScheme-FoC.xsl new file mode 100755 index 0000000..e5c36e3 --- /dev/null +++ b/librarian/epub/xsltScheme-FoC.xsl @@ -0,0 +1,55 @@ + + + + + + + + + + + + + Future of Copyright + + + + + book-text + +

Dear readers!

+ +

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.

+ +

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”.

+ +

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.

+ +

Modern Poland Foundation Team

+ +

+Modern Poland Foundation +

+ +

http://nowoczesnapolska.org.pl

+ + + + + + \ No newline at end of file diff --git a/librarian/epub/xsltScheme.xsl b/librarian/epub/xsltScheme.xsl index 3ddcf97..e8a5af6 100644 --- a/librarian/epub/xsltScheme.xsl +++ b/librarian/epub/xsltScheme.xsl @@ -10,7 +10,7 @@ - WolneLektury.pl + Future of Copyright @@ -18,8 +18,10 @@ book-text - - + + + + @@ -122,14 +124,14 @@ - +

- +

diff --git a/librarian/epub/xsltTitle.xsl b/librarian/epub/xsltTitle.xsl index 17739a8..cc006f2 100644 --- a/librarian/epub/xsltTitle.xsl +++ b/librarian/epub/xsltTitle.xsl @@ -14,7 +14,7 @@ - <xsl:text>Strona tytułowa</xsl:text> + <xsl:text>Title page</xsl:text> @@ -40,7 +40,7 @@

[Kopia robocza]

- +

+ + Thank you for your contribution, ! + Thank you for all your contributions! + +
You made this book possible. +

+ + + diff --git a/librarian/functions.py b/librarian/functions.py index 523b3d5..e8758f0 100644 --- a/librarian/functions.py +++ b/librarian/functions.py @@ -19,7 +19,8 @@ def reg_substitute_entities(): (u'---', u'—'), (u'--', u'–'), (u'...', u'…'), - (u',,', u'„'), + #(u',,', u'„'), + (u',,', u'“'), (u'"', u'”'), ] diff --git a/librarian/mobi.py b/librarian/mobi.py index d98b838..99b724e 100644 --- a/librarian/mobi.py +++ b/librarian/mobi.py @@ -31,11 +31,11 @@ def transform(wldoc, verbose=False, 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) diff --git a/librarian/pdf/wl.cls b/librarian/pdf/wl.cls index 4a7648e..cb53a3f 100644 --- a/librarian/pdf/wl.cls +++ b/librarian/pdf/wl.cls @@ -14,6 +14,9 @@ \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/ @@ -61,13 +64,14 @@ \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} @@ -138,7 +142,8 @@ Letters={SmallCaps,UppercaseSmallCaps} \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} @@ -149,9 +154,12 @@ Letters={SmallCaps,UppercaseSmallCaps} \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 @@ -192,8 +200,29 @@ Letters={SmallCaps,UppercaseSmallCaps} \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} } @@ -226,56 +255,157 @@ Letters={SmallCaps,UppercaseSmallCaps} } } +\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 } @@ -326,6 +456,10 @@ Letters={Uppercase} \subsection*{\typosubsubsection{#1}}% } +\newcommand{\podtytulpodutworu}[1]{% +\subsection*{\typosubsubsection{#1}}% +} + \newcommand{\translator}[1]{% \subsection*{\typosubsubsection{tłum. #1}}% } diff --git a/librarian/pdf/wl2tex.xslt b/librarian/pdf/wl2tex.xslt index 97296e9..d3b8faf 100644 --- a/librarian/pdf/wl2tex.xslt +++ b/librarian/pdf/wl2tex.xslt @@ -165,6 +165,7 @@ \vspace{.6em}
} \def\description{} + \def\editors{}
diff --git a/scripts/book2pdf b/scripts/book2pdf index 68e2d08..11c5c04 100755 --- a/scripts/book2pdf +++ b/scripts/book2pdf @@ -5,6 +5,8 @@ # 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):