add ability to specify static directory

This commit is contained in:
Jake Vanderplas
2013-05-04 21:25:34 -07:00
parent d5e4d179e9
commit d091f2780b
2 changed files with 2 additions and 2 deletions
+2 -1
View File
@@ -69,7 +69,8 @@ def include_code(preprocessor, tag, markup):
else:
title = os.path.basename(src)
url = '/{0}/{1}/{2}'.format('static', code_dir, src)
static_dir = settings.get('STATIC_OUT_DIR', 'static')
url = '/{0}/{1}/{2}'.format(static_dir, code_dir, src)
open_tag = ("<figure class='code'>\n<figcaption><span>{title}</span> "
"<a href='{url}'>download</a></figcaption>".format(title=title,
-1
View File
@@ -174,7 +174,6 @@ def notebook(preprocessor, tag, markup):
settings = preprocessor.configs.config['settings']
nb_dir = settings.get('NOTEBOOK_DIR', 'notebooks')
nb_path = os.path.join('content', nb_dir, src)
url = '/{0}/{1}/{2}'.format('static', nb_dir, src)
if not os.path.exists(nb_path):
raise ValueError("File {0} could not be found".format(nb_path))