docs improvement: initial page is now gettingstarted/intro, avoid glitch when scrolling on the api, remove old files, and add color on the navtop menu.

This commit is contained in:
Mathieu Virbel 2013-04-30 10:41:28 +02:00
parent 67bc381a61
commit b7e6f54297
16 changed files with 70 additions and 789 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

View File

@ -1,729 +0,0 @@
@font-face {
font-family: 'Nobile';
font-style: normal;
font-weight: normal;
src: local('Nobile'), url('nobile.ttf') format('truetype');
}
body {
margin: 0;
padding: 0;
font-family: Verdana, Arial, sans-serif;
font-size: 13px;
background: #000000 url('bg.jpg') top left repeat;
background-attachment: fixed;
}
table {
font-family: Verdana, Arial, sans-serif;
font-size: 13px;
}
a img {
border: none;
}
a {
color: #666;
outline: 0;
}
a:hover {
color: #222;
}
/** Layout
*/
#content {
background-color: #f8f8f8;
color: #4a4a4a;
border-left: 1px solid #666666;
width: 840px;
}
#content dd,
#content p,
#content ul,
#content pre {
line-height: 20px;
}
#contentall {
width: 1090px;
margin: 0px auto;
}
#content .wrapper {
padding: 1px 20px;
}
.clearer {
clear: left;
}
/** Header
*/
#topbar {
height: 120px;
}
#topwrapper {
width: 1090px;
clear: left;
margin: 0 auto;
}
#toplogo {
font-size: 13px;
padding: 25px 0px;
float: left;
width: 300px;
}
#toplogo a {
text-decoration: none;
}
#topmenu {
display: block;
font-size: 13px;
}
#topmenu ul.navigation {
float: right;
margin-right: 250px;
}
#topmenu ul.navigation li {
float: left;
list-style-type: none;
}
#topmenu ul.navigation li a {
float: left;
margin-left: 30px;
line-height: 30px;
list-style-type: none;
color: #bbb;
margin-top: 30px;
font-family: 'Nobile', 'OpenSans', Verdara, sans-serif;
text-decoration: none;
}
.sphinxsidebar a {
color: #bbb;
text-decoration: none;
}
.sphinxsidebar a:hover {
color: #ddd;
}
.sphinxsidebar {
width: 220px;
margin: -10px 10px 0 10px;
float: right;
color: #888;
}
.sphinxsidebar ul {
list-style-type: none;
margin: 0;
padding: 0;
font-size: 12px;
margin-bottom: 10px;
}
.sphinxsidebar li {
list-style-type: none;
margin: 0;
padding: 0;
}
.sphinxsidebar ul ul {
margin-left: 25px;
}
.sphinxsidebar ul li li {
list-style-type: square;
color: #aa6;
}
.sphinxsidebar a:hover {
color: #fff;
}
.sphinxsidebar a.current {
text-decoration: underline;
color: #eee;
}
.sphinxsidebar input {
font-family: sans-serif;
font-size: 1em;
background: #eceae0 url('search.png') 140px 3px no-repeat;
padding: 3px 5px 3px 10px;
border: none;
border-radius: 15px;
width: 150px;
margin: 10px auto;
-moz-border-radius: 15px;
-webkit-border-radius: 15px;
}
.sphinxsidebar h3 {
border-bottom: 1px solid #666666;
color: #aaaaaa;
font-size: 16px;
text-shadow: 1px 1px 0px #333;
}
.sphinxsidebar h3 a {
color: #cccccc;
}
h1, h2, h3, h4, h5 {
font-family: 'Open Sans', sans-serif;
font-weight: 300;
font-size: 26px;
color: #333;
text-shadow: 1px 1px 0px #ccc;
}
h1 {
font-size: 28px;
background-color: #eeeeee;
border-bottom: 1px solid #cccccc;
padding-bottom: 10px;
margin-left: -20px;
margin-right: -20px;
padding-left: 20px;
margin-top: 0px;
padding-top: 10px;
}
h2 {
border-bottom: 1px solid #cccccc;
}
div.panelstep h2,
div.panelstep div.title {
font-family: 'Open Sans', sans-serif;
font-weight: 300;
font-size: 26px;
color: #333;
text-shadow: 1px 1px 0px #ccc;
border-bottom: none;
font-weight: 300;
margin: 20px 0 10px 0;
}
div.panelstep {
position: absolute;
width: 800px;
}
h3 {
font-size: 24px;
border-bottom: 1px dotted #cccccc;
padding: 0px;
margin: 10px 0px;
}
h4 {
font-size: 24px;
padding: 0px;
margin: 8px 0px;
}
.hl {
font-weight: bold;
font-size: 15px;
}
/* Admonitions */
div.admonition {
margin-top: 10px;
margin-bottom: 10px;
padding: 7px;
}
div.admonition dt {
font-weight: bold;
}
div.admonition dl {
margin-bottom: 0;
}
div.admonition p.admonition-title + p {
display: inline;
}
div.seealso {
background-color: #ffc;
border: 1px solid #ff6;
}
div.warning {
border: 1px solid #fb9d43;
background: #fbddbf url('icon-warning.png') 8px 5px no-repeat;
padding-left: 42px;
}
div.note {
border: 1px solid #dbd286;
background: #f7f0b9 url('icon-note.png') 8px 5px no-repeat;
padding-left: 42px;
}
div.warning .admonition-title,
div.note .admonition-title {
display: none;
}
p.admonition-title {
margin: 0px 10px 5px 0px;
font-weight: bold;
display: inline;
}
p.admonition-title:after {
content: ":";
}
div.body p.centered {
text-align: center;
margin-top: 25px;
}
dl.docutils dt {
font-weight: bold;
}
table.docutils {
border: 0;
}
table.docutils td, table.docutils th {
padding: 1px 8px 1px 0;
border-top: 0;
border-left: 0;
border-right: 0;
border-bottom: 1px solid #aaa;
}
table.field-list td, table.field-list th {
border: 0 !important;
}
table.footnote td, table.footnote th {
border: 0 !important;
}
.field-list ul {
margin: 0;
padding-left: 1em;
}
.field-list p {
margin: 0;
}
dl {
margin-bottom: 15px;
}
dl.class dl {
margin-bottom: 0px;
}
dd p {
margin-top: 0px;
}
dd ul, dd table {
margin-bottom: 10px;
}
dd {
margin-top: 3px;
margin-bottom: 10px;
margin-left: 30px;
}
.refcount {
color: #060;
}
dt:target,
.highlight {
/** background-color: #fbe54e; TEMPORARY REMOVE THIS, CAUSE WITH RIGHT ALIGN IMAGE, WE ARE SEEING THE COLOR **/
background-color: #23cc23;
}
.highlight {
background-color: transparent;
}
dl.glossary dt {
font-weight: bold;
font-size: 1.1em;
}
th {
text-align: left;
padding-right: 5px;
}
pre {
padding: 1em;
font-size: 1em;
overflow: auto;
border: 1px solid #cccccc;
background: rgba(125, 125, 125, 0.1);
padding: 12px 15px;
margin: 20px 0px;
-white-space: nowrap;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
-o-border-radius: 3px;
-ms-border-radius: 3px;
-khtml-border-radius: 3px;
border-radius: 3px;
-moz-box-shadow: #ccc 1px 1px 3px 0 inset;
-webkit-box-shadow: #ccc 1px 1px 3px 0 inset;
-o-box-shadow: #ccc 1px 1px 3px 0 inset;
box-shadow: #ccc 1px 1px 3px 0 inset;
}
td.linenos pre {
padding: 5px 0px;
border: 0;
background-color: transparent;
color: #aaa;
-moz-box-shadow: none;
-webkit-box-shadow: none;
-o-box-shadow: none;
box-shadow: none;
}
table.highlighttable {
margin-left: 0.5em;
}
table.highlighttable td {
padding: 0 0.5em 0 0.5em;
}
tt {
background-color: #ecf0f3;
padding: 0 1px 0 1px;
font-size: 1em;
font-size: inherit;
}
tt.descname {
background-color: transparent;
font-weight: bold;
font-size: 1.2em;
}
tt.descclassname {
background-color: transparent;
}
tt.xref, a tt {
background-color: transparent;
font: inherit;
}
div.body a.reference {
text-decoration: none !important;
font-style: italic;
color: #d97400;
}
div.body a.reference:hover {
color: #af541e;
}
.footnote:target { background-color: #ffa }
h1 tt, h2 tt, h3 tt, h4 tt, h5 tt, h6 tt {
background-color: transparent;
}
.optional {
font-size: 1.3em;
}
.versionmodified {
font-style: italic;
}
form.comment {
margin: 0;
padding: 10px 30px 10px 30px;
background-color: #eee;
}
form.comment h3 {
background-color: #326591;
color: white;
margin: -10px -30px 10px -30px;
padding: 5px;
font-size: 1.4em;
}
form.comment input,
form.comment textarea {
border: 1px solid #ccc;
padding: 2px;
font-family: sans-serif;
font-size: 100%;
}
form.comment input[type="text"] {
width: 240px;
}
form.comment textarea {
width: 100%;
height: 200px;
margin-bottom: 10px;
}
.system-message {
background-color: #fda;
padding: 5px;
border: 3px solid red;
}
img.math {
vertical-align: middle;
}
div.math p {
text-align: center;
}
span.eqno {
float: right;
}
img.logo {
border: 0;
}
/** Kivy
*/
a.headerlink {
color: #c60f0f;
font-size: 0.8em;
padding: 0 4px 0 4px;
text-decoration: none;
visibility: hidden;
}
h1:hover > a.headerlink,
h2:hover > a.headerlink,
h3:hover > a.headerlink,
h4:hover > a.headerlink,
h5:hover > a.headerlink,
h6:hover > a.headerlink,
dt:hover > a.headerlink {
visibility: visible;
}
a.headerlink {
color: #DDDDDD;
padding: 0 4px;
text-decoration: none;
}
a.headerlink:hover {
background: none repeat scroll 0 0 #EAEAEA;
color: #444444;
}
/** Method/class/... styling
*/
dl.data dt,
dl.attribute dt,
dl.exception dt,
dl.function dt,
dl.method dt,
dl.class dt {
background: #e5e5e5 url('element-method-16.png') 8px 13px no-repeat;
padding: 5px 5px 5px 30px;
line-height: 28px;
}
dl.class dl.method dt {
background-image: url('element-method-16.png');
}
dl.class dt {
background-image: url('element-class-16.png')
}
dl.attribute dt {
background-image: url('element-field-16.png')
}
dl dd {
margin: 0;
padding: 15px 0px 10px 25px;
}
dl dl dt {
margin: 0 -10px 0 -10px;
}
dl.function,
dl.data,
dl.class {
border: 1px solid #cccccc;
margin-top: 20px;
}
dl.function > dd,
dl.data > dd,
dl.class > dd {
border-top: 1px solid #cccccc;
margin: 0px;
padding: 10px;
}
/** field list
*/
table.field-list {
width: 100%;
border-collapse: collapse;
}
table.field-list th.field-name {
background-color: #eeeeee;
}
/** Footer links
*/
.footerlinks {
margin: 10px -20px 0px -20px;
padding: 10px;
background-color: #eeeeee;
border-top: 1px solid #cccccc;
border-bottom: 1px solid #cccccc;
}
.footerlinks table {
width: 100%;
}
.footerlinks .rightlink {
text-align: right;
}
/** Image link
*/
div.body .align-left {
float: left;
margin: 0 20px 20px 20px;
}
div.body .align-right {
float: right;
margin: 0 0 20px 20px;
}
div.body .align-center {
text-align: center;
margin: 20px auto;
display: block;
}
/** Api enhance navigation
*/
.bodyshortcut {
font-size: 10px;
margin: -10px -20px 20px -20px;
padding: 0 20px 8px 20px;
border-bottom: 1px solid #cccccc;
}
.right {
float: right;
}
.left {
float: left;
}
dl.class > dt.hover,
dl.data > dt.hover,
dl.function > dt.hover,
dl.method > dt.hover,
dl.attribute > dt.hover,
dl.exception > dt.hover {
background-color: #f0f0f0 !important;
}
#api-toggle-desc,
#api-toggle-all {
font-size: 13px;
float: right;
margin-top: 10px;
margin-left: 20px;
cursor: pointer;
}
dl.api-level dt {
cursor: pointer;
}
/* Getting started
*/
.gs-osimage {
margin-top: 10px;
width: 264px !important;
height: 168px;
float: left;
}
.gs-osimage canvas {
width: 128px !important;
margin: 0 auto;
}
.gs-osimage img {
margin: 0 auto;
}
.gs-osimage-last {
clear: right;
}
.gs-eleft {
float: left;
margin-right: 22px;
}
/** Fix list within dt
*/
table.field-list dt {
margin: 0px;
background-color: #eeeeee;
}
table.field-list dl {
margin-top: 0px;
}
table.field-list td.field-body {
padding-top: 0px;
}
table.field-list th.field-name {
min-width: 100px;
}

