Compare commits

..

6 Commits

Author SHA1 Message Date
sejo 7a4cf173f9 style changes 2022-01-08 20:22:41 -06:00
sejo 6d7003753d use header image from metadata.txt 2022-01-08 19:29:20 -06:00
sejo bca25140b8 include cover image in metadata 2022-01-08 19:22:07 -06:00
sejo 21ffc9393a serif headings 2022-01-08 19:21:36 -06:00
sejo 87e660c7db check for cover image 2022-01-08 18:54:15 -06:00
sejo c446784354 posix compatible 2022-01-08 13:18:11 -06:00
4 changed files with 25 additions and 4 deletions

15
g2e.awk
View File

@ -17,6 +17,10 @@ BEGIN{
value = $2
for(i=3;i<=NF;i++) value = value " " $i
if(key=="cover"){
sub(/^.+\//,"",value) # get basename
}
meta[key] = value
# set index file as an argument to be read
@ -53,7 +57,7 @@ BEGIN{
}
# start writing metadata files
content = write_template( "content-header.opf", meta )
content = write_template("content-header.opf", meta )
toc = write_template( "toc-header.ncx", meta )
spinetoc = " <spine toc=\"ncx\">\n"
}
@ -107,7 +111,12 @@ ARGIND==2 && FNR==1{
mediatype = dest~/gif$/ ? "image/gif" : dest~/jpg$/ ? "image/jpeg" : "image/png"
id = dest
sub(/^.+\//,"",id) # get basename
content = content " <item id=\"" id "\" href=\"" dest "\" media-type=\"" mediatype "\"/>\n"
properties = ""
if(id~meta["cover"]){
properties = "properties=\"cover-image\""
}
content = content " <item id=\"" id "\" href=\"" dest "\" media-type=\"" mediatype "\" " properties "/>\n"
}
$0 = line
@ -144,7 +153,7 @@ FNR==1 {
name = substr(id,filenamestart,RSTART-filenamestart)
nameout = epubodir indexdirname name ".xhtml"
sub(/#{1,3}\s+/,"", $0) # use first line as document title
sub(/#{1,3}[[:blank:]]+/,"", $0) # use first line as document title
m["title"] = $0
out = write_template("header.xhtml",m)
is_pre = 0

View File

@ -8,6 +8,7 @@
<dc:creator opf:role="aut">{author}</dc:creator>
<dc:description>{description}</dc:description>
<dc:date>{publishDate}</dc:date>
<meta content="{cover}" name="cover"/>
</metadata>
<manifest>

View File

@ -0,0 +1,3 @@
<manifest>
<item id="stylesheet" href="style.css" media-type="text/css"/>
<item id="ncx" href="toc.ncx" media-type="application/x-dtbncx+xml"/>

View File

@ -1,6 +1,10 @@
body {
padding: 1em;
font-family: sans-serif;
hyphens: auto;
adobe-hyphenate: auto;
-webkit-hyphens: auto;
-moz-hyphens: auto;
-epub-hyphens: auto;
}
pre{
background-color: #eee;
@ -14,7 +18,11 @@ blockquote{
header h1{
font-size:3em;
}
h1,h2,h3{
font-family: serif;
}
th,td{
border-width: 3px;
border-style:ridge;
padding:5px;
}