Compare commits
6 Commits
084b06d2aa
...
7a4cf173f9
Author | SHA1 | Date |
---|---|---|
sejo | 7a4cf173f9 | |
sejo | 6d7003753d | |
sejo | bca25140b8 | |
sejo | 21ffc9393a | |
sejo | 87e660c7db | |
sejo | c446784354 |
15
g2e.awk
15
g2e.awk
|
@ -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
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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"/>
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue