Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

starting 'create' action

  • Loading branch information...
commit ed5b26ebb0319d54ec3f3cb25dad4ecdf7311683 1 parent 15822c6
@bkidwell authored
View
1  mdepub/actions/__init__.py
@@ -4,3 +4,4 @@
import archive
import newid
import version
+import create
View
12 mdepub/actions/create.py
@@ -0,0 +1,12 @@
+import logging
+import os.path
+import mdepub
+from mdepub import project_path
+from mdepub.filename import getFN
+
+log = logging.getLogger('create')
+
+def run():
+ log.debug("run()")
+
+
View
10 sample/Alice in Wonderland/Alice's Adventures in Wonderland.css
@@ -78,7 +78,8 @@
/* Verse
Include each stanza in a div.verse. Each line should be one paragraph. For
- indented lines, use classes in0, in1, in2, etc.
+ indented lines, use classes in0, in1, in2, etc. Overlong lines will have
+ a hanging indent (all but first line indented by 3em)
*/
div.verse {
@@ -96,7 +97,7 @@
div.verse p.in4 { padding-left: 10.0em; }
div.verse p.in5 { padding-left: 11.5em; }
div.verse p.in6 { padding-left: 13.0em; }
-
+
/* Tables */
table { margin-left: auto; margin-right: auto; text-indent: 0; }
@@ -132,8 +133,3 @@ div#sadtail p.in11 { padding-left: 15.0em; }
div#sadtail p.in12 { padding-left: 16.0em; }
div#sadtail p.in13 { padding-left: 17.0em; }
div#sadtail p.in14 { padding-left: 18.0em; }
-
-/*
-body { line-height: 130%; }
-*/
-
View
32 sample/Alice in Wonderland/Alice's Adventures in Wonderland.md
@@ -1,9 +1,5 @@
# Alice’s Adventures in Wonderland
-<!--
-TODO: decide between global followed by local stylesheet or local-only stylesheet
--->
-
<div class="center">
by Lewis Carroll
@@ -17,7 +13,8 @@ eBooks@Adelaide\
<div class="break spaced">
-*mdepub explanation goes here*
+*This `.epub` book was built with `mdepub`, a wrapper for `pandoc` and Calibre's `ebook-convert`.* The source code for this book is included inside the `.epub` package file; to access the source code open this `.epub` file in an archive tool such as WinZip or File Roller, browse into the `./META-INF` folder, and extract `source.mdepub.zip`. For more information, please see:\
+<https://github.com/bkidwell/mdepub>
Document history:
@@ -38,18 +35,18 @@ South Australia 5005
**Table of Contents**
-1. [Down the Rabbit-Hole](#chapter-i-down-the-rabbit-hole)
-2. [The Pool of Tears](#chapter-ii-the-pool-of-tears)
-3. [A Caucus-Race and a Long Tale](#chapter-iii-a-caucus-race-and-a-long-tale)
-4. [The Rabbit Sends in a Little Bill](#chapter-iv-the-rabbit-sends-in-a-little-bill)
-5. [Advice from a Caterpillar](#chapter-v-advice-from-a-caterpillar)
-6. [Pig and Pepper](#chapter-vi-pig-and-pepper)
-7. [A Mad Tea-Party](#chapter-vii-a-mad-tea-party)
-8. [The Queen’s Croquet-Ground](#chapter-viii-the-queens-croquet-ground)
-9. [The Mock Turtle’s Story](#chapter-ix-the-mock-turtles-story)
-10. [The Lobster Quadrille](#chapter-x-the-lobster-quadrille)
-11. [Who Stole the Tarts?](#chapter-xi-who-stole-the-tarts)
-12. [Alice’s Evidence](#chapter-xii-alices-evidence)
+I. [Down the Rabbit-Hole](#chapter-i-down-the-rabbit-hole)
+II. [The Pool of Tears](#chapter-ii-the-pool-of-tears)
+III. [A Caucus-Race and a Long Tale](#chapter-iii-a-caucus-race-and-a-long-tale)
+IV. [The Rabbit Sends in a Little Bill](#chapter-iv-the-rabbit-sends-in-a-little-bill)
+V. [Advice from a Caterpillar](#chapter-v-advice-from-a-caterpillar)
+VI. [Pig and Pepper](#chapter-vi-pig-and-pepper)
+VII. [A Mad Tea-Party](#chapter-vii-a-mad-tea-party)
+VII. [The Queen’s Croquet-Ground](#chapter-viii-the-queens-croquet-ground)
+IX. [The Mock Turtle’s Story](#chapter-ix-the-mock-turtles-story)
+X. [The Lobster Quadrille](#chapter-x-the-lobster-quadrille)
+XI. [Who Stole the Tarts?](#chapter-xi-who-stole-the-tarts)
+XII. [Alice’s Evidence](#chapter-xii-alices-evidence)
**List of Illustrations**
@@ -2135,4 +2132,3 @@ So she sat on, with closed eyes, and half believed herself in Wonderland, though
Lastly, she pictured to herself how this same little sister of hers would, in the after-time, be herself a grown woman; and how she would keep, through all her riper years, the simple and loving heart of her childhood: and how she would gather about her other little children, and make *their* eyes bright and eager with many a strange tale, perhaps even with the dream of Wonderland of long ago: and how she would feel with all their simple sorrows, and find a pleasure in all their simple joys, remembering her own child-life, and the happy summer days.
<p class="center">THE END</p>
-
View
49 template/book.css
@@ -19,8 +19,10 @@
text-indent: 2em; text-align: justify;
}
-/* Don't indent first paragraph */
- h2 + p, h3 + p, div.secbreak + p, hr + p, blockquote.continue + p {
+/* Don't indent first paragraph; don't indent after display blocks marked
+ '.continue'.
+*/
+ h2 + p, h3 + p, div.secbreak + p, hr + p, .continue + p {
margin-top: 1em;
text-indent: 0;
}
@@ -37,20 +39,30 @@
.break - start a new page
.center - center each line in this block/paragraph
.spaced - remove paragraph indent; add margin above and below
- .left - remove full justification and inden; align neft; add margin above
+ .left - remove full justification and indent; align neft; add margin above
and below
.unspaced - remove paragraph indent; do not add margin above and below
.attribution - align right
hr - display a horizontal rule 30% of text width
- .im - centered div for displaying an image
+ div.figure - centered div for displaying an image; this class is assigned
+ automatically by pandoc when an image is alone in a paragraph with an
+ optional caption given in alt text
*/
blockquote { margin: 1em 2em 1em 2em; line-height: 100%; }
.break { page-break-before: always; }
- .center, .center p, .spaced, .spaced p, .left, .left p, li p, .im {
+ .center, .center p, .spaced, .spaced p, .left, .left p, li p {
margin-top: 1em; margin-bottom: 1em; text-indent: 0;
}
- .center, .center p, .im { text-align: center; }
+ .center, .center p { text-align: center; }
+ div.figure {
+ margin-top: 1em; margin-bottom: 1em;
+ margin-left: auto; margin-right: auto;
+ text-indent: 0; text-align: center;
+ }
+ div.figure p.caption {
+ font-style: italic; font-size: .8em; text-align: center;
+ }
.left, .left p { text-align: left; }
.unspaced p { margin-top: 0; margin-bottom: 0; text-indent: 0; }
ul, ol { margin-top: 1em; margin-bottom: 1em; }
@@ -63,12 +75,35 @@
margin-left: 35%; margin-right: 35%;
}
+/* Verse
+
+ Include each stanza in a div.verse. Each line should be one paragraph. For
+ indented lines, use classes in0, in1, in2, etc. Overlong lines will have
+ a hanging indent (all but first line indented by 3em)
+
+*/
+ div.verse {
+ margin-top: 1em; margin-bottom: 1em;
+ }
+ div.verse p {
+ line-height: 100%;
+ padding-left: 3em; text-indent: -3em; text-align: left;
+ margin-top: 0; margin-bottom: 0;
+ }
+ div.verse p.in0 { padding-left: 4.0em; }
+ div.verse p.in1 { padding-left: 5.5em; }
+ div.verse p.in2 { padding-left: 7.0em; }
+ div.verse p.in3 { padding-left: 8.5em; }
+ div.verse p.in4 { padding-left: 10.0em; }
+ div.verse p.in5 { padding-left: 11.5em; }
+ div.verse p.in6 { padding-left: 13.0em; }
+
/* Tables */
table { margin-left: auto; margin-right: auto; text-indent: 0; }
/* Font style for a large block */
.b { font-weight: bold; }
- .i { font-style: italic; }
+ .i { font-style: italic; } .i em { font-style: normal; }
/* Fonts */
.big { font-size: 125%; }
View
41 template/book.md
@@ -0,0 +1,41 @@
+# {Title}
+
+<div class="center">
+
+by {Author}
+
+*more copyright page details go here*
+
+</div>
+
+<div class="break spaced">
+
+*This `.epub` book was built with `mdepub`, a wrapper for `pandoc` and Calibre's `ebook-convert`.* The source code for this book is included inside the `.epub` package file; to access the source code open this `.epub` file in an archive tool such as WinZip or File Roller, browse into the `./META-INF` folder, and extract `source.mdepub.zip`. For more information, please see:\
+<https://github.com/bkidwell/mdepub>
+
+</div>
+
+<div class="break spaced">
+
+**Table of Contents**
+
+1. [Introduction](#chapter-1-introduction)
+2. [Development](#chapter-2-development)
+3. [Resolution](#chapter-3-resolution)
+
+</div>
+
+## Chapter 1\
+Introduction
+
+text...
+
+## Chapter 2\
+Development
+
+text ...
+
+## Chapter 3\
+Resolution
+
+text ...
View
50 template/options.yaml
@@ -0,0 +1,50 @@
+# mdepub options file
+#
+# Specify missing or unknown values with the tilde (~) character, for example:
+# title sort: ~
+# Some missing values such as 'title sort' and 'filename' will be determined
+# automatically. Long strings containing punctuation should be enclosed in
+# double quotes. All values are optional except for 'title'.
+
+require mdepub version: "0.1" # Require at least this version of mdepub
+
+title: {Title}
+title sort: ~
+authors: {Author}
+author sort: ~
+publication date: {Date} # must be a string D MMM YYYY
+publisher: ~
+book producer: ~
+isbn: ~
+language: ~
+rating: ~ # personal rating
+series: ~ # name of the series
+series index: ~ # ordinal number within a series
+uuid: {uuid}
+
+# Tags: give a list of tag names enclosed in square brackets and separated by
+# commas. For consistency, use all lowercase and give multiple word tags with
+# hyphens instead of spaces. For example:
+# [fiction, historical-fiction, boston]
+tags: ~
+
+# Uncomment this to customize the base filename ($filename.md, $filename.html, etc.)
+filename: ~
+
+# Book description using Markdown syntax.
+description: |
+ Description goes here.
+
+smart quotes: true # Convert ' and " to proper left and right quotes
+stretch cover image: false # Set to true to distort cover.jpg and fill screen
+
+# Lowest-level heading (H1, H2, H3, etc.) to appear in Table of Contents
+chapter head level: 2
+
+# Page margins given in Points. Use a value of '~' to retain Calibre defaults.
+# Calibre defaults are 5pt on top and bottom and 0pt on left and right.
+margin:
+ top: ~
+ left: 8
+ right: 8
+ bottom: ~
Please sign in to comment.
Something went wrong with that request. Please try again.