Commit 8f119a8c by Tom Christie

Merge pull request #253 from droptype/rf2-docfixes

Fixes for the documentation styles
parents 80c50bfd f95f96ab
/*! /*!
* Bootstrap Responsive v2.1.0 * Bootstrap Responsive v2.1.1
* *
* Copyright 2012 Twitter, Inc * Copyright 2012 Twitter, Inc
* Licensed under the Apache License v2.0 * Licensed under the Apache License v2.0
...@@ -107,6 +107,7 @@ ...@@ -107,6 +107,7 @@
} }
[class*="span"] { [class*="span"] {
float: left; float: left;
min-height: 1px;
margin-left: 30px; margin-left: 30px;
} }
.container, .container,
...@@ -453,6 +454,7 @@ ...@@ -453,6 +454,7 @@
} }
[class*="span"] { [class*="span"] {
float: left; float: left;
min-height: 1px;
margin-left: 20px; margin-left: 20px;
} }
.container, .container,
...@@ -780,7 +782,8 @@ ...@@ -780,7 +782,8 @@
padding-left: 20px; padding-left: 20px;
} }
.navbar-fixed-top, .navbar-fixed-top,
.navbar-fixed-bottom { .navbar-fixed-bottom,
.navbar-static-top {
margin-right: -20px; margin-right: -20px;
margin-left: -20px; margin-left: -20px;
} }
...@@ -814,8 +817,11 @@ ...@@ -814,8 +817,11 @@
.row-fluid [class*="span"] { .row-fluid [class*="span"] {
display: block; display: block;
float: none; float: none;
width: auto; width: 100%;
margin-left: 0; margin-left: 0;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
} }
.span12, .span12,
.row-fluid .span12 { .row-fluid .span12 {
...@@ -845,6 +851,9 @@ ...@@ -845,6 +851,9 @@
display: inline-block; display: inline-block;
width: auto; width: auto;
} }
.controls-row [class*="span"] + [class*="span"] {
margin-left: 0;
}
.modal { .modal {
position: fixed; position: fixed;
top: 20px; top: 20px;
...@@ -870,7 +879,7 @@ ...@@ -870,7 +879,7 @@
input[type="radio"] { input[type="radio"] {
border: 1px solid #ccc; border: 1px solid #ccc;
} }
.form-horizontal .control-group > label { .form-horizontal .control-label {
float: none; float: none;
width: auto; width: auto;
padding-top: 0; padding-top: 0;
...@@ -944,14 +953,14 @@ ...@@ -944,14 +953,14 @@
display: none; display: none;
} }
.nav-collapse .nav .nav-header { .nav-collapse .nav .nav-header {
color: #555555; color: #777777;
text-shadow: none; text-shadow: none;
} }
.nav-collapse .nav > li > a, .nav-collapse .nav > li > a,
.nav-collapse .dropdown-menu a { .nav-collapse .dropdown-menu a {
padding: 9px 15px; padding: 9px 15px;
font-weight: bold; font-weight: bold;
color: #555555; color: #777777;
-webkit-border-radius: 3px; -webkit-border-radius: 3px;
-moz-border-radius: 3px; -moz-border-radius: 3px;
border-radius: 3px; border-radius: 3px;
...@@ -1003,6 +1012,10 @@ ...@@ -1003,6 +1012,10 @@
.nav-collapse .dropdown-menu .divider { .nav-collapse .dropdown-menu .divider {
display: none; display: none;
} }
.nav-collapse .nav > li > .dropdown-menu:before,
.nav-collapse .nav > li > .dropdown-menu:after {
display: none;
}
.nav-collapse .navbar-form, .nav-collapse .navbar-form,
.nav-collapse .navbar-search { .nav-collapse .navbar-search {
float: none; float: none;
...@@ -1014,6 +1027,11 @@ ...@@ -1014,6 +1027,11 @@
-moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1); -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1);
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1);
} }
.navbar-inverse .nav-collapse .navbar-form,
.navbar-inverse .nav-collapse .navbar-search {
border-top-color: #111111;
border-bottom-color: #111111;
}
.navbar .nav-collapse .nav.pull-right { .navbar .nav-collapse .nav.pull-right {
float: none; float: none;
margin-left: 0; margin-left: 0;
......
/* Set the body padding-top when above 980px to push the content down from
below the navbar, which is fixed at >980px screen widths. */
@media (min-width: 980px) {
body {
padding-top: 71px;
}
}
body {
padding-bottom: 40px;
}
/* Preserve the spacing of the navbar across different screen sizes. */
.navbar-inner {
padding: 5px 0;
}
@media (max-width: 979px) {
.navbar .brand {
margin-left: 0;
padding-left: 0;
}
.navbar-inner .container-fluid {
padding-left: 15px;
}
}
.nav-list li.main {
font-weight: bold;
}
/* Set the table of contents to static so it flows back into the content when
viewed on tablets and smaller. */
@media (max-width: 767px) {
#table-of-contents {
position: static;
}
}
/* When the page is in two-column layout, give the main content some room
to breath on the left. */
@media (min-width: 768px) {
#main-content {
padding-left: 1em;
}
}
blockquote {
font-family: Georgia, serif;
font-size: 18px;
font-style: italic;
margin: 0.25em 0;
padding: 0.25em 40px;
line-height: 1.45;
position: relative;
color: #383838;
border-left: none;
}
blockquote:before {
display: block;
content: "\201C";
font-size: 80px;
position: absolute;
left: -10px;
top: -20px;
color: #7a7a7a;
}
blockquote p:last-child {
color: #999999;
font-size: 14px;
display: block;
margin-top: 5px;
}
/* ==========================================================
* bootstrap-affix.js v2.1.1
* http://twitter.github.com/bootstrap/javascript.html#affix
* ==========================================================
* Copyright 2012 Twitter, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* ========================================================== */
!function ($) {
"use strict"; // jshint ;_;
/* AFFIX CLASS DEFINITION
* ====================== */
var Affix = function (element, options) {
this.options = $.extend({}, $.fn.affix.defaults, options)
this.$window = $(window).on('scroll.affix.data-api', $.proxy(this.checkPosition, this))
this.$element = $(element)
this.checkPosition()
}
Affix.prototype.checkPosition = function () {
if (!this.$element.is(':visible')) return
var scrollHeight = $(document).height()
, scrollTop = this.$window.scrollTop()
, position = this.$element.offset()
, offset = this.options.offset
, offsetBottom = offset.bottom
, offsetTop = offset.top
, reset = 'affix affix-top affix-bottom'
, affix
if (typeof offset != 'object') offsetBottom = offsetTop = offset
if (typeof offsetTop == 'function') offsetTop = offset.top()
if (typeof offsetBottom == 'function') offsetBottom = offset.bottom()
affix = this.unpin != null && (scrollTop + this.unpin <= position.top) ?
false : offsetBottom != null && (position.top + this.$element.height() >= scrollHeight - offsetBottom) ?
'bottom' : offsetTop != null && scrollTop <= offsetTop ?
'top' : false
if (this.affixed === affix) return
this.affixed = affix
this.unpin = affix == 'bottom' ? position.top - scrollTop : null
this.$element.removeClass(reset).addClass('affix' + (affix ? '-' + affix : ''))
}
/* AFFIX PLUGIN DEFINITION
* ======================= */
$.fn.affix = function (option) {
return this.each(function () {
var $this = $(this)
, data = $this.data('affix')
, options = typeof option == 'object' && option
if (!data) $this.data('affix', (data = new Affix(this, options)))
if (typeof option == 'string') data[option]()
})
}
$.fn.affix.Constructor = Affix
$.fn.affix.defaults = {
offset: 0
}
/* AFFIX DATA-API
* ============== */
$(window).on('load', function () {
$('[data-spy="affix"]').each(function () {
var $spy = $(this)
, data = $spy.data()
data.offset = data.offset || {}
data.offsetBottom && (data.offset.bottom = data.offsetBottom)
data.offsetTop && (data.offset.top = data.offsetTop)
$spy.affix(data)
})
})
}(window.jQuery);
\ No newline at end of file
/* ========================================================== /* ==========================================================
* bootstrap-alert.js v2.1.0 * bootstrap-alert.js v2.1.1
* http://twitter.github.com/bootstrap/javascript.html#alerts * http://twitter.github.com/bootstrap/javascript.html#alerts
* ========================================================== * ==========================================================
* Copyright 2012 Twitter, Inc. * Copyright 2012 Twitter, Inc.
......
/* ============================================================ /* ============================================================
* bootstrap-button.js v2.1.0 * bootstrap-button.js v2.1.1
* http://twitter.github.com/bootstrap/javascript.html#buttons * http://twitter.github.com/bootstrap/javascript.html#buttons
* ============================================================ * ============================================================
* Copyright 2012 Twitter, Inc. * Copyright 2012 Twitter, Inc.
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
} }
Button.prototype.toggle = function () { Button.prototype.toggle = function () {
var $parent = this.$element.parent('[data-toggle="buttons-radio"]') var $parent = this.$element.closest('[data-toggle="buttons-radio"]')
$parent && $parent $parent && $parent
.find('.active') .find('.active')
......
/* ========================================================== /* ==========================================================
* bootstrap-carousel.js v2.1.0 * bootstrap-carousel.js v2.1.1
* http://twitter.github.com/bootstrap/javascript.html#carousel * http://twitter.github.com/bootstrap/javascript.html#carousel
* ========================================================== * ==========================================================
* Copyright 2012 Twitter, Inc. * Copyright 2012 Twitter, Inc.
......
/* ============================================================= /* =============================================================
* bootstrap-collapse.js v2.1.0 * bootstrap-collapse.js v2.1.1
* http://twitter.github.com/bootstrap/javascript.html#collapse * http://twitter.github.com/bootstrap/javascript.html#collapse
* ============================================================= * =============================================================
* Copyright 2012 Twitter, Inc. * Copyright 2012 Twitter, Inc.
......
/* ============================================================ /* ============================================================
* bootstrap-dropdown.js v2.1.0 * bootstrap-dropdown.js v2.1.1
* http://twitter.github.com/bootstrap/javascript.html#dropdowns * http://twitter.github.com/bootstrap/javascript.html#dropdowns
* ============================================================ * ============================================================
* Copyright 2012 Twitter, Inc. * Copyright 2012 Twitter, Inc.
...@@ -110,7 +110,7 @@ ...@@ -110,7 +110,7 @@
if (!selector) { if (!selector) {
selector = $this.attr('href') selector = $this.attr('href')
selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7 selector = selector && /#/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
} }
$parent = $(selector) $parent = $(selector)
...@@ -142,7 +142,7 @@ ...@@ -142,7 +142,7 @@
$('html') $('html')
.on('click.dropdown.data-api touchstart.dropdown.data-api', clearMenus) .on('click.dropdown.data-api touchstart.dropdown.data-api', clearMenus)
$('body') $('body')
.on('click.dropdown touchstart.dropdown.data-api', '.dropdown', function (e) { e.stopPropagation() }) .on('click.dropdown touchstart.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
.on('click.dropdown.data-api touchstart.dropdown.data-api' , toggle, Dropdown.prototype.toggle) .on('click.dropdown.data-api touchstart.dropdown.data-api' , toggle, Dropdown.prototype.toggle)
.on('keydown.dropdown.data-api touchstart.dropdown.data-api', toggle + ', [role=menu]' , Dropdown.prototype.keydown) .on('keydown.dropdown.data-api touchstart.dropdown.data-api', toggle + ', [role=menu]' , Dropdown.prototype.keydown)
}) })
......
/* ========================================================= /* =========================================================
* bootstrap-modal.js v2.1.0 * bootstrap-modal.js v2.1.1
* http://twitter.github.com/bootstrap/javascript.html#modals * http://twitter.github.com/bootstrap/javascript.html#modals
* ========================================================= * =========================================================
* Copyright 2012 Twitter, Inc. * Copyright 2012 Twitter, Inc.
......
/* =========================================================== /* ===========================================================
* bootstrap-popover.js v2.1.0 * bootstrap-popover.js v2.1.1
* http://twitter.github.com/bootstrap/javascript.html#popovers * http://twitter.github.com/bootstrap/javascript.html#popovers
* =========================================================== * ===========================================================
* Copyright 2012 Twitter, Inc. * Copyright 2012 Twitter, Inc.
......
/* ============================================================= /* =============================================================
* bootstrap-scrollspy.js v2.1.0 * bootstrap-scrollspy.js v2.1.1
* http://twitter.github.com/bootstrap/javascript.html#scrollspy * http://twitter.github.com/bootstrap/javascript.html#scrollspy
* ============================================================= * =============================================================
* Copyright 2012 Twitter, Inc. * Copyright 2012 Twitter, Inc.
......
/* ======================================================== /* ========================================================
* bootstrap-tab.js v2.1.0 * bootstrap-tab.js v2.1.1
* http://twitter.github.com/bootstrap/javascript.html#tabs * http://twitter.github.com/bootstrap/javascript.html#tabs
* ======================================================== * ========================================================
* Copyright 2012 Twitter, Inc. * Copyright 2012 Twitter, Inc.
......
/* =========================================================== /* ===========================================================
* bootstrap-tooltip.js v2.1.0 * bootstrap-tooltip.js v2.1.1
* http://twitter.github.com/bootstrap/javascript.html#tooltips * http://twitter.github.com/bootstrap/javascript.html#tooltips
* Inspired by the original jQuery.tipsy by Jason Frame * Inspired by the original jQuery.tipsy by Jason Frame
* =========================================================== * ===========================================================
......
/* =================================================== /* ===================================================
* bootstrap-transition.js v2.1.0 * bootstrap-transition.js v2.1.1
* http://twitter.github.com/bootstrap/javascript.html#transitions * http://twitter.github.com/bootstrap/javascript.html#transitions
* =================================================== * ===================================================
* Copyright 2012 Twitter, Inc. * Copyright 2012 Twitter, Inc.
......
/* ============================================================= /* =============================================================
* bootstrap-typeahead.js v2.1.0 * bootstrap-typeahead.js v2.1.1
* http://twitter.github.com/bootstrap/javascript.html#typeahead * http://twitter.github.com/bootstrap/javascript.html#typeahead
* ============================================================= * =============================================================
* Copyright 2012 Twitter, Inc. * Copyright 2012 Twitter, Inc.
...@@ -174,7 +174,7 @@ ...@@ -174,7 +174,7 @@
.on('keypress', $.proxy(this.keypress, this)) .on('keypress', $.proxy(this.keypress, this))
.on('keyup', $.proxy(this.keyup, this)) .on('keyup', $.proxy(this.keyup, this))
if ($.browser.webkit || $.browser.msie) { if ($.browser.chrome || $.browser.webkit || $.browser.msie) {
this.$element.on('keydown', $.proxy(this.keydown, this)) this.$element.on('keydown', $.proxy(this.keydown, this))
} }
......
...@@ -8,47 +8,8 @@ ...@@ -8,47 +8,8 @@
<!-- Le styles --> <!-- Le styles -->
<link href="{{ base_url }}/css/bootstrap.css" rel="stylesheet"> <link href="{{ base_url }}/css/bootstrap.css" rel="stylesheet">
<style type="text/css">
body {
padding-top: 60px;
padding-bottom: 40px;
}
.sidebar-nav {
padding: 9px 0;
}
.nav-list li.main {
font-weight: bold;
}
blockquote {
font-family: Georgia, serif;
font-size: 18px;
font-style: italic;
margin: 0.25em 0;
padding: 0.25em 40px;
line-height: 1.45;
position: relative;
color: #383838;
border-left: none;
}
blockquote:before {
display: block;
content: "\201C";
font-size: 80px;
position: absolute;
left: -10px;
top: -20px;
color: #7a7a7a;
}
blockquote p:last-child {
color: #999999;
font-size: 14px;
display: block;
margin-top: 5px;
}
</style>
<link href="{{ base_url }}/css/bootstrap-responsive.css" rel="stylesheet"> <link href="{{ base_url }}/css/bootstrap-responsive.css" rel="stylesheet">
<link href="{{ base_url }}/css/drf-styles.css" rel="stylesheet">
<!-- Le HTML5 shim, for IE6-8 support of HTML5 elements --> <!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]> <!--[if lt IE 9]>
...@@ -108,14 +69,14 @@ margin-top: 5px; ...@@ -108,14 +69,14 @@ margin-top: 5px;
</li> </li>
</ul> </ul>
<ul class="nav pull-right"> <ul class="nav pull-right">
<li class="dropdown"> <li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Version: 2.0.0 <b class="caret"></b></a> <a href="#" class="dropdown-toggle" data-toggle="dropdown">Version: 2.0.0 <b class="caret"></b></a>
<ul class="dropdown-menu"> <ul class="dropdown-menu">
<li><a href="#">Trunk</a></li> <li><a href="#">Trunk</a></li>
<li><a href="#">2.0.0</a></li> <li><a href="#">2.0.0</a></li>
</ul> </ul>
</li> </li>
</ul> </ul>
</div><!--/.nav-collapse --> </div><!--/.nav-collapse -->
</div> </div>
</div> </div>
...@@ -123,16 +84,16 @@ margin-top: 5px; ...@@ -123,16 +84,16 @@ margin-top: 5px;
<div class="container-fluid"> <div class="container-fluid">
<div class="row-fluid"> <div class="row-fluid">
<div class="span3"> <div class="span3">
<div class="well affix span3"> <div id="table-of-contents" class="well affix span3">
<ul class="nav nav-list side-nav"> <ul class="nav nav-list side-nav">
{{ toc }} {{ toc }}
</ul> </ul>
</div> </div>
</div> </div>
<div class="span9"> <div id="main-content" class="span9">
{{ content }} {{ content }}
</div><!--/span--> </div><!--/span-->
</div><!--/row--> </div><!--/row-->
</div><!--/.fluid-container--> </div><!--/.fluid-container-->
...@@ -140,13 +101,14 @@ margin-top: 5px; ...@@ -140,13 +101,14 @@ margin-top: 5px;
<!-- Le javascript <!-- Le javascript
================================================== --> ================================================== -->
<!-- Placed at the end of the document so the pages load faster --> <!-- Placed at the end of the document so the pages load faster -->
<script src="{{ base_url }}/js/jquery.js"></script> <script src="{{ base_url }}/js/jquery-1.8.1-min.js"></script>
<script src="{{ base_url }}/js/bootstrap-dropdown.js"></script> <script src="{{ base_url }}/js/bootstrap-dropdown.js"></script>
<script src="{{ base_url }}/js/bootstrap-scrollspy.js"></script> <script src="{{ base_url }}/js/bootstrap-scrollspy.js"></script>
<script src="{{ base_url }}/js/bootstrap-collapse.js"></script>
<script> <script>
//$('.side-nav').scrollspy() //$('.side-nav').scrollspy()
var shiftWindow = function() { scrollBy(0, -50) }; var shiftWindow = function() { scrollBy(0, -50) };
if (location.hash) shiftWindow(); if (location.hash) shiftWindow();
window.addEventListener("hashchange", shiftWindow); window.addEventListener("hashchange", shiftWindow);
</script> </script>
</body></html> </body></html>
\ No newline at end of file
...@@ -44,6 +44,6 @@ We've reached the end of our tutorial. If you want to get more involved in the ...@@ -44,6 +44,6 @@ We've reached the end of our tutorial. If you want to get more involved in the
* Contribute on GitHub by reviewing issues, and submitting issues or pull requests. * Contribute on GitHub by reviewing issues, and submitting issues or pull requests.
* Join the REST framework group, and help build the community. * Join the REST framework group, and help build the community.
* Follow me on Twitter and say hi. * Follow me [on Twitter](https://twitter.com/_tomchristie) and say hi.
Now go build something great. Now go build something great.
\ No newline at end of file
...@@ -28,7 +28,7 @@ sub_header = '<li><a href="#{{ anchor }}">{{ title }}</a></li>' ...@@ -28,7 +28,7 @@ sub_header = '<li><a href="#{{ anchor }}">{{ title }}</a></li>'
page = open(os.path.join(docs_dir, 'template.html'), 'r').read() page = open(os.path.join(docs_dir, 'template.html'), 'r').read()
# Copy static files # Copy static files
for static in ['css', 'js']: for static in ['css', 'js', 'img']:
source = os.path.join(docs_dir, 'static', static) source = os.path.join(docs_dir, 'static', static)
target = os.path.join(html_dir, static) target = os.path.join(html_dir, static)
if os.path.exists(target): if os.path.exists(target):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment