Update docs style to look more like the main docs site

This commit is contained in:
Henrik Hodne 2013-04-15 02:02:08 -05:00
parent e0e3603d25
commit e38b40e00a
3 changed files with 678 additions and 126 deletions

View File

@ -5,7 +5,7 @@ class Travis::Api::App
# Artifacts are generated by builds. Currently we only expose logs as
# artifacts
#
# DEPRECATED will be removed as soon as the client uses /logs/:id
# **DEPRECATED** will be removed as soon as the client uses /logs/:id
class Artifacts < Endpoint
# Fetches an artifact by it's *id*.
get '/:id' do |id|

View File

@ -81,151 +81,113 @@ __END__
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta charset="utf-8">
<title>Travis API documentation</title>
<!-- we might wanna change this -->
<link href="<%= url('/css/bootstrap.css') %>" rel="stylesheet" />
<link href="<%= url('/css/prettify.css') %>" rel="stylesheet" />
<script src="<%= url('/js/jquery.js') %>"></script>
<script src="<%= url('/js/prettify.js') %>"></script>
<script src="<%= url('/js/bootstrap.min.js') %>"></script>
<style type="text/css">
header {
position: relative;
text-align: center;
margin-top: 36px;
}
header h1 {
text-shadow: 2px 2px 5px #000;
margin-bottom: 9px;
font-size: 81px;
font-weight: bold;
letter-spacing: -1px;
line-height: 1;
}
header p {
margin-bottom: 18px;
font-weight: 300;
font-size: 18px;
}
.page-header {
margin-top: 90px;
}
.route {
margin-bottom: 36px;
}
.page-header a {
color: black;
}
.nav-list a {
color: inherit !important;
}
</style>
<!-- <link href="<%= url('/css/bootstrap.css') %>" rel="stylesheet" /> -->
<!-- <link href="<%= url('/css/prettify.css') %>" rel="stylesheet" /> -->
<link href="<%= url('/css/style.css') %>" rel="stylesheet" />
<!-- <script src="<%= url('/js/jquery.js') %>"></script> -->
<!-- <script src="<%= url('/js/prettify.js') %>"></script> -->
<!-- <script src="<%= url('/js/bootstrap.min.js') %>"></script> -->
</head>
<body onload="prettyPrint()">
<a href="https://github.com/travis-ci/travis-api">
<img style="position: absolute; top: 0; right: 0; border: 0;"
src="https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png"
alt="Fork me on GitHub">
</a>
<div class="container">
<div class="row">
<header class="span12">
<h1>The Travis API</h1>
<p>All the routes, just waiting for you to build something awesome.</p>
</header>
<div id="navigation">
<div class="wrapper">
<a href="http://travis-ci.org" id="logo">travis-ci<span>.org</span></a>
<ul>
<li><a href="http://about.travis-ci.org/blog/">Blog</a></li>
<li><a href="http://about.travis-ci.org/docs/">User Documentation</a></li>
</ul>
</div>
</div>
<div class="row">
<div id="header">
<div class="wrapper">
<h1 class="riddle"><a href="/docs" title="Travis API">The Travis API</a></h1>
<p>All the routes, just waiting for you to build something awesome.</p>
</div>
</div>
<aside class="span3">
<div class="page-header">
<h1>Navigation</h1>
<div id="content">
<div class="wrapper">
<div class="pad">
<div id="main">
<% general_docs.each do |doc| %>
<%= erb :entry, locals: doc %>
<% end %>
<% endpoints.each do |endpoint| %>
<%= erb :entry, {},
id: endpoint['name'],
title: endpoint['name'],
content: erb(:endpoint_content, {}, endpoint: endpoint) %>
<% end %>
</div>
<div class="well" style="padding: 8px 0;">
<ul class="nav nav-list">
<% general_docs.each do |doc| %>
<li class="nav-header"><a href="#<%= doc[:id] %>"><%= doc[:title] %></a></li>
<% doc[:subheaders].each do |sub| %>
<li><a href="#<%= sub %>"><%= sub %></a></li>
<% end %>
<div id="sidebar">
<% general_docs.each do |doc| %>
<h2><a href="#<%= doc[:id] %>"><%= doc[:title] %></a></h2>
<ul>
<% doc[:subheaders].each do |sub| %>
<li><a href="#<%= sub %>"><%= sub %></a></li>
<% end %>
<li class="divider"></li>
<% endpoints.each do |endpoint| %>
<li class="nav-header"><a href="#<%= endpoint['name'] %>"><%= endpoint['name'] %></a></li>
<% endpoint['routes'].each do |route| %>
<li>
<a href="#<%= slug_for(route) %>">
<i class="icon-<%= icon_for route['verb'] %>"></i>
<tt><%= route['uri'] %></tt>
</a>
</li>
<% end %>
</ul>
<% end %>
<% endpoints.each do |endpoint| %>
<h2><a href="#<%= endpoint['name'] %>"><%= endpoint['name'] %></a></h2>
<ul>
<% endpoint['routes'].each do |route| %>
<li>
<a href="#<%= slug_for(route) %>">
<i class="icon-<%= icon_for route['verb'] %>"></i>
<tt><%= route['uri'] %></tt>
</a>
</li>
<% end %>
<li class="divider"></li>
<li class="nav-header">
External Links
</li>
<li>
<a href="https://travis-ci.org">
<i class="icon-globe"></i>
Travis CI
</a>
</li>
<li>
<a href="https://github.com/travis-ci/travis-api">
<i class="icon-cog"></i>
Source Code
</a>
</li>
<li>
<a href="https://github.com/travis-ci/travis-api/issues">
<i class="icon-list-alt"></i>
API issues
</a>
</li>
<li>
<a href="https://github.com/travis-ci/travis-web">
<i class="icon-play-circle"></i>
Example Client
</a>
</li>
</ul>
<% end %>
<h2>External Links</h2>
<ul>
<li><a href="https://travis-ci.org">Travis CI</a></li>
<li><a href="https://github.com/travis-ci/travis-api">Source Code</a></li>
<li><a href="https://github.com/travis-ci/travis-api/issues">API issues</a></li>
<li><a href="https://github.com/travis-ci/travis-web">Example Client</a></li>
</ul>
</div>
</aside>
<section class="span9">
<% general_docs.each do |doc| %>
<%= erb :entry, locals: doc %>
<% end %>
<% endpoints.each do |endpoint| %>
<%= erb :entry, {},
id: endpoint['name'],
title: endpoint['name'],
content: erb(:endpoint_content, {}, endpoint: endpoint) %>
<% end %>
</section>
</div>
</div>
</div>
<div id="footer">
<div class="wrapper">
<div class="box">
<p>This site is maintained by the <a href="http://github.com/travis-ci">Travis CI community</a>. Feel free to <a href="http://github.com/travis-ci/travis-api">contribute</a>!</p>
</div>
<div class="box">
<p>This design was kindly provided by the talented Ben Webster of <a href="http://www.plus2.com.au">Plus2</a>.</p>
</div>
<div class="box last">
<ul>
<li><a href="https://github.com/travis-ci" title="">Travis CI on GitHub</a></li>
<li><a href="https://twitter.com/travisci" title="">Travis CI on Twitter</a></li>
</ul>
</div>
</div>
</div>
</body>
</html>
@@ endpoint_content
<% unless endpoint['doc'].to_s.empty? %>
<%= docs_for endpoint %>
<hr>
<% end %>
<% endpoint['routes'].each do |route| %>
<div class="route" id="<%= slug_for(route) %>">
<pre><h3><%= route['verb'] %> <%= route['uri'] %></h3></pre>
<h3><%= route['verb'] %> <%= route['uri'] %></h3>
<% if route['scope'] %>
<p>
<h5>Required autorization scope: <span class="label"><%= route['scope'] %></span></h5>
@ -237,11 +199,7 @@ __END__
@@ entry
<div id="<%= id %>">
<div class="page-header">
<h1>
<a href="#<%= id %>"><%= title %></a>
</h1>
</div>
<h2><%= title %> <a class="toc-anchor" href="#<%= id %>">#</a></h2>
<%= content %>
</div>

View File

@ -0,0 +1,594 @@
/* ---( = begin global reset thanks to eric meyer elements )------------------------------- */
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, font, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td {
margin: 0;
padding: 0;
border: 0;
outline: 0;
font-weight: inherit;
font-style: inherit;
font-size: 100%;
font-family: inherit;
vertical-align: baseline;
}
/* remember to define focus styles! */
:focus {
outline: 0;
}
body {
line-height: 1;
color: black;
background: white;
}
ol, ul {
list-style: none;
}
/* tables still need 'cellspacing="0"' in the markup */
table {
border-collapse: separate;
border-spacing: 0;
}
caption, th, td {
text-align: left;
font-weight: normal;
}
blockquote:before, blockquote:after, q:before, q:after {
content: "";
}
blockquote, q {
quotes: "" "";
}
/* travis-ci styles */
body {
margin: 0 0 1em 0;
font-size: 14px;
line-height: 1.4286;
color: #555;
background: #fff;
font-family: "Helvetica Neue", Arial, Verdana, sans-serif;
}
a {
color: #3366cc;
outline: none;
text-decoration: underline;
}
a:visited {
color: #666;
}
a:hover {
color: #66cc33;
text-decoration: none;
}
p, ul, blockquote, pre, td, th, label {
margin: 1.4286em 0;
font-size: 1em;
line-height: 1.4286;
}
blockquote {
font-style: italic;
margin-left: 1em;
}
blockquote small.author {
font-style: normal;
margin-top: 10px;
text-align: right;
}
blockquote small.author:after {
content: ":";
}
p small.author {
margin: 0;
}
ul, ol {
margin: 1.4286em 0;
text-align: left;
}
li {
line-height: 1.4286;
}
table {
border-collapse: collapse;
margin-bottom: 1.5em;
}
strong {
font-family: Helvetica, Arial;
color: #8e7a2b;
font-weight: bold;
}
em {
font-style: italic;
}
span.help {
font-style: italic;
background-color: #ffff99;
font-family: Georgia, Times, Serif;
}
pre {
margin-top: 1em;
padding: 1em 1.5em;
line-height: 1.5em;
border: 1px solid #ddd;
background: #fafafa;
border-bottom-left-radius: 8px 8px;
border-bottom-right-radius: 8px 8px;
border-top-left-radius: 8px 8px;
border-top-right-radius: 8px 8px;
font-family: monospace;
font-size: 13px;
overflow-x: scroll;
}
p > code, div > code, li > code {
background-color: #fafafa;
border: 1px solid #e0e0e0;
color: #333;
padding: 0px 0.2em;
font-family: monospace;
font-size: 13.3px;
}
.wrapper {
width: 960px;
margin: 0 auto;
text-align: left;
overflow: hidden;
position: relative;
}
div#navigation {
clear: both;
margin: 0 0 0 0;
padding: .8em 0 .6em 0;
overflow: hidden;
background: #efefef;
color: #888;
border-bottom: 1px solid #ccc;
}
div#header {
clear: both;
margin: 1em auto 0 auto;
padding-top: 10px;
text-align: center;
overflow: hidden;
}
div#navigation .wrapper {
width: 940px;
}
div#navigation .wrapper a#logo {
color: #828282;
display:block;
float: left;
font-weight: bold;
font-size: 1.1em;
line-height: 1.2em;
margin: 0.15em 1em 0 0;
padding: 0 1em 0 0;
text-decoration: none;
}
div#navigation .wrapper a#logo span {
color: #bbbaba;
font-size: .85em;
}
div#navigation ul {
margin:0;
padding:0;
}
div#navigation ul li {
margin: 0;
padding: 0;
float: left;
border-left: 1px solid #ccc;
}
div#navigation ul li.right {
float: right;
border-left: none;
font-size: .83em;
}
div#navigation ul li a,
div#navigation ul li a:visited {
color: #999;
display:block;
padding: 0em 1em 0 1em ;
text-decoration:none;
}
div#navigation ul li a:hover,
div#navigation ul li a:visited {
text-decoration:underline;
}
div#navigation ul li.selected a,
div#navigation ul li.selected a:visited {
text-decoration: none;
color: #6c3;
}
div#navigation ul li.active a,
div#navigation ul li.selected a:visited {
text-decoration: none;
color: #444;
}
div#content {
clear: both;
margin: 0 auto 3em auto;
padding: 0 0 0;
text-align:center;
overflow: hidden;
}
div#content div.pad {
margin-left: 20px;
margin-right: 20px;
}
div#main {
float:left;
width: 580px;
overflow: hidden;
padding-top: 2em;
}
#main ul,
#main ul li {
list-style-type: disc;
}
#main ol,
#main ol li {
list-style-type: decimal;
}
#main li {
margin-left: 1.4286em;
}
.clear {
clear: both;
}
#main figure {
clear: both !important;
width: 578px;
border: 1px solid #efefef;
text-align: center;
margin: 0px;
border-radius: 4px;
}
#main figure figcaption {
background-color: #efefef;
text-align: left;
font-size: 80%;
padding: 5px 10px;
}
#main figure img {
max-width: 570px;
margin: 4px;
}
#main figure.left {
margin-bottom: 1.4286em;
margin-right: 1.4286em;
float: left;
}
#main figure.right {
margin-bottom: 1.4286em;
margin-left: 1.4286em;
float: right;
}
#main figure.smallest {
width: 138px;
}
#main figure.smallest img {
width: 130px;
}
#main figure.smaller {
width: 208px;
}
#main figure.smaller img {
width: 200px;
}
#main figure.small {
width: 258px;
}
#main figure.small img {
max-width: 250px;
}
div#sidebar {
float:right;
width: 325px;
overflow: hidden;
padding-top: 0;
}
#sidebar ul {
margin:0 0 1.5em 0;
padding:0;
}
#sidebar p {
margin: 0;
padding: 0;
}
#sidebar p,
#sidebar ul li p,
#sidebar ul li a,
#sidebar ul li a:visited {
display:block;
text-decoration:none;
padding:4px 0 3px 20px;
border-top: 1px solid #efefef;
}
#sidebar ul li a:hover,
#sidebar ul li a:visited:hover {
text-decoration:underline;
}
#sidebar ul li.selected a,
#sidebar ul li.selected a:visited {
color: #6c3;
background: #efefef;
margin-left: 0;
padding-left: 20px;
}
#sidebar ul li ul {
border-bottom: 0;
list-style-type: disc;
margin-bottom: 0.5em;
}
#sidebar ul li ul li {
border-bottom: 0;
list-style-type: disc;
margin-left: 1.5em;
}
#sidebar ul li ul li a,
#sidebar ul li ul li a:visited,
#sidebar ul li.selected ul li a,
#sidebar ul li.selected ul li a:visited {
display:block;
text-decoration:none;
padding:0;
border-top: 0;
font-weight: normal;
color: #195190;
}
#sidebar ul li ul li.selected a,
#sidebar ul li ul li.selected a:visited {
color: #444;
font-weight: normal;
}
div#footer {
clear: both;
margin: 0 auto;
padding-top: 10px;
text-align: center;
overflow: hidden;
background: #efefef;
border-top: 1px solid #ddd;
border-bottom: 1px solid #ddd
}
div#footer .wrapper {
background: transparent;
width: 920px;
}
div#footer div.box {
float: left;
width: 280px;
margin-right: 30px;
color: #888;
}
div#footer div.last {
margin-right: 0;
margin-left: 15px;
}
div#footer div.box ul li a,
div#footer div.box ul li a:visited {
color: #7d8997;
}
h1, h2, h3, h4, h5, h6 {
margin: 0;
padding: 0;
font-weight: bold;
color: #40454F;
}
h1 {
font-size: 3em;
line-height: 1em;
margin-bottom: 0.5em;
clear: both;
}
h2 {
font-size: 1.6em;
margin-bottom: 1em;
line-height: 1em;
letter-spacing: -0.5px;
clear: both;
}
.meta {
margin-top: -1.7em;
font-size: 80%;
}
h3 {
font-size: 1.15em;
line-height: 1em;
margin-bottom: 0.5em;
}
h4 {
font-size: 0.95em;
line-height: 1.25;
margin-bottom: 1.25em;
height: 1.25em;
}
h1 img, h2 img, h3 img, h4 img, h5 img, h6 img {
margin: 0;
}
h1 a,
h1 a:visited,
h2 a,
h2 a:visited,
h3 a,
h3 a:visited,
h4 a,
h4 a:visited,
h5 a,
h5 a:visited {
color: #464755;
}
div#header h1 {
float: left;
width: 350px;
text-indent: -20000em;
background: transparent;
font-size:1px;
margin: 20px 0 0 20px;
}
div#header h1 a,
div#header h1 a:visited,
div#header h1 a:hover,
div#header h1 a:visited:hover {
display: block;
width: 350px;
height: 75px;
}
div#header h1.riddle {
float: none;
width: 100%;
text-indent: 0;
background: #fff;
color: #000;
font-size:4em;
margin: 20px 0 0 0;
padding:0;
}
div#header h1.riddle a,
div#header h1.riddle a:visited,
div#header h1.riddle a:hover,
div#header h1.riddle a:visited:hover {
display: block;
width: 100%;
height: auto;
color: #000;
text-decoration: none;
}
div#header p {
color: #777;
display: block;
font: italic 1.25em Georgia, Times, Serif;
line-height: 1.67em;
margin: 0.935em 0 1.87em 0;
padding: 0 0 1.25em 0;
border-bottom: 1px solid #ccc;
}
div#sidebar h2 {
font-size: .9em;
letter-spacing: .5px;
text-transform:uppercase;
margin: 40px 20px 5px 20px;
}
.highlight pre {
font-family: 'Bitstream Vera Sans Mono', 'Courier', monospace;
padding: 0 1.5em;
}
.highlight br {
display: none;
}
.highlight {
background-color: #f8f8f8;
border: 1px solid silver;
font-family: 'Courier New', 'Terminal', monospace;
color: #100;
margin: 1.5em 0;
}
div#content div.pad {
margin-left: 0;
margin-right: 0;
}
div#navigation ul li.lang {
float: right;
border-left: none;
font-size: .83em;
}
#dsq-global-toolbar ul li {
list-style-type: none;
}