View File

@ -20,7 +20,7 @@ a, a:link, a:visited {
a.headerlink {
display: none;
}
h1:hover a.headerlink,
h2:hover a.headerlink,
h3:hover a.headerlink,
@ -71,24 +71,54 @@ a:hover {
#topmenu ul.navigation li a {
float: left;
margin-left: 30px;
line-height: 55px;
line-height: 44px;
list-style-type: none;
color: #bbb;
margin-top: 30px;
margin-top: 35px;
text-decoration: none;
background-color: #303030;
padding: 0 20px;
}
#topmenu ul.navigation li a.current {
border-bottom: 2px solid #e0e0e0;
border-bottom: 2px solid #ffffff;
}
#topmenu ul.navigation li a:hover {
background-color: #383a3d;
border-bottom: 2px solid #e0e0e0;
border-bottom: 2px solid #202326;
}
#topmenu ul.navigation .nav-guides {
background-color: #669900;
color: #ffffff;
}
#topmenu ul.navigation .nav-api {
background-color: #0099cc;
color: #ffffff;
}
#topmenu ul.navigation .nav-pdf {
background-color: #ff8800;
color: #ffffff;
}
#topmenu ul.navigation a.nav-guides:hover {
background-color: #99cc00;
}
#topmenu ul.navigation a.nav-api:hover {
background-color: #33b5e5;
}
#topmenu ul.navigation a.nav-pdf:hover {
background-color: #ffbb33;
}
div.sphinxsidebar {
width: 230px;
float: left;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.1 KiB

View File

@ -134,22 +134,27 @@ $(document).ready(function () {
$('div.sphinxsidebarwrapper > ul > li > a').each(function(index, item) {
$(item)
.attr('href', '#')
.addClass('mainlevel')
.bind('mousedown', function() {
$('div.sphinxsidebar ul li ul').filter(function (index, child) {
if (child != $(item).parent().children('ul').get(0)) return child;
}).slideUp();
$(item).parent().children('ul').slideToggle();
});
.addClass('mainlevel');
if ( !is_api ) {
$(item)
.bind('mousedown', function() {
$('div.sphinxsidebar ul li ul').filter(function (index, child) {
if (child != $(item).parent().children('ul').get(0)) return child;
}).slideUp();
$(item).parent().children('ul').slideToggle();
});
}
})
$('div.sphinxsidebarwrapper li.current').parent().show();
$('div.sphinxsidebarwrapper ul li').each(function(index, item) {
if ($(item).children('ul').length > 0) {
$(item).children('a').addClass('togglable');
}
});
if ( !is_api ) {
$('div.sphinxsidebarwrapper ul li').each(function(index, item) {
if ($(item).children('ul').length > 0) {
$(item).children('a').addClass('togglable');
}
});
}
// FIXME
$('div.sphinxsidebar a[href$="api-kivy.html"]').parent().parent().addClass('api-index');
@ -165,7 +170,7 @@ $(document).ready(function () {
url = url.substr(url.search('api-') + 4);
$(item).empty().append(url);
});
// Hide API section if we are not in the API.
// or hide all the others sections if we are in the API
if ( is_api ) {
@ -187,50 +192,43 @@ $(document).ready(function () {
if ( is_api ) {
var divscroll = $('div.sphinxsidebarwrapper');
var divscrollwidth = divscroll.width();
var divapi = $('.api-index');
var initial_offset = divscroll.offset();
var jwindow = $(window);
function update_api() {
var ywindow = jwindow.scrollTop();
var ymintop = initial_offset.top;
var ytop = ymintop;
var ypadding = 10;
var overscroll = $(window).height() + $(window).scrollTop() - $(document).height();
var yoff = ywindow;
if ( ywindow > ymintop - ypadding)
ytop = ywindow + ypadding;
if ( overscroll > 0 )
ytop -= overscroll;
if ( ywindow > initial_offset.top )
yoff = initial_offset.top;
divscroll.offset({top: ytop, left: initial_offset.left});
var h = jwindow.height() - divapi.position().top - 130 + yoff;
divapi.height(h);
var ydiff = ywindow - initial_offset.top + ypadding;
var height = jwindow.height();
if ( ydiff + ypadding > 0) {
divscroll.css('position', 'fixed').css('top', ypadding);
height -= ypadding * 2;
} else {
divscroll.css('position', 'fixed').css('top', -ydiff);
height += ydiff - ypadding;
}
divscroll.height(height).width(divscrollwidth);
divapi.height(divapi.offsetParent().height() - divapi.position().top)
}
$(window).scroll(update_api).bind('resize', update_api);
update_api();
$('.api-index').scrollTop($('.api-index').scrollTop() + $('li.toctree-l2.current').position().top - 143)
$('.toc').hide();
} else {
var divscroll = $('div.sphinxsidebar');
var initial_offset = divscroll.offset();
var jwindow = $(window);
var b = divscroll.position().top + divscroll.height();
var b = divscroll.position().top + divscroll.height();
function update_sidebar() {
var ywindow = jwindow.scrollTop();
var ymintop = initial_offset.top;
var a = ywindow + jwindow.height();
console.log(a, b);
if ( ywindow > b ) {
var current = $('li.toctree-l1.current').position().top;
divscroll.css('position', 'fixed').css('top', -current);
@ -244,6 +242,9 @@ $(document).ready(function () {
if ($('.toc > ul > li> ul').length < 1)
$('.toc').hide();
var section_title = $('li.toctree-l1.current > a').text();
$('div.body h1:eq(0)').prepend(section_title + ' &raquo; ');
}
});

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

File diff suppressed because one or more lines are too long

View File

@ -1,11 +0,0 @@
/*!
reflection.js for jQuery v1.1
(c) 2006-2011 Christophe Beyls <http://www.digitalia.be>
MIT-style license.
*/
(function(a){a.fn.extend({reflect:function(b){b=a.extend({height:1/3,opacity:0.5},b);return this.unreflect().each(function(){var c=this;if(/^img$/i.test(c.tagName)){function d(){var g=c.width,f=c.height,l,i,m,h,k;i=Math.floor((b.height>1)?Math.min(f,b.height):f*b.height);l=a("<canvas />")[0];if(l.getContext){h=l.getContext("2d");try{a(l).attr({width:g,height:i});h.save();h.translate(0,f-1);h.scale(1,-1);h.drawImage(c,0,0,g,f);h.restore();h.globalCompositeOperation="destination-out";k=h.createLinearGradient(0,0,0,i);k.addColorStop(0,"rgba(255, 255, 255, "+(1-b.opacity)+")");k.addColorStop(1,"rgba(255, 255, 255, 1.0)");h.fillStyle=k;h.rect(0,0,g,i);h.fill()}catch(j){return}}else{if(!a.browser.msie){return}l=a("<img />").attr("src",c.src).css({width:g,height:f,marginBottom:i-f,filter:"FlipV progid:DXImageTransform.Microsoft.Alpha(Opacity="+(b.opacity*100)+", FinishOpacity=0, Style=1, StartX=0, StartY=0, FinishX=0, FinishY="+(i/f*100)+")"})[0]}a(l).css({display:"block",border:0});m=a(/^a$/i.test(c.parentNode.tagName)?"<span />":"<div />").insertAfter(c).append([c,l])[0];m.className=c.className;a.data(c,"reflected",m.style.cssText=c.style.cssText);a(m).css({width:g,height:f+i,overflow:"hidden"});c.style.cssText="display: block; border: 0px";c.className="reflected"}if(c.complete){d()}else{a(c).load(d)}}})},unreflect:function(){return this.unbind("load").each(function(){var c=this,b=a.data(this,"reflected"),d;if(b!==undefined){d=c.parentNode;c.className=d.className;c.style.cssText=b;a.removeData(c,"reflected");d.parentNode.replaceChild(c,d)}})}})})(jQuery);
// AUTOLOAD CODE BLOCK (MAY BE CHANGED OR REMOVED)
jQuery(function($) {
$("img.reflect").reflect({/* Put custom options here */});
});

Binary file not shown.

Before

Width:  |  Height:  |  Size: 646 B

View File

@ -157,7 +157,7 @@
</div>
<div id="topmenu">
<ul class="navigation">
<li><a class="nav-guides" href="{{ pathto('index') }}">Guides</a></li>
<li><a class="nav-guides" href="{{ pathto('gettingstarted/intro') }}">Guides</a></li>
<li><a class="nav-api" href="{{ pathto('api-kivy') }}">API Reference</a></li>
<li><a class="nav-pdf" href="http://kivy.org/docs/pdf/Kivy-latest.pdf">PDF</a></li>
</ul>