Skip to content

Commit 8e07b70

Browse files
author
Emmanouil Konstantinidis
committed
Improve docs - Customize template
1 parent 319e36b commit 8e07b70

14 files changed

+42
-58
lines changed

docs/changelog.md

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
22
title: "Changelog"
33
source_filename: "changelog"
4-
order: 8
54
---
65

76
### Release 0.0.7

docs/contributing.md

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
22
title: "Contributing & Development"
33
source_filename: "contributing"
4-
order: 7
54
---
65

76
### Development

docs/css/styles.css

+2-4
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,8 @@ body {
1616
float: right;
1717
}
1818

19-
.thanks .img-responsive {
20-
display: inline-block;
21-
max-width: 145px;
22-
margin: 10px auto;
19+
.side-nav {
20+
margin-top: 0;
2321
}
2422

2523
/* @end Misc */

docs/index.md

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
22
title: "Home"
33
permalink: /
4-
order: 1
54
---
65

76
Django REST Framework Docs (DRF Docs) allows you to list all your API Endpoints that inherit from <a href="http://www.django-rest-framework.org/" target="_blank">Django REST Framework</a> **automatically**. Its purpose is to work out of the box and it should take a minimum to install it.

docs/installation.md

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
22
title: "Installation"
33
source_filename: "installation"
4-
order: 2
54
---
65

76
The installation itself should not take more than a couple of minutes. Follow the simple steps below.

docs/live-api.md

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
22
title: "Live API Endpoints"
33
source_filename: "live-api"
4-
order: 5
54
---
65

76
### What is "Live API Endpoints"?

docs/settings.md

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
22
title: "Settings"
33
source_filename: "settings"
4-
order: 4
54
---
65

76
### How to set the settings

docs/template/base.html

+2-10
Original file line numberDiff line numberDiff line change
@@ -43,18 +43,10 @@
4343

4444
{% include "nav.html" %}
4545

46-
<div class="container-fluid header">
47-
<div class="container">
48-
<div class="jumbotron">
49-
<h1><img class="img-responsive logo-badge" src="{{ base_url }}/images/logo-badge.png" alt="DRF Docs Badge" /></h1>
50-
<a target="_blank" href="https://pypi.python.org/pypi/drfdocs/"><img class="img-responsive" src="https://badge.fury.io/py/drfdocs.svg" alt="PyPI version" height="18"></a>
51-
<h3>Document Web APIs made with <a href="http://www.django-rest-framework.org/" target="_blank">Django REST Framework</a>.</h3>
52-
</div>
53-
</div>
54-
</div>
46+
{% include "header.html" %}
5547

5648
<div class="container">
57-
<div class="col-md-3">{% include "toc.html" %}</div>
49+
<div class="col-md-3">{% include "side-nav.html" %}</div>
5850
<div class="col-md-9" role="main">{% include "content.html" %}</div>
5951
</div>
6052

docs/template/content.html

+4-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,7 @@
66
</div>
77
{% endif %}
88

9-
{{ content }}
9+
<div class="page">
10+
{% if page_title %}<h1 class="page-title">{{ page_title }}</h1>{% endif %}
11+
{{ content }}
12+
</div>

docs/template/header.html

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<div class="container-fluid header">
2+
<div class="container">
3+
<div class="jumbotron">
4+
<h1><img class="img-responsive logo-badge" src="{{ base_url }}/images/logo-badge.png" alt="DRF Docs Badge" /></h1>
5+
<a target="_blank" href="https://pypi.python.org/pypi/drfdocs/"><img class="img-responsive" src="https://badge.fury.io/py/drfdocs.svg" alt="PyPI version" height="18"></a>
6+
<h3>Document Web APIs made with <a href="http://www.django-rest-framework.org/" target="_blank">Django REST Framework</a>.</h3>
7+
</div>
8+
</div>
9+
</div>

docs/template/nav-sub.html

-14
This file was deleted.

docs/template/side-nav.html

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<div class="bs-sidebar hidden-print well" role="complementary">
2+
<ul class="nav bs-sidenav side-nav">
3+
{% for nav_item in nav %}
4+
5+
<li {% if nav_item.active %}class="active"{% endif %}>
6+
<a href="{{ nav_item.url }}">{{ nav_item.title }}</a>
7+
8+
<!-- TOC -->
9+
{% if nav_item.active %}
10+
<ul class="nav pills">
11+
{% for toc_item in toc %}
12+
<li class="main {% if toc_item.active %}active{% endif %}"><a href="{{ toc_item.url }}">{{ toc_item.title }}</a></li>
13+
{% for toc_item in toc_item.children %}
14+
<li><a href="{{ toc_item.url }}">{{ toc_item.title }}</a></li>
15+
{% endfor %}
16+
{% endfor %}
17+
</ul>
18+
{% endif %}
19+
20+
</li>
21+
22+
{% endfor %}
23+
24+
</ul>
25+
</div>

docs/template/toc.html

-22
This file was deleted.

docs/templates.md

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
22
title: "Template Customization"
33
source_filename: "templates"
4-
order: 6
54
---
65

76
### Create the template file

0 commit comments

Comments
 (0)