Skip to content

Commit 12aabd6

Browse files
author
Emmanouil Konstantinidis
committed
Customise Flatly Template
1 parent c9dcc9c commit 12aabd6

23 files changed

+2422
-5
lines changed

docs/css/styles.css

+116
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
/* @group Misc */
2+
3+
body {
4+
background-color: #FEFEFE;
5+
}
6+
7+
.btn-demo {
8+
display: block;
9+
margin: 20px auto 10px;
10+
max-width: 180px;
11+
}
12+
13+
.btn-edit {
14+
margin-top: 10px;
15+
padding: 5px 10px;
16+
float: right;
17+
}
18+
19+
.thanks .img-responsive {
20+
display: inline-block;
21+
max-width: 145px;
22+
margin: 10px auto;
23+
}
24+
25+
/* @end Misc */
26+
27+
28+
/* @group Header */
29+
30+
.header .jumbotron {
31+
margin: 50px 0 40px;
32+
padding: 10px 20px 20px;
33+
text-align: center;
34+
}
35+
36+
.header .jumbotron .img-responsive {
37+
display: inline-block;
38+
margin: 5px auto;
39+
}
40+
41+
.header .jumbotron .logo-badge {
42+
max-width: 150px;
43+
}
44+
45+
/* @end Header */
46+
47+
48+
/* @group Doc Page */
49+
50+
.doc .doc-title {
51+
margin-top: 0;
52+
}
53+
54+
/* @end Doc Page */
55+
56+
57+
/* @group Footer */
58+
59+
.footer {
60+
text-align: center;
61+
padding: 20px;
62+
margin-bottom: 20px;
63+
}
64+
65+
.footer .links {
66+
padding: 20px 0;
67+
}
68+
69+
.footer .links .fa {
70+
margin: 0 10px;
71+
font-size: 22px;
72+
}
73+
74+
/* @end Footer */
75+
76+
77+
/* @group Github Ribbon - SVG */
78+
79+
.github-corner:hover .octo-arm {
80+
animation: octocat-wave 560ms ease-in-out;
81+
}
82+
83+
@keyframes octocat-wave {
84+
0% {
85+
transform: rotate(0deg);
86+
}
87+
20% {
88+
transform: rotate(-25deg);
89+
}
90+
40% {
91+
transform: rotate(10deg);
92+
}
93+
60% {
94+
transform: rotate(-25deg);
95+
}
96+
80% {
97+
transform: rotate(10deg);
98+
}
99+
100% {
100+
transform: rotate(0deg);
101+
}
102+
}
103+
104+
@media (max-width: 768px) {
105+
.github-corner {
106+
display: none;
107+
}
108+
.github-corner:hover .octo-arm {
109+
animation: none;
110+
}
111+
.github-corner .octo-arm {
112+
animation: octocat-wave 560ms ease-in-out;
113+
}
114+
}
115+
116+
/* @end Github Ribbon - SVG */

docs/images/logo-badge.png

70 KB
Loading

docs/live-api.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ Live API Endpoints allow you to test your endpoints from within DRF docs. For ea
99

1010
It is still in **beta** so if you face any problems - feel free to open an issue/pull request on GitHub.
1111

12-
<img class="img-responsive" src="images/live-api.png" alt="Live API Endpoints" />
12+
<img class="img-responsive" src="/images/live-api.png" alt="Live API Endpoints" />
1313

