after FoC 2 release + fixed footnotes in section headings
authorMarcin Koziej <marcinkoziej@nowoczesnapolska.org.pl>
Tue, 27 Aug 2013 12:41:08 +0000 (14:41 +0200)
committerMarcin Koziej <marcinkoziej@nowoczesnapolska.org.pl>
Tue, 27 Aug 2013 12:41:08 +0000 (14:41 +0200)
15 files changed:
librarian/book2anything.py
librarian/cover.py
librarian/epub.py
librarian/epub/cover.html
librarian/epub/intro.html [new file with mode: 0644]
librarian/epub/xsltLast.xsl
librarian/epub/xsltScheme.xsl
librarian/fonts/ArchivoBlack-Regular.otf [new file with mode: 0644]
librarian/fonts/ArchivoNarrow-Bold.otf [new file with mode: 0644]
librarian/fonts/ArchivoNarrow-BoldItalic.otf [new file with mode: 0644]
librarian/fonts/ArchivoNarrow-Italic.otf [new file with mode: 0644]
librarian/fonts/ArchivoNarrow-Regular.otf [new file with mode: 0644]
librarian/mobi.py
librarian/pdf/wlpub.cls
librarian/res/cover.png

index b8b8d27..cf3c49d 100755 (executable)
@@ -10,7 +10,7 @@ import optparse
 
 from librarian import DirDocProvider, ParseError
 from librarian.parser import WLDocument
 
 from librarian import DirDocProvider, ParseError
 from librarian.parser import WLDocument
-from librarian.cover import WLCover
+from librarian.cover import WLCover, FutureOfCopyrightCover
 
 
 class Option(object):
 
 
 class Option(object):
@@ -100,10 +100,10 @@ class Book2Anything(object):
         if cls.uses_cover:
             if options.image_cache:
                 def cover_class(*args, **kwargs):
         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'] = cover_class
             elif not cls.cover_optional or options.with_cover:
-                transform_args['cover'] = WLCover
+                transform_args['cover'] = FutureOfCopyrightCover
 
 
         # Do some real work
 
 
         # Do some real work
index dfd451b..ff01841 100644 (file)
@@ -435,3 +435,12 @@ class GandalfCover(Cover):
     logo_bottom = 25
     logo_width = 250
     format = 'PNG'
     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())
index 17550b2..fcc2bfe 100644 (file)
@@ -17,7 +17,7 @@ from tempfile import mkdtemp, NamedTemporaryFile
 from shutil import rmtree
 
 from librarian import RDFNS, WLNS, NCXNS, OPFNS, XHTMLNS, OutputFile
 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
 
 
 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
             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:
         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" />' \
                        '</rootfiles></container>')
     zip.write(get_resource('res/wl-logo-small.png'), os.path.join('OPS', 'logo_wolnelektury.png'))
                        'media-type="application/oebps-package+xml" />' \
                        '</rootfiles></container>')
     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')
     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:
 
     if cover:
         if cover is True:
-            cover = WLCover
+            cover = FutureOfCopyrightCover
 
         cover_file = StringIO()
         c = cover(document.book_info)
 
         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'))
         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))
 
         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:
             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(
             '<item id="cover" href="cover.html" media-type="application/xhtml+xml" />'))
         manifest.append(etree.fromstring(
         manifest.append(etree.fromstring(
             '<item id="cover" href="cover.html" media-type="application/xhtml+xml" />'))
         manifest.append(etree.fromstring(
-            '<item id="cover-image" href="%s" media-type="%s" />' % (cover_name, bound_cover.mime_type())))
+            '<item id="cover-image" href="%s" media-type="%s" />' % (c_name, c.mime_type())))
         spine.insert(0, etree.fromstring('<itemref idref="cover" linear="no" />'))
         opf.getroot()[0].append(etree.fromstring('<meta name="cover" content="cover-image"/>'))
         guide.append(etree.fromstring('<reference href="cover.html" type="cover" title="Okładka"/>'))
         spine.insert(0, etree.fromstring('<itemref idref="cover" linear="no" />'))
         opf.getroot()[0].append(etree.fromstring('<meta name="cover" content="cover-image"/>'))
         guide.append(etree.fromstring('<reference href="cover.html" type="cover" title="Okładka"/>'))
-
+    
+              
 
     annotations = etree.Element('annotations')
 
 
     annotations = etree.Element('annotations')
 
@@ -481,21 +483,28 @@ def transform(wldoc, verbose=False,
                                '</navMap></ncx>')
     nav_map = toc_file[-1]
 
                                '</navMap></ncx>')
     nav_map = toc_file[-1]
 
+    manifest.append(etree.fromstring(
+        '<item id="intro" href="intro.html" media-type="application/xhtml+xml" />'))
+    spine.append(etree.fromstring(
+        '<itemref idref="intro" />'))
+    zip.writestr('OPS/intro.html', open(get_resource('epub/intro.html')).read())
+
+
     if html_toc:
         manifest.append(etree.fromstring(
             '<item id="html_toc" href="toc.html" media-type="application/xhtml+xml" />'))
         spine.append(etree.fromstring(
             '<itemref idref="html_toc" />'))
     if html_toc:
         manifest.append(etree.fromstring(
             '<item id="html_toc" href="toc.html" media-type="application/xhtml+xml" />'))
         spine.append(etree.fromstring(
             '<itemref idref="html_toc" />'))
-        guide.append(etree.fromstring('<reference href="toc.html" type="toc" title="Spis treści"/>'))
+        guide.append(etree.fromstring('<reference href="toc.html" type="toc" title="Table of Contents"/>'))
 
     toc, chunk_counter, chars, sample = transform_file(document, sample=sample)
 
     if len(toc.children) < 2:
 
     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:
 
     # 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(
             '<item id="annotations" href="annotations.html" media-type="application/xhtml+xml" />'))
         spine.append(etree.fromstring(
         manifest.append(etree.fromstring(
             '<item id="annotations" href="annotations.html" media-type="application/xhtml+xml" />'))
         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)
 
     # 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(
         '<item id="last" href="last.html" media-type="application/xhtml+xml" />'))
     spine.append(etree.fromstring(
     manifest.append(etree.fromstring(
         '<item id="last" href="last.html" media-type="application/xhtml+xml" />'))
     spine.append(etree.fromstring(
@@ -563,7 +572,7 @@ def transform(wldoc, verbose=False,
 
     # write TOC
     if html_toc:
 
     # 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))
         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))
index 3233201..4c820b5 100644 (file)
@@ -10,4 +10,4 @@
       <img alt="Cover" />
     </div>
   </body>
       <img alt="Cover" />
     </div>
   </body>
-</html>
\ No newline at end of file
+</html>
diff --git a/librarian/epub/intro.html b/librarian/epub/intro.html
new file mode 100644 (file)
index 0000000..9115e16
--- /dev/null
@@ -0,0 +1,44 @@
+<!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>Cover</title>
+    <style type="text/css"> img { max-width: 100%; } </style>
+  </head>
+  <body style="oeb-column-number: 1;">
+    <div id="body-text">
+
+<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 the anthology of the second edition of the Future of Copyright Contest organized by Modern Poland Foundation. <br/>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).</p>
+
+<p xmlns="http://www.w3.org/1999/xhtml" class="paragraph"> We are proud to announce that the first prize goes to <wyroznienie>Talllama</wyroznienie>, the author of <i xmlns="http://www.w3.org/1999/xhtml">A Penny for Your Thoughts</i> As our jurors noticed:</p>
+
+
+<p xmlns="http://www.w3.org/1999/xhtml" class="paragraph"><i>"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."</i></p>
+
+
+<p xmlns="http://www.w3.org/1999/xhtml" class="paragraph">Talllama and all competitors - thank you for your contribution to the copyright debate.</p>
+
+
+<p xmlns="http://www.w3.org/1999/xhtml" class="paragraph">We also would like to thank all for crowd-funding support and funding the prize for the winner via the <a xmlns="http://www.w3.org/1999/xhtml" href="http://www.indiegogo.com/projects/future-of-copyright-contest-2-0">Indiegogo</a> platform.</p>
+
+
+<p xmlns="http://www.w3.org/1999/xhtml" class="paragraph">The picture used on the cover is a remix based on Leonardo da Vinci's <tytul_dziela>Lady with an Ermine</tytul_dziela> and Johannes Vermeer's <tytul_dziela>Girl with a Pearl Earring</tytul_dziela> (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 <tytul_dziela>Lady with an Ermine</tytul_dziela> 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.</p>
+<p xmlns="http://www.w3.org/1999/xhtml" class="paragraph">Enjoy!</p>
+
+<p xmlns="http://www.w3.org/1999/xhtml" class="paragraph">You can find best works submitted to the first edition of The Future of Copyright Contest here:
+<a xmlns="http://www.w3.org/1999/xhtml" href="http://prawokultury.pl/en/publications/future-copyright-2012/">prawokultury.pl/en/publications/future-copyright-2012/</a>
+</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>
+    </div>
+  </body>
+</html>
index f6802d8..bb83777 100644 (file)
         <link rel="stylesheet" href="style.css" type="text/css" />
         <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
         <title>
         <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>
+          <xsl:text>Credits</xsl:text>
         </title>
       </head>
       <body>
         <div id="book-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>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</p>
+
+<!-- \includegraphics[scale=.2]<p>trust.eps} -->
+
+<p>This book is available under the terms of Creative Commons Attribution-ShareAlike 3.0 Unported License (read more:
+<a href="http://creativecommons.org/licenses/by-sa/3.0/">http://creativecommons.org/licenses/by-sa/3.0/</a>) <br/>
+Published by Modern Poland Foundation, Warsaw 2013 </p>
+
+<p>Technical editor: Paulina Choromańska <br/>
+Book design: Jakub Waluchowski<br/>
+Typography: Marcin Koziej </p>
+
+<p>Modern Poland Fundation <br/>
+Marszalkowska St. 84/92 app. 125 <br/>
+00-514 Warsaw <br/>
+tel/fax: +48 22 621-30-17 <br/>
+email: fundacja@nowoczesnapolska.org.pl <br/> 
+</p>
+
+<p>If you wish to support our projects, feel free to make a~donation via our secure online payment service: 
+<a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&amp;hosted_button_id=L2CLCXHZCWYJN">PLN</a> or <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&amp;hosted_button_id=XVC8XD7DBGV6N">USD</a>
+ or direct payment account number: 59 1030 0019 0109 8530 0040 5685 </p>
+
+<p> Thank you for your support.</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" />
-
-          <xsl:if test="@data-cover-by">
-            <p class="info">Okładka na podstawie: 
-            <xsl:choose>
-            <xsl:when test="@data-cover-source">
-                <a>
-                <xsl:attribute name="href">
-                  <xsl:value-of select="@data-cover-source" />
-                </xsl:attribute>
-                <xsl:value-of select="@data-cover-by" />
-                </a>
-            </xsl:when>
-            <xsl:otherwise>
-                <xsl:value-of select="@data-cover-by" />
-            </xsl:otherwise>
-            </xsl:choose>
-            </p>
-          </xsl:if>
-
-          <div class="info">
+<!--          <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>
           <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>
+          </div>-->
 
           <p class="info">&#160;</p>
           <p class="minor info">
 
           <p class="info">&#160;</p>
           <p class="minor info">
-              Plik wygenerowany dnia <span id="file_date"><xsl:value-of select="substring(date:date(), 1, 10)" /></span>.
+              Generated on <span id="file_date"><xsl:value-of select="substring(date:date(), 1, 10)" /></span>.
           </p>
 
         </div>
           </p>
 
         </div>
index 52da004..c3eb9fe 100644 (file)
@@ -16,6 +16,7 @@
       <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: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="//dzielo_nadrzedne" mode="poczatek"/>
           <xsl:if test="//nazwa_utworu">
             <!--h1 xmlns="http://www.w3.org/1999/xhtml"-->
               <xsl:apply-templates select="//dzielo_nadrzedne" mode="poczatek"/>
@@ -86,6 +87,9 @@
   </xsl:template>
 
   <xsl:template match="autor_utworu" />
   </xsl:template>
 
   <xsl:template match="autor_utworu" />
+  <xsl:template match="autor_rozdzialu">
+      <xsl:apply-templates />
+  </xsl:template>
 
   <xsl:template match="dzielo_nadrzedne" mode="poczatek">
     <h2 class="collection" xmlns="http://www.w3.org/1999/xhtml">
 
   <xsl:template match="dzielo_nadrzedne" mode="poczatek">
     <h2 class="collection" xmlns="http://www.w3.org/1999/xhtml">
diff --git a/librarian/fonts/ArchivoBlack-Regular.otf b/librarian/fonts/ArchivoBlack-Regular.otf
new file mode 100644 (file)
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 (file)
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 (file)
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 (file)
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 (file)
index 0000000..ccec965
Binary files /dev/null and b/librarian/fonts/ArchivoNarrow-Regular.otf differ
index 99b724e..491b5ee 100644 (file)
@@ -34,7 +34,7 @@ def transform(wldoc, verbose=False,
     c = cover(book_info)
     c.save(cover_file)
 
     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:
         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)
     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)
index 5c2265e..f2d3b36 100644 (file)
@@ -13,6 +13,7 @@
 % nowlfont - don't use customized WL font
 
 %\RequirePackage{geometry}
 % nowlfont - don't use customized WL font
 
 %\RequirePackage{geometry}
+
 \RequirePackage{setspace}
 \RequirePackage{type1cm}
 \RequirePackage{amssymb}
 \RequirePackage{setspace}
 \RequirePackage{type1cm}
 \RequirePackage{amssymb}
@@ -20,6 +21,7 @@
 \RequirePackage{paralist}
 \RequirePackage[normalem]{ulem}
 \RequirePackage{xifthen}
 \RequirePackage{paralist}
 \RequirePackage[normalem]{ulem}
 \RequirePackage{xifthen}
+
 %\DeclareOption{13pt}{%
 %\AtEndOfClass{%
 % font size definitions, similar to ones in /usr/share/texmf-texlive/tex/latex/base/
 %\DeclareOption{13pt}{%
 %\AtEndOfClass{%
 % font size definitions, similar to ones in /usr/share/texmf-texlive/tex/latex/base/
 \usepackage[colorlinks=true,linkcolor=black,setpagesize=false,urlcolor=black,xetex]{hyperref}
 \usepackage{fancyhdr}
 \usepackage[explicit]{titlesec}
 \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{printlen}
 \usepackage{calc}
+\usepackage[stable]{footmisc}
+
 \pagestyle{plain}
 % bottom figure below footnotes
 \pagestyle{plain}
 % bottom figure below footnotes
-\makeFNabove
+%\makeFNabove
 
 
 %%%%%%%%%%%%%%%%%%%%%%% Paper size
 
 
 %%%%%%%%%%%%%%%%%%%%%%% Paper size
@@ -151,7 +155,7 @@ Mapping=tex-text
 }
 \makeatother
 
 }
 \makeatother
 
-\setlength{\parindent}{4mm}
+\setlength{\parindent}{3mm}
 \setlength{\parskip}{0mm}
 
 \renewcommand{\normalsize}{\fontsize{10.4}{14.28}\addfontfeature{LetterSpace=0.3}\selectfont}
 \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}%
 %% Sections
 \titleformat{\section}%
 {\addfontfeature{LetterSpace=0.3}\large}%
-{\thesection}{.5em}{\MakeUppercase{#1}}
+{\thesection{}.}{.5em}{\MakeUppercase{#1}}
 
 \renewcommand{\thesection}{\Roman{section}}
 
 
 \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}}
 
 \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}
 \newlength{\footnoteindent}\newlength{\footnoteprespace}
 \setlength{\footnoteindent}{6mm}%{3.5mm}
-\setlength{\footnoteprespace}{.3em}
+\setlength{\footnoteprespace}{0em}
 \makeatletter
 
 \renewcommand\@makefnmark{%
 \makeatletter
 
 \renewcommand\@makefnmark{%
-\hspace{\footnoteprespace}\hbox{{\normalfont \@thefnmark}}%
+\hspace{\footnoteprespace}
+\hbox{{\normalfont \@thefnmark}}%
 }
 \renewcommand\thefootnote{[\arabic{footnote}]}
 
 }
 \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}}
 
 
 \def\trimspace#1{\trim@spaces{#1}}
 
@@ -267,8 +278,7 @@ Mapping=tex-text
 \raisebox{0pt}[0pt][0pt]{\makebox[0pt][r]{\usebox{\xglyphbox}}}}
 
 
 \raisebox{0pt}[0pt][0pt]{\makebox[0pt][r]{\usebox{\xglyphbox}}}}
 
 
