diff --git a/.git_ignore b/.git_ignore index e43b0f9..4b7f1d8 100644 --- a/.git_ignore +++ b/.git_ignore @@ -1 +1,2 @@ -.DS_Store +*.DS_Store +*__pycache__ diff --git a/src/epubmaker/__main__.py b/src/epubmaker/__main__.py index e69de29..31c0da6 100644 --- a/src/epubmaker/__main__.py +++ b/src/epubmaker/__main__.py @@ -0,0 +1,603 @@ +import sys, os, argparse +from uuid import uuid4 +from shutil import rmtree, copy +from datetime import datetime +import subprocess + + +class Name: + def __init__(self): + self.first = "" + self.last = "" + + +class Series: + def __init__(self): + self.number = "" + self.name = "" + + +class Image: + def __init__(self): + self.name = "" + self.type = "" + self.alt = "" + self.caption = "" + + +class Section: + def __init__(self): + self.type = "" + # types: + # cover + # toc + # copyright-page + # dedication + # text + # foreward + # notes + # acknowledments + # style + # title + self.name = "" + self.title = "" + self.body = "" + + +class Book: + def __init__(self): + self.filename = "" + self.title = "" + self.titlesort = "" + self.series = Series() + self.author = [] + self.artist = Name() + self.editor = Name() + self.publisher = "" + self.copyright = "" + self.subjects = "" + self.style = "" + self.directory = "" + self.isbn = "" + self.uuid = "" + self.source = "" + self.images = [] + self.sections = [] + self.cover = Image() + self.publishDate = "" + + +def extract(line): + if line.startswith("\n' + else: + imageCode = '
' + image.caption + '
\n' + imageCode += '