Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

check for existence of md source when makig html; properly handle fil…

…ename command line option
  • Loading branch information...
commit 5f6b9dc91117e6e44f1f4fb1853e9d32ca29f132 1 parent 716099f
Brendan Kidwell authored
3  mdepub/__init__.py
View
@@ -38,6 +38,9 @@ def new_id():
arguments = ArgumentParser().parse_args()
+if arguments.filename:
+ options['filename'] = arguments.filename
+
def require_opts_file():
if options_loaded: return
log.fatal("No options.yaml file found for this project.")
9 mdepub/actions/html.py
View
@@ -2,10 +2,12 @@
import mdepub
from mdepub import shell
import os
+import os.path
from mdepub import options
from mdepub import project_path
from BeautifulSoup import BeautifulSoup
from mdepub.filename import getFN
+import sys
log = logging.getLogger('html')
@@ -31,11 +33,16 @@ def run():
args = ["pandoc", "--standalone", "--email-obfuscation=none"]
+ src = getFN("md")
+ if not os.path.exists(src):
+ log.fatal("\"%s\" not found.", src)
+ sys.exit(1)
+
if os.path.exists(css_file):
args.extend(["-c", css_file])
if options['smart quotes']:
args.append("--smart")
- args.append(getFN("md"))
+ args.append(src)
html = shell.pipe(args, None)
1  mdepub/filename.py
View
@@ -1,6 +1,7 @@
import unicodedata
import string
import mdepub
+import os.path
validFilenameChars = "'-_.() {}{}".format(string.ascii_letters, string.digits)
Please sign in to comment.
Something went wrong with that request. Please try again.