-\newcommand{\makecover}[2]{
-
+\newcommand{\makecover}{
   %\pdfpagewidth=#1
   %\pdfpageheight=#2
 
   %\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}}}
 
   \raisebox{\PictVOffset}[0pt][0pt]{\makebox[0pt][l]{%
       \includegraphics[height=\paperheight,width=\paperwidth]{cover.jpg}}}
 
-  
   }
 
   }
 
-
-
 \renewcommand{\maketitle}{
 \renewcommand{\maketitle}{
-  \newpage
   %\vspace{\paperheight}
   %\vspace{\paperheight}
-
+  \newpage
   \thispagestyle{empty}
   \begin{center}
   \intro
   \thispagestyle{empty}
   \begin{center}
   \intro
@@ -311,28 +317,31 @@ Mapping=tex-text
   }
   \end{center}
 
   }
   \end{center}
 
-  \vspace{2em}
+  \vspace{\baselineskip}
   
   \begin{center}
     \intro
     {
   
   \begin{center}
     \intro
     {
-    \huge \noindent \theauthor
+      \huge \noindent 
+      \theauthor
+      
     }
   \end{center}
                   %\emph{\thankyou}\\
                   %\indent\emph{You made this book possible.}
     }
   \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}
 
   \begin{center}
     \includegraphics[scale=.2]{logo.eps}
   \end{center}
