commit 7200ec0962aa67929ad5774dabd798997e3fc303 Author: Robert Lord Date: Thu Jan 28 11:07:20 2016 -0600 publish: Add version notes generated from commit d4bd994f035922fb9af36b51ddd447e87714db1c diff --git a/fonts/slate.eot b/fonts/slate.eot new file mode 100755 index 0000000..13c4839 Binary files /dev/null and b/fonts/slate.eot differ diff --git a/fonts/slate.svg b/fonts/slate.svg new file mode 100644 index 0000000..5f34982 --- /dev/null +++ b/fonts/slate.svg @@ -0,0 +1,14 @@ + + + +Generated by IcoMoon + + + + + + + + + + diff --git a/fonts/slate.ttf b/fonts/slate.ttf new file mode 100755 index 0000000..ace9a46 Binary files /dev/null and b/fonts/slate.ttf differ diff --git a/fonts/slate.woff b/fonts/slate.woff new file mode 100755 index 0000000..1e72e0e Binary files /dev/null and b/fonts/slate.woff differ diff --git a/fonts/slate.woff2 b/fonts/slate.woff2 new file mode 100755 index 0000000..7c585a7 Binary files /dev/null and b/fonts/slate.woff2 differ diff --git a/images/logo.png b/images/logo.png new file mode 100644 index 0000000..68a478f Binary files /dev/null and b/images/logo.png differ diff --git a/images/navbar.png b/images/navbar.png new file mode 100644 index 0000000..df38e90 Binary files /dev/null and b/images/navbar.png differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..77f05f1 --- /dev/null +++ b/index.html @@ -0,0 +1,348 @@ + + + + + + + API Reference + + + + + + + + + + + NAV + + + +
+ +
+ shell + ruby + python +
+ + +
+
+ +
+
+
+
+

Introduction

+ +

Welcome to the Kittn API! You can use our API to access Kittn API endpoints, which can get information on various cats, kittens, and breeds in our database.

+ +

We have language bindings in Shell, Ruby, and Python! You can view code examples in the dark area to the right, and you can switch the programming language of the examples with the tabs in the top right.

+ +

This example API documentation page was created with Slate. Feel free to edit it and use it as a base for your own API’s documentation.

+ +

Authentication

+ +
+

To authorize, use this code:

+
+
require 'kittn'
+
+api = Kittn::APIClient.authorize!('meowmeowmeow')
+
+
import kittn
+
+api = kittn.authorize('meowmeowmeow')
+
+
# With shell, you can just pass the correct header with each request
+curl "api_endpoint_here"
+  -H "Authorization: meowmeowmeow"
+
+ +
+

Make sure to replace meowmeowmeow with your API key.

+
+ +

Kittn uses API keys to allow access to the API. You can register a new Kittn API key at our developer portal.

+ +

Kittn expects for the API key to be included in all API requests to the server in a header that looks like the following:

+ +

Authorization: meowmeowmeow

+ + + +

Kittens

+ +

Get All Kittens

+
require 'kittn'
+
+api = Kittn::APIClient.authorize!('meowmeowmeow')
+api.kittens.get
+
+
import kittn
+
+api = kittn.authorize('meowmeowmeow')
+api.kittens.get()
+
+
curl "http://example.com/api/kittens"
+  -H "Authorization: meowmeowmeow"
+
+ +
+

The above command returns JSON structured like this:

+
+
[
+  {
+    "id": 1,
+    "name": "Fluffums",
+    "breed": "calico",
+    "fluffiness": 6,
+    "cuteness": 7
+  },
+  {
+    "id": 2,
+    "name": "Max",
+    "breed": "unknown",
+    "fluffiness": 5,
+    "cuteness": 10
+  }
+]
+
+ +

This endpoint retrieves all kittens.

+ +

HTTP Request

+ +

GET http://example.com/api/kittens

+ +

Query Parameters

+ + + + + + + + + + + + + + + + + + +
ParameterDefaultDescription
include_catsfalseIf set to true, the result will also include cats.
availabletrueIf set to false, the result will include kittens that have already been adopted.
+ + + +

Get a Specific Kitten

+
require 'kittn'
+
+api = Kittn::APIClient.authorize!('meowmeowmeow')
+api.kittens.get(2)
+
+
import kittn
+
+api = kittn.authorize('meowmeowmeow')
+api.kittens.get(2)
+
+
curl "http://example.com/api/kittens/2"
+  -H "Authorization: meowmeowmeow"
+
+ +
+

The above command returns JSON structured like this:

+
+
{
+  "id": 2,
+  "name": "Max",
+  "breed": "unknown",
+  "fluffiness": 5,
+  "cuteness": 10
+}
+
+ +

This endpoint retrieves a specific kitten.

+ + + +

HTTP Request

+ +

GET http://example.com/kittens/<ID>

+ +

URL Parameters

