Compare commits

..

No commits in common. "7a4cf173f93ccdbed7970eb57ac283a70fcf9255" and "084b06d2aa763b5a9267ec34b4cbba6cf8d6a31a" have entirely different histories.

4 changed files with 4 additions and 25 deletions

15
g2e.awk
View File

@ -17,10 +17,6 @@ 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
@ -57,7 +53,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"
}
@ -111,12 +107,7 @@ ARGIND==2 && FNR==1{
mediatype = dest~/gif$/ ? "image/gif" : dest~/jpg$/ ? "image/jpeg" : "image/png"
id = dest
sub(/^.+\//,"",id) # get basename
properties = ""
if(id~meta["cover"]){
properties = "properties=\"cover-image\""
}
content = content " <item id=\"" id "\" href=\"" dest "\" media-type=\"" mediatype "\" " properties "/>\n"
content = content " <item id=\"" id "\" href=\"" dest "\" media-type=\"" mediatype "\"/>\n"
}
$0 = line
@ -153,7 +144,7 @@ FNR==1 {
name = substr(id,filenamestart,RSTART-filenamestart)
nameout = epubodir indexdirname name ".xhtml"
sub(/#{1,3}[[:blank:]]+/,"", $0) # use first line as document title
sub(/#{1,3}\s+/,"", $0) # use first line as document title
m["title"] = $0
out = write_template("header.xhtml",m)
is_pre = 0

View File

@ -8,7 +8,6 @@
<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

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