metadata and styles updated for epub generation
This commit is contained in:
parent
2f3470ccf8
commit
9fc6877eef
|
@ -1,9 +1,9 @@
|
|||
#!/bin/sh
|
||||
|
||||
meta="/var/cosmic/files/metadata.yml"
|
||||
css="/var/cosmic/files/epub.css"
|
||||
ebook="$HOME/cosmic.txt"
|
||||
epub="$HOME/cosmic.epub"
|
||||
intro="/var/gopher/intro.gophermap"
|
||||
|
||||
filelist=$(tac /var/gopher/listing.gophermap)
|
||||
|
||||
|
@ -11,6 +11,10 @@ if [ -f "$ebook" ]; then
|
|||
rm "$ebook"
|
||||
fi
|
||||
|
||||
|
||||
printf "# Introduction\\n\\n" >> "$ebook"
|
||||
sed 's/^/ /' "$intro" >> "$ebook"
|
||||
|
||||
IFS='
|
||||
'
|
||||
for log in $filelist; do
|
||||
|
@ -23,5 +27,5 @@ for log in $filelist; do
|
|||
} >> "$ebook"
|
||||
done
|
||||
|
||||
pandoc -f markdown+hard_line_breaks --css "$css" -o "$epub" "$meta" --wrap=none --toc "$ebook"
|
||||
pandoc -f markdown+hard_line_breaks -o "$epub" "$meta" --wrap=none --toc "$ebook"
|
||||
rm "$ebook"
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 7.8 MiB |
245
files/epub.css
245
files/epub.css
|
@ -121,54 +121,24 @@ body {
|
|||
h1 {
|
||||
text-indent: 0;
|
||||
text-align: left;
|
||||
margin: 50px 0 0 0;
|
||||
font-size: 1.7em;
|
||||
margin: 0 0 30px 0;
|
||||
font-size: 18px;
|
||||
font-weight: normal;
|
||||
page-break-before: avoid;
|
||||
line-height: 150%; /*gets squished otherwise on ADE */
|
||||
line-height: 1.2em; /*gets squished otherwise on ADE */
|
||||
border-bottom: 1px solid black;
|
||||
}
|
||||
|
||||
h2 {
|
||||
text-indent: 0;
|
||||
text-align: center;
|
||||
margin: 50px 0 0 0;
|
||||
font-size: 1.5em;
|
||||
margin: 20px 0 0 0;
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
page-break-before: avoid;
|
||||
line-height: 135%; /*get squished otherwise on ADE */
|
||||
line-height: 1.2em; /*get squished otherwise on ADE */
|
||||
}
|
||||
|
||||
h3 {
|
||||
text-indent: 0;
|
||||
text-align: left;
|
||||
font-size: 1.4em;
|
||||
font-weight: bold;
|
||||
margin-top: 1.4em;
|
||||
}
|
||||
|
||||
h4 {
|
||||
text-indent: 0;
|
||||
text-align: left;
|
||||
font-size: 1.2em;
|
||||
font-weight: bold;
|
||||
margin-top: 1.2em;
|
||||
}
|
||||
|
||||
h5 {
|
||||
text-indent: 0;
|
||||
text-align: left;
|
||||
font-size: 1.1em;
|
||||
font-weight: bold;
|
||||
margin-top: 1.1em;
|
||||
}
|
||||
|
||||
h6 {
|
||||
text-indent: 0;
|
||||
text-align: left;
|
||||
font-size: 1em;
|
||||
font-weight: bold;
|
||||
margin-top: 1em;
|
||||
}
|
||||
|
||||
/* Hyphen and pagination Fixer */
|
||||
/* Note: Do not try on the Kindle, it does not recognize the hyphens property */
|
||||
|
@ -182,55 +152,18 @@ h6 {
|
|||
hyphens: none;
|
||||
page-break-after: avoid;
|
||||
page-break-inside: avoid;
|
||||
page-break-before: avoid;
|
||||
}
|
||||
|
||||
/*===Paragraph Elements===*/
|
||||
/* Margins are usually added on the top, left, and right, but not on the bottom to prevent certain eReaders not collapsing white space properly */
|
||||
|
||||
/*first-line indent paragraph for fiction*/
|
||||
p {
|
||||
/* text-indent: 1.25em; */
|
||||
margin: 0;
|
||||
widows: 2;
|
||||
orphans: 2;
|
||||
}
|
||||
|
||||
/* block type paragraph for non-fiction* /
|
||||
/*
|
||||
p
|
||||
{
|
||||
text-indent: 0;
|
||||
margin: 1.0em 0 0 0;
|
||||
widows: 2;
|
||||
orphans: 2;
|
||||
}
|
||||
*/
|
||||
|
||||
/* for centered text and wrappers on images */
|
||||
p.centered {
|
||||
text-indent: 0;
|
||||
margin: 1em 0 0 0;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
/* section Breaks (can use centered-style for non-fiction) */
|
||||
p.centeredbreak {
|
||||
text-indent: 0;
|
||||
margin: 1em 0 1em 0;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
/* First sentence in chapters following heading */
|
||||
p.texttop {
|
||||
margin: 1.5em 0 0 0;
|
||||
text-indent: 0;
|
||||
}
|
||||
|
||||
/* Use for second sentence to clear drop cap's float */
|
||||
p.clearit {
|
||||
clear: both;
|
||||
}
|
||||
|
||||
/* 1st level TOC */
|
||||
p.toctext {
|
||||
margin: 0 0 0 1.5em;
|
||||
|
@ -243,58 +176,51 @@ p.toctext2 {
|
|||
text-indent: 0;
|
||||
}
|
||||
|
||||
h1.main {
|
||||
text-align: center;
|
||||
border-bottom: 0;
|
||||
margin-top: 300px;
|
||||
margin-bottom: 5px;
|
||||
font-size: 32px;
|
||||
font-variant: small-caps;
|
||||
}
|
||||
|
||||
h1.toc-title {
|
||||
margin-left: 2em;
|
||||
}
|
||||
|
||||
h1.subtitle {
|
||||
font-style: italic;
|
||||
font-size: larger;
|
||||
font-weight: bold;
|
||||
margin-left: 0;
|
||||
margin-bottom: 1em;
|
||||
text-align: center;
|
||||
border-bottom: 0;
|
||||
}
|
||||
|
||||
.rights {
|
||||
display: block;
|
||||
position: absolute;
|
||||
bottom: 30px;
|
||||
left: 15px;
|
||||
}
|
||||
|
||||
/*==LISTS==*/
|
||||
ul {
|
||||
margin: 1em 0 0 1em;
|
||||
margin: 1em 0 0 3em;
|
||||
text-align: left;
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
ol {
|
||||
margin: 1em 0 0 1em;
|
||||
margin: 1em 0 0 3em;
|
||||
text-align: left;
|
||||
list-style: none;
|
||||
font-size: 14px;
|
||||
line-height: 1.3em;
|
||||
}
|
||||
|
||||
/*===IN-LINE STYLES===*/
|
||||
/* Recommend avoiding use of <b>, <i>, and <u>. Use span tags instead */
|
||||
span.i {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
span.b {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
span.u {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
span.st {
|
||||
text-decoration: line-through;
|
||||
}
|
||||
|
||||
/*==in-line combinations==*/
|
||||
/* Using something like <span class="i b">... may seem okay, but it causes problems on some eReaders */
|
||||
span.ib {
|
||||
font-style: italic;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
span.iu {
|
||||
font-style: italic;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
span.bu {
|
||||
font-weight: bold;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
span.ibu {
|
||||
font-style: italic;
|
||||
font-weight: bold;
|
||||
text-decoration: underline;
|
||||
ol li a {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
/* This fixes the bug where the text-align property of block-level elements is not recognized on iBooks
|
||||
|
@ -304,80 +230,20 @@ span.ipadcenterfix {
|
|||
text-align: center;
|
||||
}
|
||||
|
||||
/*==IMAGES==*/
|
||||
img {
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
/*==TABLES==*/
|
||||
table {
|
||||
margin: 1em auto;
|
||||
}
|
||||
|
||||
tr,
|
||||
th,
|
||||
td {
|
||||
margin: 0;
|
||||
padding: 2px;
|
||||
border: 1px solid black;
|
||||
font-size: 100%;
|
||||
vertical-align: baseline;
|
||||
}
|
||||
|
||||
/* Superscripted Footnote Text */
|
||||
.footnote {
|
||||
vertical-align: super;
|
||||
font-size: 0.75em;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
/*==DROP CAPS==*/
|
||||
span.dropcap {
|
||||
font-size: 300%;
|
||||
font-weight: bold;
|
||||
height: 1em;
|
||||
float: left;
|
||||
margin: 0.3em 0.125em -0.4em 0.1em;
|
||||
}
|
||||
|
||||
/*==PULL QUOTE==*/
|
||||
div.pullquote {
|
||||
margin: 2em 2em 0 2em;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
div.pullquote p {
|
||||
font-weight: bold;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
div.pullquote hr {
|
||||
width: 100%;
|
||||
margin: 0;
|
||||
height: 3px;
|
||||
color: #2e8de0;
|
||||
background-color: #2e8de0;
|
||||
border: 0;
|
||||
}
|
||||
|
||||
/*==BLOCK QUOTE==*/
|
||||
div.blockquote {
|
||||
margin: 1em 1.5em 0 1.5em;
|
||||
text-align: left;
|
||||
font-size: 0.9em;
|
||||
}
|
||||
|
||||
/*==eBook Specific Formatting Below Here==*/
|
||||
body {
|
||||
padding: 1em;
|
||||
font-family: monospace;
|
||||
}
|
||||
|
||||
pre,
|
||||
code {
|
||||
font-size: 90%;
|
||||
line-height: 100%;
|
||||
pre {
|
||||
font-size: 10px;
|
||||
line-height: 1.1em;
|
||||
text-align: left;
|
||||
white-space: pre;
|
||||
}
|
||||
|
||||
|
||||
blockquote {
|
||||
color: #666666;
|
||||
margin: 1em 0;
|
||||
|
@ -389,13 +255,6 @@ p {
|
|||
margin: 1em 0;
|
||||
}
|
||||
|
||||
/* used for strings in code when using HTML */
|
||||
span.st {
|
||||
text-decoration: initial;
|
||||
.level1 {
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: monospace, monospace;
|
||||
font-size: 11px;
|
||||
line-height: 1.2;
|
||||
}
|
||||
|
|
|
@ -2,5 +2,9 @@
|
|||
title:
|
||||
- type: main
|
||||
text: Cosmic Voyage
|
||||
rights: Copyright ©2019
|
||||
- type: subtitle
|
||||
text: Year One
|
||||
rights: © 2019 Cosmic Voyage, CC BY-NC-ND 4.0
|
||||
stylesheet: /var/cosmic/files/epub.css
|
||||
cover-image: /var/cosmic/files/cover.jpg
|
||||
...
|
||||
|
|
Loading…
Reference in New Issue