from librarian import DirDocProvider, ParseError
from librarian.parser import WLDocument
-from librarian.cover import WLCover, FutureOfCopyrightCover
+from librarian.cover import WLCover, FutureOfCopyrightCover, CoverFromFile
class Option(object):
def cover_class(*args, **kwargs):
return FutureOfCopyrightCover(image_cache=options.image_cache, *args, **kwargs)
transform_args['cover'] = cover_class
+ elif options.cover_file:
+ def cover_class(*args, **kwargs):
+ return CoverFromFile(options.cover_file, *args, **kwargs)
+ transform_args['cover'] = cover_class
elif not cls.cover_optional or options.with_cover:
transform_args['cover'] = FutureOfCopyrightCover
from PIL import Image, ImageFont, ImageDraw, ImageFilter, ImageEnhance
from StringIO import StringIO
from librarian import get_resource, OutputFile, URLOpener
-
+from os import path
class Metric(object):
"""Gets metrics from an object, scaling it by a factor."""
format = 'PNG'
class FutureOfCopyrightCover(Cover):
- width = 420
+ width = 402
height = 595
background_img = 'cover.png'
format = 'PNG'
def save(self, dest):
dest.write(open(self.background_img).read())
+
+
+class CoverFromFile(Cover):
+ def __init__(self, filename, *args, **kwargs):
+ super(CoverFromFile, self).__init__(*args, **kwargs)
+
+ self.background_img = filename
+
+ self.img = Image.open(filename)
+ (self.width, self.height) = self.img.size
+
+ self.format = path.splitext(filename)[-1][1:].upper()
+
+ def image(self):
+ return self.img
import zipfile
from tempfile import mkdtemp, NamedTemporaryFile
from shutil import rmtree
+from mimetypes import guess_type
from librarian import RDFNS, WLNS, NCXNS, OPFNS, XHTMLNS, OutputFile
from librarian.cover import WLCover, FutureOfCopyrightCover
def transform(wldoc, verbose=False,
style=None, html_toc=False,
- sample=None, cover=None, flags=None, resources=None):
+ sample=None, cover=None, flags=None, resources=None,
+ intro_file=None, cover_file=None):
""" produces a EPUB file
sample=n: generate sample e-book (with at least n paragraphs)
zip.writestr('OPS/title.html',
etree.tostring(html_tree, method="html", pretty_print=True))
# add a title page TOC entry
- toc.add(u"Title", "title.html")
+ toc.add(u"Tytuł", "title.html")
elif wldoc.book_info.parts:
# write title page for every parent
if sample is not None and sample <= 0:
fpath = os.path.join(dp, fname)
if os.path.isfile(fpath):
zip.write(fpath, os.path.join('OPS', fname))
+ manifest.append(etree.fromstring(
+ '<item id="%s" href="%s" media-type="%s" />' % (os.path.splitext(fname)[0], fname, guess_type(fpath)[0])))
+
else:
print "resources path %s is not directory" % resources
nav_map = toc_file[-1]
manifest.append(etree.fromstring(
- '<item id="intro" href="intro.html" media-type="application/xhtml+xml" />'))
+ '<item id="first" href="first.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())
+ '<itemref idref="first" />'))
+ html_tree = xslt(document.edoc, get_resource('epub/xsltFirst.xsl'))
+# chars.update(used_chars(html_tree.getroot()))
+ zip.writestr('OPS/first.html', etree.tostring(
+ html_tree, method="html", pretty_print=True))
+
+ if intro_file:
+ 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(intro_file or get_resource('epub/intro.html')).read())
if html_toc:
toc, chunk_counter, chars, sample = transform_file(document, sample=sample)
+ toc.add("Informacje redakcyjne", "first.html", index=0)
+
if len(toc.children) < 2:
- toc.add(u"Beginning of the book", "part1.html")
+ toc.add(u"Początek książki", "part1.html")
# Last modifications in container files and EPUB creation
if len(annotations) > 0:
- toc.add("Footnotes", "annotations.html")
+ toc.add("Przypisy", "annotations.html")
manifest.append(etree.fromstring(
'<item id="annotations" href="annotations.html" media-type="application/xhtml+xml" />'))
spine.append(etree.fromstring(
# chars.update(used_chars(etree.fromstring(html_string)))
# zip.writestr('OPS/support.html', html_string)
- toc.add("Editors", "last.html")
+ toc.add("Informacje redakcyjne", "last.html")
manifest.append(etree.fromstring(
'<item id="last" href="last.html" media-type="application/xhtml+xml" />'))
spine.append(etree.fromstring(
# write TOC
if html_toc:
- toc.add(u"Table of Contents", "toc.html", index=1)
+ toc.add(u"Spis treści", "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))
.h4
{
- font-size: 1em;
+ font-size: 1em;
margin: 0;
margin-top: 1.5em;
- line-height: 1.5em;
+ line-height: 1.5em;
}
p
p.footer {
margin-top: 2em;
}
+
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
- <title>Future of Copyright</title>
+ <title>Table of Contents</title>
</head>
<body>
<h1>Table of Contents</h1>
<dc:identifier id="BookId" opf:scheme="URI">
<xsl:apply-templates select="//dc:identifier.url" />
</dc:identifier>
+ <dc:identifier id="BookId" opf:scheme="ISBN">
+ <xsl:apply-templates select="//dc:source.ISBN" />
+ </dc:identifier>
<dc:subject>
<xsl:apply-templates select="//dc:identifier.url" />
</dc:subject>
<link rel="stylesheet" href="style.css" type="text/css" />
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
<title>
- <xsl:text>Credits</xsl:text>
+ <xsl:text>Informacje redakcyjne</xsl:text>
</title>
</head>
<body>
<div id="book-text" >
-
-
-<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&hosted_button_id=L2CLCXHZCWYJN">PLN</a> or <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&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>
-
-
-
-
-
-<!-- <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">
- Generated on <span id="file_date"><xsl:value-of select="substring(date:date(), 1, 10)" /></span>.
- </p>
-
+ <xsl:for-each select="//nota[@typ='redk']/*">
+ <div class="info">
+ <xsl:apply-templates select="."/>
+ </div>
+ </xsl:for-each>
</div>
</body>
</html>
<xsl:template match="text()" mode="person">
<xsl:value-of select="wl:person_name(.)" />
</xsl:template>
+
+<!-- copied from xsltScheme.xsl -->
+
+ <!--===========================================================-->
+ <!-- Tagi BLOKOWE -->
+ <!--===========================================================-->
+
+ <xsl:template match="nota">
+ <div class="note" xmlns="http://www.w3.org/1999/xhtml">
+ <xsl:apply-templates />
+ </div>
+ </xsl:template>
+
+ <xsl:template match="lista_osob" >
+ <div class="person-list" xmlns="http://www.w3.org/1999/xhtml">
+ <div class="h3" xmlns="http://www.w3.org/1999/xhtml">
+ <xsl:apply-templates select="child::naglowek_listy" />
+ </div>
+ <ol xmlns="http://www.w3.org/1999/xhtml">
+ <xsl:apply-templates select="lista_osoba" />
+ </ol>
+ </div>
+ </xsl:template>
+
+ <xsl:template match="dedykacja">
+ <div class="dedication" xmlns="http://www.w3.org/1999/xhtml">
+ <xsl:apply-templates />
+ </div>
+ </xsl:template>
+
+ <xsl:template match="kwestia">
+ <div class="kwestia" xmlns="http://www.w3.org/1999/xhtml">
+ <xsl:apply-templates select="strofa|akapit|didaskalia|akap " />
+ </div>
+ </xsl:template>
+
+ <xsl:template match="dlugi_cytat|poezja_cyt">
+ <div class="block" xmlns="http://www.w3.org/1999/xhtml">
+ <xsl:apply-templates />
+ </div>
+ </xsl:template>
+
+ <xsl:template match="motto">
+ <div class="motto" xmlns="http://www.w3.org/1999/xhtml">
+ <xsl:apply-templates />
+ </div>
+ </xsl:template>
+
+ <!--===========================================================-->
+ <!-- Tagi PARAGRAFOWE -->
+ <!--===========================================================-->
+
+ <xsl:template match="autor_utworu" mode="poczatek">
+ <h2 class="author" xmlns="http://www.w3.org/1999/xhtml">
+ <xsl:apply-templates />
+ </h2>
+ </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:apply-templates />
+ </h2>
+ </xsl:template>
+
+ <xsl:template match="dzielo_nadrzedne" />
+
+ <xsl:template match="nazwa_utworu" mode="poczatek" >
+ <h2 class="intitle" xmlns="http://www.w3.org/1999/xhtml">
+ <xsl:apply-templates />
+ </h2>
+ </xsl:template>
+
+ <xsl:template match="nazwa_utworu" />
+
+ <xsl:template match="podtytul" mode="poczatek">
+ <h2 class="insubtitle" xmlns="http://www.w3.org/1999/xhtml">
+ <xsl:apply-templates />
+ </h2>
+ </xsl:template>
+
+ <xsl:template match="podtytul" />
+
+ <xsl:template match="naglowek_czesc|srodtytul">
+ <h2 class="h2" xmlns="http://www.w3.org/1999/xhtml">
+ <xsl:apply-templates />
+ </h2>
+ </xsl:template>
+
+ <xsl:template match="naglowek_akt">
+ <h2 class="h2" xmlns="http://www.w3.org/1999/xhtml">
+ <xsl:apply-templates />
+ </h2>
+ </xsl:template>
+
+ <xsl:template match="naglowek_scena">
+ <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 xmlns="http://www.w3.org/1999/xhtml"></a>
+ <h2 class="h4" xmlns="http://www.w3.org/1999/xhtml">
+ <xsl:apply-templates />
+ </h2>
+ </xsl:template>
+
+ <xsl:template match="autor_rozdzialu">
+ </xsl:template>
+
+ <xsl:template match="naglowek_rozdzial">
+ <h2 class="h3" xmlns="http://www.w3.org/1999/xhtml">
+ <xsl:if test="name(following-sibling::*[1])='autor_rozdzialu'">
+ <xsl:value-of select="following-sibling::*[1]/text()"/> -
+ </xsl:if>
+ <xsl:apply-templates />
+ </h2>
+ </xsl:template>
+
+ <xsl:template match="naglowek_osoba">
+ <h2 class="h4" xmlns="http://www.w3.org/1999/xhtml">
+ <xsl:apply-templates />
+ </h2>
+ </xsl:template>
+
+ <xsl:template match="miejsce_czas">
+ <div class="place-and-time" xmlns="http://www.w3.org/1999/xhtml">
+ <xsl:apply-templates />
+ </div>
+ </xsl:template>
+
+ <xsl:template match="didaskalia">
+ <div class="didaskalia" xmlns="http://www.w3.org/1999/xhtml">
+ <xsl:apply-templates />
+ </div>
+ </xsl:template>
+
+ <xsl:template match="akap|akap_dialog|akap_cd">
+ <p class="paragraph" xmlns="http://www.w3.org/1999/xhtml">
+ <xsl:apply-templates />
+ </p>
+ </xsl:template>
+
+ <xsl:template match="strofa">
+ <div class="stanza" xmlns="http://www.w3.org/1999/xhtml">
+ <xsl:apply-templates />
+ </div><div class='stanza-spacer' xmlns="http://www.w3.org/1999/xhtml"> </div>
+ </xsl:template>
+
+ <xsl:template match="wers_normalny">
+ <div class="verse" xmlns="http://www.w3.org/1999/xhtml">
+ <xsl:apply-templates />
+  </div>
+ </xsl:template>
+
+ <xsl:template match="wers_akap">
+ <div class="verse" style="margin-left: 1em;" xmlns="http://www.w3.org/1999/xhtml">
+ <xsl:apply-templates />
+  </div>
+ </xsl:template>
+
+ <xsl:template match="wers_wciety">
+ <div class="verse" style='margin-left:1em;' xmlns="http://www.w3.org/1999/xhtml">
+ <xsl:apply-templates />
+  </div>
+ </xsl:template>
+
+ <xsl:template match="wers_wciety[@typ!='']">
+ <div class="verse" xmlns="http://www.w3.org/1999/xhtml">
+ <xsl:attribute name="style">
+ margin-left: <xsl:value-of select="@typ" />em;
+ </xsl:attribute>
+ <xsl:apply-templates />
+  </div>
+ </xsl:template>
+
+ <xsl:template match="wers_cd">
+ <div class="verse" style="margin-left: 12em;" xmlns="http://www.w3.org/1999/xhtml">
+ <xsl:apply-templates />
+  </div>
+ </xsl:template>
+
+ <xsl:template match="motto_podpis">
+ <div class="motto_podpis" xmlns="http://www.w3.org/1999/xhtml">
+ <xsl:apply-templates />
+ </div>
+ </xsl:template>
+
+ <xsl:template match="lista">
+ <ul>
+ <xsl:apply-templates />
+ </ul>
+ </xsl:template>
+
+ <xsl:template match="punkt">
+ <li><xsl:apply-templates /></li>
+ </xsl:template>
+
+ <xsl:template match="www">
+ <a>
+ <xsl:attribute name="href">
+ <xsl:value-of select="text()"/>
+ </xsl:attribute>
+ <xsl:value-of select="text()"/>
+ </a>
+ </xsl:template>
+
+ <xsl:template match="link">
+ <a>
+ <xsl:attribute name="href">
+ <xsl:value-of select="@url"/>
+ </xsl:attribute>
+ <xsl:value-of select="text()"/>
+ </a>
+ </xsl:template>
+
+
+ <!--===========================================================-->
+ <!-- Tagi LINIOWE -->
+ <!--===========================================================-->
+
+ <xsl:template match="slowo_obce">
+ <em class="foreign-word" xmlns="http://www.w3.org/1999/xhtml">
+ <xsl:apply-templates />
+ </em>
+ </xsl:template>
+
+ <xsl:template match="mat" >
+ <em class="math" xmlns="http://www.w3.org/1999/xhtml">
+ <xsl:apply-templates />
+ </em>
+ </xsl:template>
+
+ <xsl:template match="didask_tekst" >
+ <em class="didaskalia" xmlns="http://www.w3.org/1999/xhtml">
+ <xsl:apply-templates />
+ </em>
+ </xsl:template>
+
+ <xsl:template match="tytul_dziela" >
+ <em class="book-title" xmlns="http://www.w3.org/1999/xhtml">
+ <xsl:if test="@typ = '1'" >„</xsl:if>
+ <xsl:apply-templates />
+ <xsl:if test="@typ = '1'">”</xsl:if>
+ </em>
+ </xsl:template>
+
+ <xsl:template match="wyroznienie" >
+ <em class="author-emphasis" xmlns="http://www.w3.org/1999/xhtml">
+ <xsl:apply-templates />
+ </em>
+ </xsl:template>
+
+ <xsl:template match="osoba" >
+ <em class="person" xmlns="http://www.w3.org/1999/xhtml">
+ <xsl:apply-templates />
+ </em>
+ </xsl:template>
+
+ <xsl:template match="naglowek_listy" >
+ <xsl:apply-templates />
+ </xsl:template>
+
+ <xsl:template match="lista_osoba" >
+ <li xmlns="http://www.w3.org/1999/xhtml">
+ <xsl:apply-templates />
+ </li>
+ </xsl:template>
+
+ <!--===========================================================-->
+ <!-- Tagi STANDALONE -->
+ <!--===========================================================-->
+
+ <xsl:template match="sekcja_swiatlo">
+ <p class="spacer" xmlns="http://www.w3.org/1999/xhtml"> </p>
+ </xsl:template>
+
+ <xsl:template match="sekcja_asterysk">
+ <p class="spacer-asterisk" xmlns="http://www.w3.org/1999/xhtml">*</p>
+ </xsl:template>
+
+ <xsl:template match="separator_linia">
+ <hr class="spacer-line" xmlns="http://www.w3.org/1999/xhtml"></hr>
+ </xsl:template>
+
+ <!--===========================================================-->
+ <!-- Tagi SPECJALNE -->
+ <!--===========================================================-->
+
+ <xsl:template match="motyw" />
+
+ <!--===========================================================-->
+ <!-- Tagi IGNOROWANE -->
+ <!--===========================================================-->
+
+ <xsl:template match="extra" />
+
+ <xsl:template match="pe|pa|pr|pt" >
+ <a id="anchor-{.}" class="anchor" href="annotations.html#annotation-{.}"
+ xmlns="http://www.w3.org/1999/xhtml">[<xsl:apply-templates />]</a>
+ </xsl:template>
+
+ <xsl:template match="uwaga" />
+
+ <xsl:template match="nota_red" />
+
+ <!--pominięcie tych metadanych-->
+ <xsl:template match="rdf:RDF" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" />
+
+ <xsl:template match="latex" />
+
+ <!--===========================================================-->
+ <!-- Tagi TEKSTOWE -->
+ <!--===========================================================-->
+
+ <xsl:template match="text()" >
+ <xsl:value-of select="." />
+ </xsl:template>
+
+
+ <!--===========================================================-->
+ <!-- Tagi ILUSTRACJE -->
+ <!--===========================================================-->
+ <xsl:template match="ilustr" >
+ <img>
+ <xsl:attribute name="src"><xsl:value-of select="@src"/>.<xsl:choose><xsl:when test="@extbitmap"><xsl:value-of select="@extbitmap"/></xsl:when><xsl:otherwise><xsl:value-of select="@ext"/></xsl:otherwise></xsl:choose></xsl:attribute>
+ </img>
+ </xsl:template>
+
+
+
</xsl:stylesheet>
<?xml version="1.0" encoding="utf-8"?>
-<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:dc="http://purl.org/dc/elements/1.1/">
<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" />
<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
+ <xsl:value-of select="//dc:title"/>
</title>
</xsl:element>
<xsl:element name="body" xmlns="http://www.w3.org/1999/xhtml">
<!--===========================================================-->
<xsl:template match="nota">
- <div class="note" xmlns="http://www.w3.org/1999/xhtml">
- <xsl:apply-templates />
- </div>
+ <xsl:if test="not(@typ!='redp' or @typ!='redk')">
+ <div class="note" xmlns="http://www.w3.org/1999/xhtml">
+ <xsl:apply-templates />
+ </div>
+ </xsl:if>
</xsl:template>
<xsl:template match="lista_osob" >
</xsl:template>
<xsl:template match="autor_utworu" />
- <xsl:template match="autor_rozdzialu">
- <xsl:apply-templates />
- </xsl:template>
+ <xsl:template match="autor_rozdzialu"/>
<xsl:template match="dzielo_nadrzedne" mode="poczatek">
<h2 class="collection" xmlns="http://www.w3.org/1999/xhtml">
<xsl:apply-templates />
</h2>
</xsl:template>
+
+ <xsl:template match="naglowek_podpodrozdzial">
+ <a xmlns="http://www.w3.org/1999/xhtml"></a>
+ <div class="p" xmlns="http://www.w3.org/1999/xhtml">
+ <xsl:apply-templates />
+ </div>
+ </xsl:template>
+
<xsl:template match="autor_rozdzialu">
</xsl:template>
<xsl:template match="naglowek_rozdzial">
- <h2 class="h3" xmlns="http://www.w3.org/1999/xhtml">
- <xsl:if test="name(following-sibling::*[1])='autor_rozdzialu'">
- <xsl:value-of select="following-sibling::*[1]/text()"/> -
- </xsl:if>
+ <h2 class="h2" xmlns="http://www.w3.org/1999/xhtml">
<xsl:apply-templates />
</h2>
+ <div class="info" xmlns="http://www.w3.org/1999/xhtml">
+ <xsl:if test="name(following-sibling::*[1])='autor_rozdzialu'">
+ <xsl:value-of select="following-sibling::*[1]/text()"/>
+ </xsl:if>
+ </div>
</xsl:template>
<xsl:template match="naglowek_osoba">
<!--pominięcie tych metadanych-->
<xsl:template match="rdf:RDF" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" />
+ <xsl:template match="latex" />
+
<!--===========================================================-->
<!-- Tagi TEKSTOWE -->
<!--===========================================================-->
<xsl:value-of select="." />
</xsl:template>
+ <!--===========================================================-->
+ <!-- Tagi ILUSTRACJE -->
+ <!--===========================================================-->
+ <xsl:template match="ilustr" >
+ <img>
+ <xsl:attribute name="src"><xsl:value-of select="@src"/>.<xsl:choose><xsl:when test="@extbitmap"><xsl:value-of select="@extbitmap"/></xsl:when><xsl:otherwise><xsl:value-of select="@ext"/></xsl:otherwise></xsl:choose></xsl:attribute>
+ </img>
+ </xsl:template>
+
+
</xsl:stylesheet>
def transform(wldoc, verbose=False, save_tex=None, save_texml=None, morefloats=None,
- cover=None, flags=None, customizations=None, documentclass='wl', resources=None):
+ cover=None, cover_file=None, flags=None, customizations=None, documentclass='wl', resources=None):
""" produces a PDF file with XeLaTeX
wldoc: a WLDocument
\fi
}
+\newcommand{\spistresci}{
+ \tableofcontents
+ \newpage
+}
+
+\newcommand{\link}[2]{\href{#1}{\uline{#2}\footnote{#1}}}
+
+\newcommand{\www}[1]{{\normalfont\href{#1}{#1}}}
Option('-w', '--working-copy', dest='working-copy',
action='store_true', default=False,
help='mark the output as a working copy'),
+ ]
+ transform_options = [
Option('-R', '--resources', dest='resources', metavar='DIR',
help='a directory with additional resources'),
+ Option('-I', '--intro', dest='intro_file', metavar='FILE',
+ help='HTML file containing intro'),
+ Option('-e', '--cover-file', dest='cover_file', metavar='FILE',
+ help='Cover image file'),
]
Option('-D', '--documentclass', dest='documentclass',
help='LaTeX document class, defaults to "wl"'),
Option('-s', '--customizations', dest='customizations', action='append',
- help='LaTeX document class options')
-
+ help='LaTeX document class options'),
+ Option('-e', '--cover-file', dest='cover_file', metavar='FILE',
+ help='Cover image file'),
]