Commit ce21fa1d by Tom Christie

Tweak static files with docs

parent 94401b43
...@@ -84,6 +84,7 @@ ...@@ -84,6 +84,7 @@
</li> </li>
</ul> </ul>
<ul class="nav pull-right"> <ul class="nav pull-right">
<!-- TODO
<li class="dropdown"> <li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Version: 2.0.0 <b class="caret"></b></a> <a href="#" class="dropdown-toggle" data-toggle="dropdown">Version: 2.0.0 <b class="caret"></b></a>
<ul class="dropdown-menu"> <ul class="dropdown-menu">
...@@ -91,6 +92,7 @@ ...@@ -91,6 +92,7 @@
<li><a href="#">2.0.0</a></li> <li><a href="#">2.0.0</a></li>
</ul> </ul>
</li> </li>
-->
</ul> </ul>
</div><!--/.nav-collapse --> </div><!--/.nav-collapse -->
</div> </div>
......
...@@ -167,6 +167,6 @@ Great, that was easy! ...@@ -167,6 +167,6 @@ Great, that was easy!
If you want to get a more in depth understanding of how REST framework fits together head on over to [the tutorial][tutorial], or start browsing the [API guide][guide]. If you want to get a more in depth understanding of how REST framework fits together head on over to [the tutorial][tutorial], or start browsing the [API guide][guide].
[image]: ../images/quickstart.png [image]: ../img/quickstart.png
[tutorial]: 1-serialization.md [tutorial]: 1-serialization.md
[guide]: ../#api-guide [guide]: ../#api-guide
\ No newline at end of file
...@@ -29,27 +29,27 @@ code_label = r'<a class="github" href="https://github.com/tomchristie/django-res ...@@ -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() page = open(os.path.join(docs_dir, 'template.html'), 'r').read()
# Copy static files # Copy static files
for static in ['css', 'js', 'img']: # for static in ['css', 'js', 'img']:
source = os.path.join(docs_dir, 'static', static) # source = os.path.join(docs_dir, 'static', static)
target = os.path.join(html_dir, static) # target = os.path.join(html_dir, static)
if os.path.exists(target): # if os.path.exists(target):
shutil.rmtree(target) # shutil.rmtree(target)
shutil.copytree(source, target) # shutil.copytree(source, target)
for (dirpath, dirnames, filenames) in os.walk(docs_dir): for (dirpath, dirnames, filenames) in os.walk(docs_dir):
relative_dir = dirpath.replace(docs_dir, '').lstrip(os.path.sep) relative_dir = dirpath.replace(docs_dir, '').lstrip(os.path.sep)
build_dir = os.path.join(html_dir, relative_dir) build_dir = os.path.join(html_dir, relative_dir)
if not os.path.exists(build_dir): if not os.path.exists(build_dir):
os.makedirs(build_dir) os.makedirs(build_dir)
for filename in filenames: for filename in filenames:
path = os.path.join(dirpath, filename) path = os.path.join(dirpath, filename)
if filename.endswith('.png'): if not filename.endswith('.md'):
output_path = os.path.join(build_dir, filename) if relative_dir:
shutil.copy(path, output_path) output_path = os.path.join(build_dir, filename)
continue shutil.copy(path, output_path)
elif not filename.endswith('.md'):
continue continue
output_path = os.path.join(build_dir, filename[:-3] + '.html') output_path = os.path.join(build_dir, filename[:-3] + '.html')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment