fnp
/
librarian.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
a4af74c
)
allow strofa inside table + fix table border in html/epub + fix empty verses in epub
author
Jan Szejko
<janek37@gmail.com>
Fri, 4 Aug 2017 15:16:31 +0000
(17:16 +0200)
committer
Jan Szejko
<janek37@gmail.com>
Fri, 4 Aug 2017 15:16:31 +0000
(17:16 +0200)
librarian/epub.py
patch
|
blob
|
history
librarian/epub/style.css
patch
|
blob
|
history
librarian/epub/xsltScheme.xsl
patch
|
blob
|
history
librarian/fb2/poems.xslt
patch
|
blob
|
history
librarian/pdf/wl2tex.xslt
patch
|
blob
|
history
librarian/xslt/book2html.xslt
patch
|
blob
|
history
diff --git
a/librarian/epub.py
b/librarian/epub.py
index
3e9056c
..
95e65f1
100644
(file)
--- a/
librarian/epub.py
+++ b/
librarian/epub.py
@@
-201,6
+201,8
@@
class Stanza(object):
if not text:
return
for i, verse_text in enumerate(re.split(r"/\s*\n", text)):
if not text:
return
for i, verse_text in enumerate(re.split(r"/\s*\n", text)):
+ if not verse_text.strip():
+ continue
if i:
self.open_normal_verse()
verse = self.get_open_verse()
if i:
self.open_normal_verse()
verse = self.get_open_verse()
diff --git
a/librarian/epub/style.css
b/librarian/epub/style.css
index
78ed5bc
..
e40c754
100644
(file)
--- a/
librarian/epub/style.css
+++ b/
librarian/epub/style.css
@@
-371,7
+371,8
@@
p.footer {
table {
border-collapse: collapse;
table {
border-collapse: collapse;
+ width: 100%;
}
}
-td {
+t
able.border th, table.border t
d {
border: 1px solid black;
}
border: 1px solid black;
}
diff --git
a/librarian/epub/xsltScheme.xsl
b/librarian/epub/xsltScheme.xsl
index
3b7036c
..
e04cb9d
100644
(file)
--- a/
librarian/epub/xsltScheme.xsl
+++ b/
librarian/epub/xsltScheme.xsl
@@
-73,10
+73,6
@@
</div>
</xsl:template>
</div>
</xsl:template>
- <xsl:template match="ilustr" mode="inline">
- <xsl:apply-templates select="." />
- </xsl:template>
-
<xsl:template match="ilustr">
<img>
<xsl:attribute name="src">
<xsl:template match="ilustr">
<img>
<xsl:attribute name="src">
@@
-329,9
+325,14
@@
</xsl:template>
<xsl:template match="tabela|tabelka">
</xsl:template>
<xsl:template match="tabela|tabelka">
- <table xmlns="http://www.w3.org/1999/xhtml">
- <xsl:apply-templates />
- </table>
+ <xsl:choose>
+ <xsl:when test="@ramka = '1'">
+ <table class="border" xmlns="http://www.w3.org/1999/xhtml"><xsl:apply-templates /></table>
+ </xsl:when>
+ <xsl:otherwise>
+ <table xmlns="http://www.w3.org/1999/xhtml"><xsl:apply-templates /></table>
+ </xsl:otherwise>
+ </xsl:choose>
</xsl:template>
<xsl:template match="wiersz">
<tr xmlns="http://www.w3.org/1999/xhtml">
</xsl:template>
<xsl:template match="wiersz">
<tr xmlns="http://www.w3.org/1999/xhtml">
diff --git
a/librarian/fb2/poems.xslt
b/librarian/fb2/poems.xslt
index
82e164f
..
257795b
100644
(file)
--- a/
librarian/fb2/poems.xslt
+++ b/
librarian/fb2/poems.xslt
@@
-29,6
+29,10
@@
</stanza>
</xsl:template>
</stanza>
</xsl:template>
+ <xsl:template mode="inline" match="strofa">
+ <xsl:apply-templates select="." mode="para"/>
+ </xsl:template>
+
<!-- XXX: it should be done elsewhere but our cheap verse splitting
puts it here -->
<xsl:template match="motyw" mode="poem"/>
<!-- XXX: it should be done elsewhere but our cheap verse splitting
puts it here -->
<xsl:template match="motyw" mode="poem"/>
diff --git
a/librarian/pdf/wl2tex.xslt
b/librarian/pdf/wl2tex.xslt
index
4c8be32
..
85375a2
100644
(file)
--- a/
librarian/pdf/wl2tex.xslt
+++ b/
librarian/pdf/wl2tex.xslt
@@
-306,6
+306,13
@@
</cmd>
</xsl:template>
</cmd>
</xsl:template>
+<xsl:template match="strofa" mode="inline">
+ <env name="minipage">
+ <parm><cmd name="linewidth" /></parm>
+ <parm><xsl:apply-templates select="." /></parm>
+ </env>
+</xsl:template>
+
<xsl:template match="strofa">
<cmd name="strofa"><parm>
<xsl:choose>
<xsl:template match="strofa">
<cmd name="strofa"><parm>
<xsl:choose>
diff --git
a/librarian/xslt/book2html.xslt
b/librarian/xslt/book2html.xslt
index
c4757e1
..
4b6c72a
100644
(file)
--- a/
librarian/xslt/book2html.xslt
+++ b/
librarian/xslt/book2html.xslt
@@
-193,6
+193,10
@@
</p>
</xsl:template>
</p>
</xsl:template>
+<xsl:template match="strofa" mode="inline">
+ <xsl:apply-templates select="." />
+</xsl:template>
+
<xsl:template match="strofa">
<div class="stanza">
<xsl:call-template name="section-anchor"/>
<xsl:template match="strofa">
<div class="stanza">
<xsl:call-template name="section-anchor"/>
@@
-256,7
+260,14
@@
</xsl:template>
<xsl:template match="tabela|tabelka">
</xsl:template>
<xsl:template match="tabela|tabelka">
- <table><xsl:apply-templates /></table>
+ <xsl:choose>
+ <xsl:when test="@ramka = '1'">
+ <table class="border"><xsl:apply-templates /></table>
+ </xsl:when>
+ <xsl:otherwise>
+ <table><xsl:apply-templates /></table>
+ </xsl:otherwise>
+ </xsl:choose>
</xsl:template>
<xsl:template match="wiersz">
<tr><xsl:apply-templates /></tr>
</xsl:template>
<xsl:template match="wiersz">
<tr><xsl:apply-templates /></tr>