aboutsummaryrefslogtreecommitdiffstats
path: root/mkdocs.py
diff options
context:
space:
mode:
authorTom Christie2012-10-09 14:12:38 +0100
committerTom Christie2012-10-09 14:12:38 +0100
commitce21fa1dc6dd8c941b71d9219360b3e9083051d4 (patch)
tree96232caaaf65c5e156db056a926f962acf3c1176 /mkdocs.py
parent94401b43d2a1be81304ddcd91e3a97e7d2a42c4c (diff)
downloaddjango-rest-framework-ce21fa1dc6dd8c941b71d9219360b3e9083051d4.tar.bz2
Tweak static files with docs
Diffstat (limited to 'mkdocs.py')
-rwxr-xr-xmkdocs.py22
1 files changed, 11 insertions, 11 deletions
diff --git a/mkdocs.py b/mkdocs.py
index dc29d40b..5d202d7e 100755
--- a/mkdocs.py
+++ b/mkdocs.py
@@ -29,27 +29,27 @@ code_label = r'<a class="github" href="https://github.com/tomchristie/django-res
page = open(os.path.join(docs_dir, 'template.html'), 'r').read()
# Copy static files
-for static in ['css', 'js', 'img']:
- source = os.path.join(docs_dir, 'static', static)
- target = os.path.join(html_dir, static)
- if os.path.exists(target):
- shutil.rmtree(target)
- shutil.copytree(source, target)
+# for static in ['css', 'js', 'img']:
+# source = os.path.join(docs_dir, 'static', static)
+# target = os.path.join(html_dir, static)
+# if os.path.exists(target):
+# shutil.rmtree(target)
+# shutil.copytree(source, target)
for (dirpath, dirnames, filenames) in os.walk(docs_dir):
relative_dir = dirpath.replace(docs_dir, '').lstrip(os.path.sep)
build_dir = os.path.join(html_dir, relative_dir)
+
if not os.path.exists(build_dir):
os.makedirs(build_dir)
for filename in filenames:
path = os.path.join(dirpath, filename)
- if filename.endswith('.png'):
- output_path = os.path.join(build_dir, filename)
- shutil.copy(path, output_path)
- continue
- elif not filename.endswith('.md'):
+ if not filename.endswith('.md'):
+ if relative_dir:
+ output_path = os.path.join(build_dir, filename)
+ shutil.copy(path, output_path)
continue
output_path = os.path.join(build_dir, filename[:-3] + '.html')