Added epub customisation
This commit is contained in:
parent
f44993cec5
commit
4ed25d80d5
3 changed files with 105 additions and 1 deletions
70
epub/epub.css
Normal file
70
epub/epub.css
Normal file
|
|
@ -0,0 +1,70 @@
|
|||
body {
|
||||
margin: 5%;
|
||||
width: 700px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
code {
|
||||
font: medium Consolas, "Andale Mono", Monaco, "Liberation Mono", "Bitstream Vera Sans Mono", "DejaVu Sans Mono", monospace;
|
||||
white-space: pre;
|
||||
}
|
||||
|
||||
blockquote {
|
||||
font-size: 90%;
|
||||
margin: 2em 20px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
blockquote p img {
|
||||
float: left;
|
||||
margin-right: 1em;
|
||||
}
|
||||
|
||||
h1, h2, h3, h4, h5, h6 {
|
||||
font-weight: bold;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
h1 a, h2 a, h3 a, h4 a, h5 a, h6 a {
|
||||
color: inherit;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 266.7%;
|
||||
line-height: 1.1;
|
||||
margin: 1.49em 0;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
h2 {
|
||||
font-size: 210%;
|
||||
line-height: 1.3125;
|
||||
margin: 1.167em 0;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
figure {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
pre, table {
|
||||
font-size: 75%;
|
||||
}
|
||||
|
||||
caption {
|
||||
font-weight: bold;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
pre {
|
||||
line-height: 1em;
|
||||
}
|
||||
|
||||
pre code {
|
||||
font-size: 75%;
|
||||
}
|
||||
|
||||
nav#TOC > ul, nav#TOC > ul > li > ul {
|
||||
list-style: decimal;
|
||||
}
|
||||
33
epub/template.html
Normal file
33
epub/template.html
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops"$if(lang)$ xml:lang="$lang$"$endif$>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="generator" content="pandoc" />
|
||||
<title>$pagetitle$</title>
|
||||
$if(quotes)$
|
||||
<style type="text/css">
|
||||
q { quotes: "“" "”" "‘" "’"; }
|
||||
</style>
|
||||
$endif$
|
||||
$if(highlighting-css)$
|
||||
<style type="text/css">
|
||||
$highlighting-css$
|
||||
</style>
|
||||
$endif$
|
||||
$for(css)$
|
||||
<link rel="stylesheet" href="$css$" />
|
||||
$endfor$
|
||||
</head>
|
||||
<body>
|
||||
$if(titlepage)$
|
||||
<h1 class="title">$title$</h1>
|
||||
$for(author)$
|
||||
by <h2 class="author">$author$</h2>
|
||||
$endfor$
|
||||
$else$
|
||||
$body$
|
||||
$endif$
|
||||
</body>
|
||||
</html>
|
||||
|
||||
3
make.sh
3
make.sh
|
|
@ -23,7 +23,8 @@ FILES='intro.md about.md about_author.md
|
|||
[ -d "out" ] || mkdir out
|
||||
|
||||
if [[ "$TYPE" == "epub" || "$TYPE" == "" ]]; then
|
||||
pandoc -S --to epub3 -o out/black-book.epub --toc --epub-chapter-level=2 --epub-cover-image=images/cover.jpg $FILES
|
||||
pandoc -S --to epub3 -o out/black-book.epub --toc --epub-chapter-level=2 \
|
||||
--data-dir=epub --template=epub/template.html $FILES
|
||||
elif [[ "$TYPE" == "html" ]]; then
|
||||
rm -rf out/html
|
||||
mkdir out/html
|
||||
|
|
|
|||
Loading…
Reference in a new issue