From d37994821dfa64e06bac1158face450aff09be89 Mon Sep 17 00:00:00 2001 From: Emmanouil Konstantinidis Date: Wed, 8 Feb 2017 16:25:06 +0000 Subject: [PATCH] Docs - Improve UI (#4890) --- .../static/rest_framework/docs/css/base.css | 33 +++++++++++++++++-- .../rest_framework/docs/document.html | 4 ++- .../templates/rest_framework/docs/link.html | 19 ++++++++--- 3 files changed, 48 insertions(+), 8 deletions(-) diff --git a/rest_framework/static/rest_framework/docs/css/base.css b/rest_framework/static/rest_framework/docs/css/base.css index 7f172b41e..ad19b1daf 100644 --- a/rest_framework/static/rest_framework/docs/css/base.css +++ b/rest_framework/static/rest_framework/docs/css/base.css @@ -186,13 +186,29 @@ body { padding: 0px; } -.coredocs-section { +.coredocs-section-title { margin-top: 20px; padding-bottom: 10px; border-bottom: 1px solid lightgrey; } -.coredocs-section:last-child { +.coredocs-link-title a, +.coredocs-section-title a { + display: none; +} + +.coredocs-link-title a, +.coredocs-section-title a { + text-decoration: none; +} + +.coredocs-link-title:hover a, +.coredocs-section-title:hover a { + display: inline; + font-size: 20px; +} + +.coredocs-section-title:last-child { margin-top: 0; } @@ -242,6 +258,18 @@ body { /* @group Docs Content */ +.docs-content .meta .label { + vertical-align: middle; + font-size: 14px; + font-weight: normal; +} + +.docs-content .meta code { + vertical-align: middle; + padding: .2em .6em .3em; + font-size: 14px; +} + .docs-content .btn { font-size: inherit; } @@ -249,4 +277,5 @@ body { .code-samples pre { margin-top: 20px; } + /* @end Docs Content */ diff --git a/rest_framework/templates/rest_framework/docs/document.html b/rest_framework/templates/rest_framework/docs/document.html index 1824e5bfa..22af83338 100644 --- a/rest_framework/templates/rest_framework/docs/document.html +++ b/rest_framework/templates/rest_framework/docs/document.html @@ -1,7 +1,9 @@ {% load rest_framework %} {% for section_key, section in document.data.items %} -

{{ section_key }}

+

{{ section_key }} +

+ {% for link_key, link in section.links.items %} {% include "rest_framework/docs/link.html" %} {% endfor %} diff --git a/rest_framework/templates/rest_framework/docs/link.html b/rest_framework/templates/rest_framework/docs/link.html index 6de23dcaf..0476e3f8e 100644 --- a/rest_framework/templates/rest_framework/docs/link.html +++ b/rest_framework/templates/rest_framework/docs/link.html @@ -2,12 +2,21 @@