From 84958d131a29d80acea94dec5260b484556e73d0 Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Fri, 5 Oct 2012 15:22:30 +0100 Subject: Doc style tweaks --- docs/api-guide/responses.md | 4 ++-- docs/api-guide/views.md | 6 +++--- docs/static/css/default.css | 24 ++++++++++++++++++++++++ docs/template.html | 14 +++++++++++++- docs/tutorial/1-serialization.md | 3 ++- 5 files changed, 44 insertions(+), 7 deletions(-) diff --git a/docs/api-guide/responses.md b/docs/api-guide/responses.md index 724428f8..b5ad843b 100644 --- a/docs/api-guide/responses.md +++ b/docs/api-guide/responses.md @@ -56,7 +56,7 @@ The `Response` class extends `SimpleTemplateResponse`, and all the usual methods ## .data -The unrendered content of a `Request` object can be accessed using the `.data` attribute. +The unrendered content of a `Request` object. ## .status_code @@ -64,7 +64,7 @@ The numeric status code of the HTTP response. ## .content -The rendered content of the response. `.render()` must have been called before `.content` can be accessed. +The rendered content of the response. The `.render()` method must have been called before `.content` can be accessed. ## .template_name diff --git a/docs/api-guide/views.md b/docs/api-guide/views.md index a615026f..cbfa2e28 100644 --- a/docs/api-guide/views.md +++ b/docs/api-guide/views.md @@ -83,7 +83,7 @@ The following methods are called before dispatching to the handler method. The following methods are called directly by the view's `.dispatch()` method. These perform any actions that need to occur before or after calling the handler methods such as `.get()`, `.post()`, `put()` and `.delete()`. -### .initial(self, request, *args, **kwargs) +### .initial(self, request, \*args, **kwargs) Performs any actions that need to occur before the handler method gets called. This method is used to enforce permissions and throttling, and perform content negotiation. @@ -98,13 +98,13 @@ The default implementation handles any subclass of `rest_framework.exceptions.AP If you need to customize the error responses your API returns you should subclass this method. -### .initialize_request(self, request, *args, **kwargs) +### .initialize_request(self, request, \*args, **kwargs) Ensures that the request object that is passed to the handler method is an instance of `Request`, rather than the usual Django `HttpRequest`. You won't typically need to override this method. -### .finalize_response(self, request, response, *args, **kwargs) +### .finalize_response(self, request, response, \*args, **kwargs) Ensures that any `Response` object returned from the handler method will be rendered into the correct content type, as determined by the content negotation. diff --git a/docs/static/css/default.css b/docs/static/css/default.css index 5a73fb99..8401687d 100644 --- a/docs/static/css/default.css +++ b/docs/static/css/default.css @@ -61,6 +61,30 @@ a.github:hover { text-decoration: none; } +/* Footer */ +/* +.footer p { + text-align: center; + color: gray; + border-top: 1px solid #DDD; + padding-top: 10px; +} + +.footer a { + color: gray; + font-weight: bold; +} + +.footer a:hover { + color: gray; +} +*/ + +/* */ +body hr { + border-top: 1px dotted #A30000 +} + /* Force TOC text to not overrun */ #table-of-contents { overflow: hidden; diff --git a/docs/template.html b/docs/template.html index b6d2adf2..dc401d89 100644 --- a/docs/template.html +++ b/docs/template.html @@ -89,6 +89,8 @@ +