-
+  
 }
 
 
 \newcommand{\editorialsection}{
   \newpage
   \thispagestyle{empty}
 }
 
 
 \newcommand{\editorialsection}{
   \newpage
   \thispagestyle{empty}
+  \input{editorial}
 }
 
 \renewcommand*\contentsname{Table of Contents}
 }
 
 \renewcommand*\contentsname{Table of Contents}
@@ -395,9 +404,9 @@ Mapping=tex-text
 
 \newcommand{\nota}[1]{%
 \begin{em}%
 
 \newcommand{\nota}[1]{%
 \begin{em}%
-\begin{flushright}%
-#1%
-\end{flushright}%
+\begin{flushleft}%
+\noindent #1%
+\end{flushleft}%
 \end{em}%
 }
 
 \end{em}%
 }
 
@@ -453,7 +462,7 @@ Mapping=tex-text
 \part{#1}%
 }
 \newcommand{\srodtytul}[1]{%
 \part{#1}%
 }
 \newcommand{\srodtytul}[1]{%
-\subsection*{\typosubsection{#1}}%
+\subsection{#1}%
 }
 
 \newcommand{\naglowekscena}[1]{%
 }
 
 \newcommand{\naglowekscena}[1]{%
@@ -463,7 +472,7 @@ Mapping=tex-text
 \newcommand{\theautorrozdzialu}{}
 
 \newcommand{\autorrozdzialu}[1]{%
 \newcommand{\theautorrozdzialu}{}
 
 \newcommand{\autorrozdzialu}[1]{%
-\renewcommand{\theautorrozdzialu}{\newline\newline#1}
+\renewcommand{\theautorrozdzialu}{\newline{}{\normalfont by}\newline#1}
 }
 
 \newcommand{\naglowekrozdzial}[1]{%
 }
 
 \newcommand{\naglowekrozdzial}[1]{%
@@ -604,5 +613,5 @@ Mapping=tex-text
 }
 \newcommand{\link}[2]{\href{#1}{\uline{#2}\footnote{#1}}}
 
 }
 \newcommand{\link}[2]{\href{#1}{\uline{#2}\footnote{#1}}}
 
-\newcommand{\www}[1]{{\normalfont\small\url{#1}}}
+\newcommand{\www}[1]{{\normalfont\small\href{#1}{#1}}}
 
 
index 0a1511e..b1cbc7f 100644 (file)
Binary files a/librarian/res/cover.png and b/librarian/res/cover.png differ