From: Marcin Koziej Date: Tue, 27 Aug 2013 12:41:08 +0000 (+0200) Subject: after FoC 2 release + fixed footnotes in section headings X-Git-Url: https://git.mdrn.pl/librarian.git/commitdiff_plain/0f3e12398ddbbb07a71eeafb3f960631777cabdc?hp=75abfdc7e8f14937b825a1502bb564fe2063ced4 after FoC 2 release + fixed footnotes in section headings --- diff --git a/librarian/book2anything.py b/librarian/book2anything.py index b8b8d27..cf3c49d 100755 --- a/librarian/book2anything.py +++ b/librarian/book2anything.py @@ -10,7 +10,7 @@ import optparse from librarian import DirDocProvider, ParseError from librarian.parser import WLDocument -from librarian.cover import WLCover +from librarian.cover import WLCover, FutureOfCopyrightCover class Option(object): @@ -100,10 +100,10 @@ class Book2Anything(object): if cls.uses_cover: if options.image_cache: def cover_class(*args, **kwargs): - return WLCover(image_cache=options.image_cache, *args, **kwargs) + return FutureOfCopyrightCover(image_cache=options.image_cache, *args, **kwargs) transform_args['cover'] = cover_class elif not cls.cover_optional or options.with_cover: - transform_args['cover'] = WLCover + transform_args['cover'] = FutureOfCopyrightCover # Do some real work diff --git a/librarian/cover.py b/librarian/cover.py index dfd451b..ff01841 100644 --- a/librarian/cover.py +++ b/librarian/cover.py @@ -435,3 +435,12 @@ class GandalfCover(Cover): logo_bottom = 25 logo_width = 250 format = 'PNG' + +class FutureOfCopyrightCover(Cover): + width = 420 + height = 595 + background_img = 'cover.png' + format = 'PNG' + + def save(self, dest): + dest.write(open(self.background_img).read()) diff --git a/librarian/epub.py b/librarian/epub.py index 17550b2..fcc2bfe 100644 --- a/librarian/epub.py +++ b/librarian/epub.py @@ -17,7 +17,7 @@ from tempfile import mkdtemp, NamedTemporaryFile from shutil import rmtree from librarian import RDFNS, WLNS, NCXNS, OPFNS, XHTMLNS, OutputFile -from librarian.cover import WLCover +from librarian.cover import WLCover, FutureOfCopyrightCover from librarian import functions, get_resource @@ -355,7 +355,7 @@ def transform(wldoc, verbose=False, zip.writestr('OPS/title.html', etree.tostring(html_tree, method="html", pretty_print=True)) # add a title page TOC entry - toc.add(u"Strona tytułowa", "title.html") + toc.add(u"Title", "title.html") elif wldoc.book_info.parts: # write title page for every parent if sample is not None and sample <= 0: @@ -436,6 +436,7 @@ def transform(wldoc, verbose=False, 'media-type="application/oebps-package+xml" />' \ '') zip.write(get_resource('res/wl-logo-small.png'), os.path.join('OPS', 'logo_wolnelektury.png')) + zip.write(get_resource('res/logo.png'), os.path.join('OPS', 'logo.png')) zip.write(get_resource('res/jedenprocent.png'), os.path.join('OPS', 'jedenprocent.png')) if not style: style = get_resource('epub/style.css') @@ -443,7 +444,7 @@ def transform(wldoc, verbose=False, if cover: if cover is True: - cover = WLCover + cover = FutureOfCopyrightCover cover_file = StringIO() c = cover(document.book_info) @@ -453,11 +454,11 @@ def transform(wldoc, verbose=False, del cover_file cover_tree = etree.parse(get_resource('epub/cover.html')) - cover_tree.find('//' + XHTMLNS('img')).set('src', cover_name) + cover_tree.find('//' + XHTMLNS('img')).set('src', c_name) zip.writestr('OPS/cover.html', etree.tostring( cover_tree, method="html", pretty_print=True)) - if bound_cover.uses_dc_cover: + if c.uses_dc_cover: if document.book_info.cover_by: document.edoc.getroot().set('data-cover-by', document.book_info.cover_by) if document.book_info.cover_source: @@ -466,11 +467,12 @@ def transform(wldoc, verbose=False, manifest.append(etree.fromstring( '')) manifest.append(etree.fromstring( - '' % (cover_name, bound_cover.mime_type()))) + '' % (c_name, c.mime_type()))) spine.insert(0, etree.fromstring('')) opf.getroot()[0].append(etree.fromstring('')) guide.append(etree.fromstring('')) - + + annotations = etree.Element('annotations') @@ -481,21 +483,28 @@ def transform(wldoc, verbose=False, '') nav_map = toc_file[-1] + manifest.append(etree.fromstring( + '')) + spine.append(etree.fromstring( + '')) + zip.writestr('OPS/intro.html', open(get_resource('epub/intro.html')).read()) + + if html_toc: manifest.append(etree.fromstring( '')) spine.append(etree.fromstring( '')) - guide.append(etree.fromstring('')) + guide.append(etree.fromstring('')) toc, chunk_counter, chars, sample = transform_file(document, sample=sample) if len(toc.children) < 2: - toc.add(u"Początek utworu", "part1.html") + toc.add(u"Beginning of the book", "part1.html") # Last modifications in container files and EPUB creation if len(annotations) > 0: - toc.add("Przypisy", "annotations.html") + toc.add("Footnotes", "annotations.html") manifest.append(etree.fromstring( '')) spine.append(etree.fromstring( @@ -515,7 +524,7 @@ def transform(wldoc, verbose=False, # chars.update(used_chars(etree.fromstring(html_string))) # zip.writestr('OPS/support.html', html_string) - toc.add("Strona redakcyjna", "last.html") + toc.add("Editors", "last.html") manifest.append(etree.fromstring( '')) spine.append(etree.fromstring( @@ -563,7 +572,7 @@ def transform(wldoc, verbose=False, # write TOC if html_toc: - toc.add(u"Spis treści", "toc.html", index=1) + toc.add(u"Table of Contents", "toc.html", index=1) zip.writestr('OPS/toc.html', toc.html().encode('utf-8')) toc.write_to_xml(nav_map) zip.writestr('OPS/toc.ncx', etree.tostring(toc_file, pretty_print=True)) diff --git a/librarian/epub/cover.html b/librarian/epub/cover.html index 3233201..4c820b5 100644 --- a/librarian/epub/cover.html +++ b/librarian/epub/cover.html @@ -10,4 +10,4 @@ Cover - \ No newline at end of file + diff --git a/librarian/epub/intro.html b/librarian/epub/intro.html new file mode 100644 index 0000000..9115e16 --- /dev/null +++ b/librarian/epub/intro.html @@ -0,0 +1,44 @@ + + + + + Cover + + + +
+ +

Dear readers!

+ +

It is our great pleasure to present the anthology of the second edition of the Future of Copyright Contest organized by Modern Poland Foundation.
These works have been selected by our jury: Beatriz Busaniche (Via Libre Foundation, Wikimedia Argentina, University of Buenos Aires), Shun-Ling Chen (University of Arizona James E. Rogers College of Law), Mike Linksvayer (Creative Commons, OpenHatch and Software Freedom Conservanc, Open Definition Advisory Council) Joe McNamee (EDRi), Jérémie Zimmermann (La Quadrature du Net) and Jarosław Lipszyc (Modern Poland Foundation).

+ +

We are proud to announce that the first prize goes to Talllama, the author of A Penny for Your Thoughts As our jurors noticed:

+ + +

"it is engagingly written and fun to read transposition of exactly today's copyright and debates (including wild mischaracterization) into a future with mind uploading. The idea of having all our thoughts fixed and therefore protected by copyright is a smart way of showing how ridiculous the current situation is."

+ + +

Talllama and all competitors - thank you for your contribution to the copyright debate.

+ + +

We also would like to thank all for crowd-funding support and funding the prize for the winner via the Indiegogo platform.

+ + +

The picture used on the cover is a remix based on Leonardo da Vinci's Lady with an Ermine and Johannes Vermeer's Girl with a Pearl Earring (remix by Radek Czajka, license: CC-BY-SA). The Modern Poland Foundation was involved in the discussion with the Polish Ministry of Culture and National Heritage about the rights to use the image and the name of da Vinci's painting. Although Lady with an Ermine was painted even before the creation of the idea of copyright and is in the public domain since the moment when it started to function, one of the Polish foundations wanted to sell the rights to this painting. The Modern Poland Foundation publicly defended the right to re-use and remix this work of art.

