From: Radek Czajka Date: Tue, 8 Oct 2013 10:04:25 +0000 (+0200) Subject: Add thank-you note in EPUB and PDF. X-Git-Tag: 1.7~127 X-Git-Url: https://git.mdrn.pl/librarian.git/commitdiff_plain/ac6f4dfb3c4e7ac8b22ab56390e61634a8152df6 Add thank-you note in EPUB and PDF. --- diff --git a/librarian/dcparser.py b/librarian/dcparser.py index abee11b..a907a52 100644 --- a/librarian/dcparser.py +++ b/librarian/dcparser.py @@ -173,6 +173,7 @@ class WorkInfo(object): as_person, salias='technical_editor', multiple=True, default=[]), Field( DCNS('contributor.funding'), 'funders', salias='funder', multiple=True, default=[]), + Field( DCNS('contributor.thanks'), 'thanks', required=False), Field( DCNS('date'), 'created_at', as_date), Field( DCNS('date.pd'), 'released_to_public_domain_at', as_date, required=False), diff --git a/librarian/epub.py b/librarian/epub.py index f211ee4..bfd7570 100644 --- a/librarian/epub.py +++ b/librarian/epub.py @@ -418,6 +418,8 @@ def transform(wldoc, verbose=False, if document.book_info.funders: document.edoc.getroot().set('funders', u', '.join( document.book_info.funders)) + if document.book_info.thanks: + document.edoc.getroot().set('thanks', document.book_info.thanks) opf = xslt(document.book_info.to_etree(), get_resource('epub/xsltContent.xsl')) manifest = opf.find('.//' + OPFNS('manifest')) diff --git a/librarian/epub/xsltTitle.xsl b/librarian/epub/xsltTitle.xsl index 17739a8..9544e27 100644 --- a/librarian/epub/xsltTitle.xsl +++ b/librarian/epub/xsltTitle.xsl @@ -52,6 +52,10 @@

+ +

.

+
+

Utwór opracowany został w ramach projektu Wolne Lektury przez fundację Nowoczesna Polska.

diff --git a/librarian/pdf.py b/librarian/pdf.py index 90e4dc2..b4edfdb 100644 --- a/librarian/pdf.py +++ b/librarian/pdf.py @@ -233,6 +233,8 @@ def transform(wldoc, verbose=False, save_tex=None, morefloats=None, editor.readable() for editor in document.editors()))) if document.book_info.funders: root.set('funders', u', '.join(document.book_info.funders)) + if document.book_info.thanks: + root.set('thanks', document.book_info.thanks) # hack the tree move_motifs_inside(document.edoc) diff --git a/librarian/pdf/wl.cls b/librarian/pdf/wl.cls index 0de767c..a9ace8e 100644 --- a/librarian/pdf/wl.cls +++ b/librarian/pdf/wl.cls @@ -215,6 +215,11 @@ Letters={SmallCaps,UppercaseSmallCaps} \vspace{.5em} \fi + \ifdefined\thanknote + \thanknote + \vspace{.5em} + \fi + Utwór opracowany został w ramach projektu \href{http://www.wolnelektury.pl/}{Wolne Lektury} przez \href{http://nowoczesnapolska.org.pl}{fundację Nowoczesna Polska}. diff --git a/librarian/pdf/wl2tex.xslt b/librarian/pdf/wl2tex.xslt index 353ecf9..ca948da 100644 --- a/librarian/pdf/wl2tex.xslt +++ b/librarian/pdf/wl2tex.xslt @@ -64,6 +64,11 @@ 210mm + + + \def\thanknote{} + +