aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Christie2012-09-08 22:06:13 +0100
committerTom Christie2012-09-08 22:06:13 +0100
commit247696e820dfe4535b3141d744129d654f9b6aea (patch)
treefee3e54b16f459b0b0501ee83122cc4b9b06c3cb
parent5d9dfcd8ae10db37f0cca043d3b9977e27197487 (diff)
downloaddjango-rest-framework-247696e820dfe4535b3141d744129d654f9b6aea.tar.bz2
Links to source files in docs
-rw-r--r--docs/api-guide/authentication.md2
-rw-r--r--docs/api-guide/exceptions.md2
-rw-r--r--docs/api-guide/parsers.md2
-rw-r--r--docs/api-guide/permissions.md2
-rw-r--r--docs/api-guide/renderers.md2
-rw-r--r--docs/api-guide/requests.md2
-rw-r--r--docs/api-guide/responses.md2
-rw-r--r--docs/api-guide/reverse.md2
-rw-r--r--docs/api-guide/serializers.md2
-rw-r--r--docs/api-guide/settings.md2
-rw-r--r--docs/api-guide/status-codes.md2
-rw-r--r--docs/api-guide/throttling.md2
-rw-r--r--docs/api-guide/views.md2
-rw-r--r--docs/static/css/drf-styles.css12
-rwxr-xr-xmkdocs.py2
15 files changed, 38 insertions, 2 deletions
diff --git a/docs/api-guide/authentication.md b/docs/api-guide/authentication.md
index 45da2c55..ca29bc4d 100644
--- a/docs/api-guide/authentication.md
+++ b/docs/api-guide/authentication.md
@@ -1,3 +1,5 @@
+<a class="github" href="authentication.py"></a>
+
# Authentication
Authentication is the mechanism of associating an incoming request with a set of identifying credentials, such as the user the request came from, or the token that it was signed with. The [permission] and [throttling] policies can then use those credentials to determine if the request should be permitted.
diff --git a/docs/api-guide/exceptions.md b/docs/api-guide/exceptions.md
index d41327c6..bb3ed56e 100644
--- a/docs/api-guide/exceptions.md
+++ b/docs/api-guide/exceptions.md
@@ -1,3 +1,5 @@
+<a class="github" href="exceptions.py"></a>
+
# Exceptions
diff --git a/docs/api-guide/parsers.md b/docs/api-guide/parsers.md
index 2edc11de..5e2344a3 100644
--- a/docs/api-guide/parsers.md
+++ b/docs/api-guide/parsers.md
@@ -1,3 +1,5 @@
+<a class="github" href="parsers.py"></a>
+
# Parsers
## .parse(request)
diff --git a/docs/api-guide/permissions.md b/docs/api-guide/permissions.md
index 8b137891..2e15107c 100644
--- a/docs/api-guide/permissions.md
+++ b/docs/api-guide/permissions.md
@@ -1 +1,3 @@
+<a class="github" href="permissions.py"></a>
+# Permissions \ No newline at end of file
diff --git a/docs/api-guide/renderers.md b/docs/api-guide/renderers.md
index 5a66da69..1cd6d1a0 100644
--- a/docs/api-guide/renderers.md
+++ b/docs/api-guide/renderers.md
@@ -1,3 +1,5 @@
+<a class="github" href="renderers.py"></a>
+
# Renderers
## .render(response)
diff --git a/docs/api-guide/requests.md b/docs/api-guide/requests.md
index 67ddfdac..6746bb20 100644
--- a/docs/api-guide/requests.md
+++ b/docs/api-guide/requests.md
@@ -1,3 +1,5 @@
+<a class="github" href="request.py"></a>
+
# Requests
> If you're doing REST-based web service stuff ... you should ignore request.POST.
diff --git a/docs/api-guide/responses.md b/docs/api-guide/responses.md
index 38f6e8cb..6c279f17 100644
--- a/docs/api-guide/responses.md
+++ b/docs/api-guide/responses.md
@@ -1,3 +1,5 @@
+<a class="github" href="response.py"></a>
+
# Responses
> Unlike basic HttpResponse objects, TemplateResponse objects retain the details of the context that was provided by the view to compute the response. The final output of the response is not computed until it is needed, later in the response process.
diff --git a/docs/api-guide/reverse.md b/docs/api-guide/reverse.md
index 5a1d6e26..6e42b68e 100644
--- a/docs/api-guide/reverse.md
+++ b/docs/api-guide/reverse.md
@@ -1,3 +1,5 @@
+<a class="github" href="reverse.py"></a>
+
# Returning URIs from your Web APIs
> The central feature that distinguishes the REST architectural style from other network-based styles is its emphasis on a uniform interface between components.
diff --git a/docs/api-guide/serializers.md b/docs/api-guide/serializers.md
index 377b0c10..38a1e560 100644
--- a/docs/api-guide/serializers.md
+++ b/docs/api-guide/serializers.md
@@ -1,3 +1,5 @@
+<a class="github" href="serializers.py"></a>
+
# Serializers
> Expanding the usefulness of the serializers is something that we would
diff --git a/docs/api-guide/settings.md b/docs/api-guide/settings.md
index 1411b9ec..ae8dce76 100644
--- a/docs/api-guide/settings.md
+++ b/docs/api-guide/settings.md
@@ -1,3 +1,5 @@
+<a class="github" href="settings.py"></a>
+
# Settings
Configuration for REST framework is all namespaced inside the `API_SETTINGS` setting.
diff --git a/docs/api-guide/status-codes.md b/docs/api-guide/status-codes.md
index c1d45905..6693c79f 100644
--- a/docs/api-guide/status-codes.md
+++ b/docs/api-guide/status-codes.md
@@ -1,3 +1,5 @@
+<a class="github" href="status.py"></a>
+
# Status Codes
> 418 I'm a teapot - Any attempt to brew coffee with a teapot should result in the error code "418 I'm a teapot". The resulting entity body MAY be short and stout.
diff --git a/docs/api-guide/throttling.md b/docs/api-guide/throttling.md
index 8b137891..e3a66c83 100644
--- a/docs/api-guide/throttling.md
+++ b/docs/api-guide/throttling.md
@@ -1 +1,3 @@
+<a class="github" href="throttling.py"></a>
+# Throttling
diff --git a/docs/api-guide/views.md b/docs/api-guide/views.md
index dd1dbebe..43924544 100644
--- a/docs/api-guide/views.md
+++ b/docs/api-guide/views.md
@@ -1,3 +1,5 @@
+<a class="github" href="views.py"></a>
+
> Django's class based views are a welcome departure from the old-style views.
>
> &mdash; [Reinout van Rees][cite]
diff --git a/docs/static/css/drf-styles.css b/docs/static/css/drf-styles.css
index ecbd415c..a0566790 100644
--- a/docs/static/css/drf-styles.css
+++ b/docs/static/css/drf-styles.css
@@ -14,6 +14,14 @@ pre {
font-size: 12px;
}
+a.github {
+ float: right;
+ margin-top: -12px;
+}
+
+a.github:hover {
+ text-decoration: none;
+}
/* Preserve the spacing of the navbar across different screen sizes. */
.navbar-inner {
@@ -66,7 +74,7 @@ blockquote {
border-left: none;
}
- blockquote:before {
+blockquote:before {
display: block;
content: "\201C";
font-size: 80px;
@@ -76,7 +84,7 @@ blockquote {
color: #7a7a7a;
}
- blockquote p:last-child {
+blockquote p:last-child {
color: #999999;
font-size: 14px;
display: block;
diff --git a/mkdocs.py b/mkdocs.py
index 0acb14d1..7fb0bc17 100755
--- a/mkdocs.py
+++ b/mkdocs.py
@@ -24,6 +24,7 @@ else:
main_header = '<li class="main"><a href="#{{ anchor }}">{{ title }}</a></li>'
sub_header = '<li><a href="#{{ anchor }}">{{ title }}</a></li>'
+code_label = r'<a class="github" href="https://github.com/tomchristie/django-rest-framework/blob/restframework2/djangorestframework/\1"><span class="label label-info">\1</span></a>'
page = open(os.path.join(docs_dir, 'template.html'), 'r').read()
@@ -68,4 +69,5 @@ for (dirpath, dirnames, filenames) in os.walk(docs_dir):
output = re.sub(r'a href="([^"]*)\.md"', r'a href="\1%s"' % suffix, output)
output = re.sub(r'<pre><code>:::bash', r'<pre class="prettyprint lang-bsh">', output)
output = re.sub(r'<pre>', r'<pre class="prettyprint lang-py">', output)
+ output = re.sub(r'<a class="github" href="([^"]*)"></a>', code_label, output)
open(build_file, 'w').write(output.encode('utf-8'))