Tweak static files with docs
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 8.6 KiB After Width: | Height: | Size: 8.6 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 38 KiB After Width: | Height: | Size: 38 KiB |
|
@ -84,6 +84,7 @@
|
|||
</li>
|
||||
</ul>
|
||||
<ul class="nav pull-right">
|
||||
<!-- TODO
|
||||
<li class="dropdown">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Version: 2.0.0 <b class="caret"></b></a>
|
||||
<ul class="dropdown-menu">
|
||||
|
@ -91,6 +92,7 @@
|
|||
<li><a href="#">2.0.0</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
-->
|
||||
</ul>
|
||||
</div><!--/.nav-collapse -->
|
||||
</div>
|
||||
|
|
|
@ -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].
|
||||
|
||||
[image]: ../images/quickstart.png
|
||||
[image]: ../img/quickstart.png
|
||||
[tutorial]: 1-serialization.md
|
||||
[guide]: ../#api-guide
|
18
mkdocs.py
|
@ -29,28 +29,28 @@ 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'):
|
||||
if not filename.endswith('.md'):
|
||||
if relative_dir:
|
||||
output_path = os.path.join(build_dir, filename)
|
||||
shutil.copy(path, output_path)
|
||||
continue
|
||||
elif not filename.endswith('.md'):
|
||||
continue
|
||||
|
||||
output_path = os.path.join(build_dir, filename[:-3] + '.html')
|
||||
|
||||
|
|