+ + + + + + + + + + + +
ParameterDescription
IDThe ID of the kitten to retrieve
+ +

Errors

+ + + +

The Kittn API uses the following error codes:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Error CodeMeaning
400Bad Request – Your request sucks
401Unauthorized – Your API key is wrong
403Forbidden – The kitten requested is hidden for administrators only
404Not Found – The specified kitten could not be found
405Method Not Allowed – You tried to access a kitten with an invalid method
406Not Acceptable – You requested a format that isn’t json
410Gone – The kitten requested has been removed from our servers
418I’m a teapot
429Too Many Requests – You’re requesting too many kittens! Slow down!
500Internal Server Error – We had a problem with our server. Try again later.
503Service Unavailable – We’re temporarially offline for maintanance. Please try again later.
+ +
+
+
+ shell + ruby + python +
+
+
+ + diff --git a/javascripts/all.js b/javascripts/all.js new file mode 100644 index 0000000..fa3210b --- /dev/null +++ b/javascripts/all.js @@ -0,0 +1,168 @@ +!function(){if("ontouchstart"in window){var e,t,n,i,r,o,s={};e=function(e,t){return Math.abs(e[0]-t[0])>5||Math.abs(e[1]-t[1])>5},t=function(e){this.startXY=[e.touches[0].clientX,e.touches[0].clientY],this.threshold=!1},n=function(t){return this.threshold?!1:void(this.threshold=e(this.startXY,[t.touches[0].clientX,t.touches[0].clientY]))},i=function(t){if(!this.threshold&&!e(this.startXY,[t.changedTouches[0].clientX,t.changedTouches[0].clientY])){var n=t.changedTouches[0],i=document.createEvent("MouseEvents");i.initMouseEvent("click",!0,!0,window,0,n.screenX,n.screenY,n.clientX,n.clientY,!1,!1,!1,!1,0,null),i.simulated=!0,t.target.dispatchEvent(i)}},r=function(e){var t=Date.now(),n=t-s.time,i=e.clientX,r=e.clientY,a=[Math.abs(s.x-i),Math.abs(s.y-r)],u=o(e.target,"A")||e.target,l=u.nodeName,c="A"===l,f=window.navigator.standalone&&c&&e.target.getAttribute("href");return s.time=t,s.x=i,s.y=r,(!e.simulated&&(500>n||1500>n&&a[0]<50&&a[1]<50)||f)&&(e.preventDefault(),e.stopPropagation(),!f)?!1:(f&&(window.location=u.getAttribute("href")),void(u&&u.classList&&(u.classList.add("energize-focus"),window.setTimeout(function(){u.classList.remove("energize-focus")},150))))},o=function(e,t){for(var n=e;n!==document.body;){if(!n||n.nodeName===t)return n;n=n.parentNode}return null},document.addEventListener("touchstart",t,!1),document.addEventListener("touchmove",n,!1),document.addEventListener("touchend",i,!1),document.addEventListener("click",r,!0)}}(),/*! + * jQuery JavaScript Library v2.2.0 + * http://jquery.com/ + * + * Includes Sizzle.js + * http://sizzlejs.com/ + * + * Copyright jQuery Foundation and other contributors + * Released under the MIT license + * http://jquery.org/license + * + * Date: 2016-01-08T20:02Z + */ +function(e,t){"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(e,t){function n(e){var t=!!e&&"length"in e&&e.length,n=oe.type(e);return"function"===n||oe.isWindow(e)?!1:"array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e}function i(e,t,n){if(oe.isFunction(t))return oe.grep(e,function(e,i){return!!t.call(e,i,e)!==n});if(t.nodeType)return oe.grep(e,function(e){return e===t!==n});if("string"==typeof t){if(ge.test(t))return oe.filter(t,e,n);t=oe.filter(t,e)}return oe.grep(e,function(e){return Z.call(t,e)>-1!==n})}function r(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}function o(e){var t={};return oe.each(e.match(we)||[],function(e,n){t[n]=!0}),t}function s(){Q.removeEventListener("DOMContentLoaded",s),e.removeEventListener("load",s),oe.ready()}function a(){this.expando=oe.expando+a.uid++}function u(e,t,n){var i;if(void 0===n&&1===e.nodeType)if(i="data-"+t.replace(Ae,"-$&").toLowerCase(),n=e.getAttribute(i),"string"==typeof n){try{n="true"===n?!0:"false"===n?!1:"null"===n?null:+n+""===n?+n:Ne.test(n)?oe.parseJSON(n):n}catch(r){}ke.set(e,t,n)}else n=void 0;return n}function l(e,t,n,i){var r,o=1,s=20,a=i?function(){return i.cur()}:function(){return oe.css(e,t,"")},u=a(),l=n&&n[3]||(oe.cssNumber[t]?"":"px"),c=(oe.cssNumber[t]||"px"!==l&&+u)&&Le.exec(oe.css(e,t));if(c&&c[3]!==l){l=l||c[3],n=n||[],c=+u||1;do o=o||".5",c/=o,oe.style(e,t,c+l);while(o!==(o=a()/u)&&1!==o&&--s)}return n&&(c=+c||+u||0,r=n[1]?c+(n[1]+1)*n[2]:+n[2],i&&(i.unit=l,i.start=c,i.end=r)),r}function c(e,t){var n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[];return void 0===t||t&&oe.nodeName(e,t)?oe.merge([e],n):n}function f(e,t){for(var n=0,i=e.length;i>n;n++)Ee.set(e[n],"globalEval",!t||Ee.get(t[n],"globalEval"))}function d(e,t,n,i,r){for(var o,s,a,u,l,d,h=t.createDocumentFragment(),p=[],g=0,m=e.length;m>g;g++)if(o=e[g],o||0===o)if("object"===oe.type(o))oe.merge(p,o.nodeType?[o]:o);else if(Fe.test(o)){for(s=s||h.appendChild(t.createElement("div")),a=(qe.exec(o)||["",""])[1].toLowerCase(),u=Pe[a]||Pe._default,s.innerHTML=u[1]+oe.htmlPrefilter(o)+u[2],d=u[0];d--;)s=s.lastChild;oe.merge(p,s.childNodes),s=h.firstChild,s.textContent=""}else p.push(t.createTextNode(o));for(h.textContent="",g=0;o=p[g++];)if(i&&oe.inArray(o,i)>-1)r&&r.push(o);else if(l=oe.contains(o.ownerDocument,o),s=c(h.appendChild(o),"script"),l&&f(s),n)for(d=0;o=s[d++];)He.test(o.type||"")&&n.push(o);return h}function h(){return!0}function p(){return!1}function g(){try{return Q.activeElement}catch(e){}}function m(e,t,n,i,r,o){var s,a;if("object"==typeof t){"string"!=typeof n&&(i=i||n,n=void 0);for(a in t)m(e,a,n,i,t[a],o);return e}if(null==i&&null==r?(r=n,i=n=void 0):null==r&&("string"==typeof n?(r=i,i=void 0):(r=i,i=n,n=void 0)),r===!1)r=p;else if(!r)return this;return 1===o&&(s=r,r=function(e){return oe().off(e),s.apply(this,arguments)},r.guid=s.guid||(s.guid=oe.guid++)),e.each(function(){oe.event.add(this,t,r,i,n)})}function v(e,t){return oe.nodeName(e,"table")&&oe.nodeName(11!==t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e:e}function y(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function x(e){var t=ze.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function b(e,t){var n,i,r,o,s,a,u,l;if(1===t.nodeType){if(Ee.hasData(e)&&(o=Ee.access(e),s=Ee.set(t,o),l=o.events)){delete s.handle,s.events={};for(r in l)for(n=0,i=l[r].length;i>n;n++)oe.event.add(t,r,l[r][n])}ke.hasData(e)&&(a=ke.access(e),u=oe.extend({},a),ke.set(t,u))}}function w(e,t){var n=t.nodeName.toLowerCase();"input"===n&&_e.test(e.type)?t.checked=e.checked:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}function C(e,t,n,i){t=G.apply([],t);var r,o,s,a,u,l,f=0,h=e.length,p=h-1,g=t[0],m=oe.isFunction(g);if(m||h>1&&"string"==typeof g&&!ie.checkClone&&Be.test(g))return e.each(function(r){var o=e.eq(r);m&&(t[0]=g.call(this,r,o.html())),C(o,t,n,i)});if(h&&(r=d(t,e[0].ownerDocument,!1,e,i),o=r.firstChild,1===r.childNodes.length&&(r=o),o||i)){for(s=oe.map(c(r,"script"),y),a=s.length;h>f;f++)u=r,f!==p&&(u=oe.clone(u,!0,!0),a&&oe.merge(s,c(u,"script"))),n.call(e[f],u,f);if(a)for(l=s[s.length-1].ownerDocument,oe.map(s,x),f=0;a>f;f++)u=s[f],He.test(u.type||"")&&!Ee.access(u,"globalEval")&&oe.contains(l,u)&&(u.src?oe._evalUrl&&oe._evalUrl(u.src):oe.globalEval(u.textContent.replace(Ve,"")))}return e}function S(e,t,n){for(var i,r=t?oe.filter(t,e):e,o=0;null!=(i=r[o]);o++)n||1!==i.nodeType||oe.cleanData(c(i)),i.parentNode&&(n&&oe.contains(i.ownerDocument,i)&&f(c(i,"script")),i.parentNode.removeChild(i));return e}function T(e,t){var n=oe(t.createElement(e)).appendTo(t.body),i=oe.css(n[0],"display");return n.detach(),i}function E(e){var t=Q,n=Ue[e];return n||(n=T(e,t),"none"!==n&&n||(Xe=(Xe||oe("