1414
The Live API is made with **[React](https://facebook.github.io/react/)**. For more information on how to hack on them, check the README of the repository.

docs/template/__init__.py

Whitespace-only changes.

docs/template/base.html

+109
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8">
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7+
{% if page_description %}<meta name="description" content="{{ page_description }}">{% endif %}
8+
{% if site_author %}<meta name="author" content="{{ site_author }}">{% endif %}
9+
{% if canonical_url %}<link rel="canonical" href="{{ canonical_url }}">{% endif %}
10+
{% if favicon %}<link rel="shortcut icon" href="{{ favicon }}">
11+
{% else %}<link rel="shortcut icon" href="{{ base_url }}/img/favicon.ico">{% endif %}
12+
13+
<title>{% if page_title %}{{ page_title }} - {% endif %}{{ site_name }}</title>
14+
15+
<link href="{{ base_url }}/css/bootstrap-custom.min.css" rel="stylesheet">
16+
<link href="{{ base_url }}/css/font-awesome-4.0.3.css" rel="stylesheet">
17+
<link rel="stylesheet" href="{{ base_url }}/css/highlight.css">
18+
<link href="{{ base_url }}/css/base.css" rel="stylesheet">
19+
{%- for path in extra_css %}
20+
<link href="{{ path }}" rel="stylesheet">
21+
{%- endfor %}
22+
23+
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
24+
<!--[if lt IE 9]>
25+
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
26+
<script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
27+
<![endif]-->
28+
29+
{% if google_analytics %}
30+
<script>
31+
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
32+
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
33+
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
34+
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
35+
36+
ga('create', '{{ google_analytics[0] }}', '{{ google_analytics[1] }}');
37+
ga('send', 'pageview');
38+
</script>
39+
{% endif %}
40+
</head>
41+
42+
<body>
43+
44+
{% include "nav.html" %}
45+
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>
55+
56+
<div class="container">
57+
<div class="col-md-3">{% include "toc.html" %}</div>
58+
<div class="col-md-9" role="main">{% include "content.html" %}</div>
59+
</div>
60+
61+
<footer class="col-md-12 footer">
62+
<div class="links">
63+
<a href="http://www.iamemmanouil.com"><i class="fa fa-link"></i></a>
64+
<a href="http://www.github.com/ekonstantinidis"><i class="fa fa-github"></i></a>
65+
<a href="http://www.twitter.com/iamemmanouil"><i class="fa fa-twitter"></i></a>
66+
</div>
67+
{% if copyright %}
68+
<center>{{ copyright }}</center>
69+
{% endif %}
70+
<div>Documentation built with <a href="http://www.mkdocs.org/">MkDocs</a>.</div>
71+
</footer>
72+
73+
74+
<script src="{{ base_url }}/js/jquery-1.10.2.min.js"></script>
75+
<script src="{{ base_url }}/js/bootstrap-3.0.3.min.js"></script>
76+
<script src="{{ base_url }}/js/highlight.pack.js"></script>
77+
<script>var base_url = '{{ base_url }}';</script>
78+
<script data-main="{{ base_url }}/mkdocs/js/search.js" src="{{ base_url }}/mkdocs/js/require.js"></script>
79+
<script src="{{ base_url }}/js/base.js"></script>
80+
{%- for path in extra_javascript %}
81+
<script src="{{ path }}"></script>
82+
{%- endfor %}
83+
84+
<div class="modal" id="mkdocs_search_modal" tabindex="-1" role="dialog" aria-labelledby="Search Modal" aria-hidden="true">
85+
<div class="modal-dialog">
86+
<div class="modal-content">
87+
<div class="modal-header">
88+
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
89+
<h4 class="modal-title" id="exampleModalLabel">Search</h4>
90+
</div>
91+
<div class="modal-body">
92+
<p>
93+
From here you can search these documents. Enter
94+
your search terms below.
95+
</p>
96+
<form role="form">
97+
<div class="form-group">
98+
<input type="text" class="form-control" placeholder="Search..." id="mkdocs-search-query">
99+
</div>
100+
</form>
101+
<div id="mkdocs-search-results"></div>
102+
</div>
103+
<div class="modal-footer">
104+
</div>
105+
</div>
106+
</div>
107+
</div>
108+
</body>
109+
</html>

docs/template/content.html

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{% if meta.source %}
2+
<div class="source-links">
3+
{% for filename in meta.source %}
4+
<span class="label label-primary">{{ filename }}</span>
5+
{% endfor %}
6+
</div>
7+
{% endif %}
8+
9+
{{ content }}

0 commit comments

Comments
 (0)