+

Enjoy!

+ +

You can find best works submitted to the first edition of The Future of Copyright Contest here: +prawokultury.pl/en/publications/future-copyright-2012/ +

+ + +

Modern Poland Foundation Team

+ +

+Modern Poland Foundation +

+ +

http://nowoczesnapolska.org.pl

+
+ + diff --git a/librarian/epub/xsltLast.xsl b/librarian/epub/xsltLast.xsl index f6802d8..bb83777 100644 --- a/librarian/epub/xsltLast.xsl +++ b/librarian/epub/xsltLast.xsl @@ -15,82 +15,53 @@ - <xsl:text>Strona redakcyjna</xsl:text> + <xsl:text>Credits</xsl:text>
-

- - - Ten utwór jest udostepniony na licencji - - - - - - - - - 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. - - -

+ + +

The Future of Copyright 2.0 Contest is a~part of Future of Copyright Project supported by Trust for Civil Society in Central and Eastern Europe

+ + + +

This book is available under the terms of Creative Commons Attribution-ShareAlike 3.0 Unported License (read more: +http://creativecommons.org/licenses/by-sa/3.0/)
+Published by Modern Poland Foundation, Warsaw 2013

+ +

Technical editor: Paulina Choromańska
+Book design: Jakub Waluchowski
+Typography: Marcin Koziej

+ +

Modern Poland Fundation
+Marszalkowska St. 84/92 app. 125
+00-514 Warsaw
+tel/fax: +48 22 621-30-17
+email: fundacja@nowoczesnapolska.org.pl
+

+ + +

If you wish to support our projects, feel free to make a~donation via our secure online payment service: +PLN or USD + or direct payment account number: 59 1030 0019 0109 8530 0040 5685

+ +

Thank you for your support.

+ + + + -

Źródło: - - - - - , - - -

- - -

Tekst opracowany na podstawie:

-
- - -

-
- - - - -

Okładka na podstawie: - - - - - - - - - - - - - -

-
- -
+

 

- Plik wygenerowany dnia . + Generated on .

diff --git a/librarian/epub/xsltScheme.xsl b/librarian/epub/xsltScheme.xsl index 52da004..c3eb9fe 100644 --- a/librarian/epub/xsltScheme.xsl +++ b/librarian/epub/xsltScheme.xsl @@ -16,6 +16,7 @@ book-text + @@ -86,6 +87,9 @@ + + +

diff --git a/librarian/fonts/ArchivoBlack-Regular.otf b/librarian/fonts/ArchivoBlack-Regular.otf new file mode 100644 index 0000000..547b2c7 Binary files /dev/null and b/librarian/fonts/ArchivoBlack-Regular.otf differ diff --git a/librarian/fonts/ArchivoNarrow-Bold.otf b/librarian/fonts/ArchivoNarrow-Bold.otf new file mode 100644 index 0000000..13868ff Binary files /dev/null and b/librarian/fonts/ArchivoNarrow-Bold.otf differ diff --git a/librarian/fonts/ArchivoNarrow-BoldItalic.otf b/librarian/fonts/ArchivoNarrow-BoldItalic.otf new file mode 100644 index 0000000..81c7fcf Binary files /dev/null and b/librarian/fonts/ArchivoNarrow-BoldItalic.otf differ diff --git a/librarian/fonts/ArchivoNarrow-Italic.otf b/librarian/fonts/ArchivoNarrow-Italic.otf new file mode 100644 index 0000000..ebec528 Binary files /dev/null and b/librarian/fonts/ArchivoNarrow-Italic.otf differ diff --git a/librarian/fonts/ArchivoNarrow-Regular.otf b/librarian/fonts/ArchivoNarrow-Regular.otf new file mode 100644 index 0000000..ccec965 Binary files /dev/null and b/librarian/fonts/ArchivoNarrow-Regular.otf differ diff --git a/librarian/mobi.py b/librarian/mobi.py index 99b724e..491b5ee 100644 --- a/librarian/mobi.py +++ b/librarian/mobi.py @@ -34,7 +34,7 @@ def transform(wldoc, verbose=False, c = cover(book_info) c.save(cover_file) - if bound_cover.uses_dc_cover: + if c.uses_dc_cover: if document.remobook_info.cover_by: document.edoc.getroot().set('data-cover-by', document.book_info.cover_by) if document.book_info.cover_source: @@ -57,4 +57,4 @@ def transform(wldoc, verbose=False, subprocess.check_call(['ebook-convert', epub.get_filename(), output_file.name, '--no-inline-toc', '--cover=%s' % cover_file.name], **kwargs) os.unlink(cover_file.name) - return OutputFile.from_filename(output_file.name) \ No newline at end of file + return OutputFile.from_filename(output_file.name) diff --git a/librarian/pdf/wlpub.cls b/librarian/pdf/wlpub.cls index 5c2265e..f2d3b36 100644 --- a/librarian/pdf/wlpub.cls +++ b/librarian/pdf/wlpub.cls @@ -13,6 +13,7 @@ % nowlfont - don't use customized WL font %\RequirePackage{geometry} + \RequirePackage{setspace} \RequirePackage{type1cm} \RequirePackage{amssymb} @@ -20,6 +21,7 @@ \RequirePackage{paralist} \RequirePackage[normalem]{ulem} \RequirePackage{xifthen} + %\DeclareOption{13pt}{% %\AtEndOfClass{% % font size definitions, similar to ones in /usr/share/texmf-texlive/tex/latex/base/ @@ -93,12 +95,14 @@ \usepackage[colorlinks=true,linkcolor=black,setpagesize=false,urlcolor=black,xetex]{hyperref} \usepackage{fancyhdr} \usepackage[explicit]{titlesec} -\usepackage{fnpos} +%\usepackage{fnpos} \usepackage{printlen} \usepackage{calc} +\usepackage[stable]{footmisc} + \pagestyle{plain} % bottom figure below footnotes -\makeFNabove +%\makeFNabove %%%%%%%%%%%%%%%%%%%%%%% Paper size @@ -151,7 +155,7 @@ Mapping=tex-text } \makeatother -\setlength{\parindent}{4mm} +\setlength{\parindent}{3mm} \setlength{\parskip}{0mm} \renewcommand{\normalsize}{\fontsize{10.4}{14.28}\addfontfeature{LetterSpace=0.3}\selectfont} @@ -203,14 +207,16 @@ Mapping=tex-text %% Sections \titleformat{\section}% {\addfontfeature{LetterSpace=0.3}\large}% -{\thesection}{.5em}{\MakeUppercase{#1}} +{\thesection{}.}{.5em}{\MakeUppercase{#1}} \renewcommand{\thesection}{\Roman{section}} -\titleformat{\subsection}% +\titleformat{\subsection}[runin]% {}% -{\thesubsection}{0pt}{\fakesc{#1}} +{\thesubsection{}.}{.5em}{\MakeUppercase{#1}.}[] +\renewcommand{\thesubsection}{\Alph{subsection}} +\titlespacing*{\subsection}{0pt}{0pt}{.5em} \newcommand{\typosubsubsection}[1]{% {\textsc{#1}} @@ -227,24 +233,29 @@ Mapping=tex-text } %%%%%%%%%%%%%%%%%% ^^ -%%%%% Footnotes %%%%%%%% +%%%%% Footnotes (works with footmisc) %%%%%%%% \newlength{\footnoteindent}\newlength{\footnoteprespace} \setlength{\footnoteindent}{6mm}%{3.5mm} -\setlength{\footnoteprespace}{.3em} +\setlength{\footnoteprespace}{0em} \makeatletter \renewcommand\@makefnmark{% -\hspace{\footnoteprespace}\hbox{{\normalfont \@thefnmark}}% +\hspace{\footnoteprespace} +\hbox{{\normalfont \@thefnmark}}% } \renewcommand\thefootnote{[\arabic{footnote}]} -\long\def\@makefntext#1{% -\setlength{\leftskip}{\footnoteindent}% -\setlength{\hskip}{-\footnoteindent-\footnoteprespace-.1em}% -\hb@xt@ \dimexpr\footnoteindent+\footnoteprespace% -{\@makefnmark}#1 -% \parindent 1em\noindent \hb@xt@ 1.8em{\hss \@makefnmark \enskip}#1 -} +\setlength{\footnotemargin}{-\footnoteindent-\footnoteprespace-.3em} +\renewcommand\footnotelayout[1]{% + \setlength{\leftskip}{\footnoteindent}#1} + +%% \long\def\@makefntext#1{% +%% \setlength{\leftskip}{\footnoteindent}% +%% \setlength{\hskip}{-\footnoteindent-\footnoteprespace-.1em}% +%% \hb@xt@ \dimexpr\footnoteindent+\footnoteprespace% +%% {\@makefnmark}#1 +%% % \parindent 1em\noindent \hb@xt@ 1.8em{\hss \@makefnmark \enskip}#1 +%% } \def\trimspace#1{\trim@spaces{#1}} @@ -267,8 +278,7 @@ Mapping=tex-text \raisebox{0pt}[0pt][0pt]{\makebox[0pt][r]{\usebox{\xglyphbox}}}} -\newcommand{\makecover}[2]{ - +\newcommand{\makecover}{ %\pdfpagewidth=#1 %\pdfpageheight=#2 @@ -292,15 +302,11 @@ Mapping=tex-text \raisebox{\PictVOffset}[0pt][0pt]{\makebox[0pt][l]{% \includegraphics[height=\paperheight,width=\paperwidth]{cover.jpg}}} - } - - \renewcommand{\maketitle}{ - \newpage %\vspace{\paperheight} - + \newpage \thispagestyle{empty} \begin{center} \intro @@ -311,28 +317,31 @@ Mapping=tex-text } \end{center} - \vspace{2em} + \vspace{\baselineskip} \begin{center} \intro { - \huge \noindent \theauthor + \huge \noindent + \theauthor + } \end{center} %\emph{\thankyou}\\ %\indent\emph{You made this book possible.} - \vspace{16em} + \vspace{7\baselineskip} \begin{center} \includegraphics[scale=.2]{logo.eps} \end{center} - + } \newcommand{\editorialsection}{ \newpage \thispagestyle{empty} + \input{editorial} } \renewcommand*\contentsname{Table of Contents} @@ -395,9 +404,9 @@ Mapping=tex-text \newcommand{\nota}[1]{% \begin{em}% -\begin{flushright}% -#1% -\end{flushright}% +\begin{flushleft}% +\noindent #1% +\end{flushleft}% \end{em}% } @@ -453,7 +462,7 @@ Mapping=tex-text \part{#1}% } \newcommand{\srodtytul}[1]{% -\subsection*{\typosubsection{#1}}% +\subsection{#1}% } \newcommand{\naglowekscena}[1]{% @@ -463,7 +472,7 @@ Mapping=tex-text \newcommand{\theautorrozdzialu}{} \newcommand{\autorrozdzialu}[1]{% -\renewcommand{\theautorrozdzialu}{\newline\newline#1} +\renewcommand{\theautorrozdzialu}{\newline{}{\normalfont by}\newline#1} } \newcommand{\naglowekrozdzial}[1]{% @@ -604,5 +613,5 @@ Mapping=tex-text } \newcommand{\link}[2]{\href{#1}{\uline{#2}\footnote{#1}}} -\newcommand{\www}[1]{{\normalfont\small\url{#1}}} +\newcommand{\www}[1]{{\normalfont\small\href{#1}{#1}}} diff --git a/librarian/res/cover.png b/librarian/res/cover.png index 0a1511e..b1cbc7f 100644 Binary files a/librarian/res/cover.png and b/librarian/res/cover.png differ