Skip to content

Commit

Permalink
Cleaning up and almost final raw design
Browse files Browse the repository at this point in the history
  • Loading branch information
hunvreus committed Dec 27, 2012
1 parent bfd99fe commit bc89a10
Show file tree
Hide file tree
Showing 12 changed files with 351 additions and 143 deletions.
4 changes: 1 addition & 3 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,4 @@ exclude: ['README.markdown']
permalink: ':title'
pygments: true
safe: false
url: 'htt://example.com'
title: 'Carte'
parent: {name: '← Return to example.com', url: 'http://example.com'}
title: 'Carte'
46 changes: 31 additions & 15 deletions _layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@

<!-- CSS -->
<link href="/css/normalize.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="http://yandex.st/highlightjs/7.3/styles/tomorrow.min.css">
<link href='http://fonts.googleapis.com/css?family=Imprima' rel='stylesheet' type='text/css'>
<link href="/css/style.css" rel="stylesheet" type="text/css">

<!-- Icons -->
Expand All @@ -20,22 +18,40 @@
<link rel="apple-touch-icon" sizes="114x114" href="/images/apple-touch-icon-114x114.png">
</head>
<body>
<header id="header">
<h1>{{ site.title }}</h1>
<nav>
<ul>
<li><a href='{{ site.parent.url }}'>{{ site.parent.name }}</a></li>
</ul>
</nav>
</header>
<div id="content">
{{ content }}
</div>
{{ content }}

<!-- JS -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js" type="text/javascript"></script>
<script src="http://yandex.st/highlightjs/7.3/highlight.min.js"></script>
<script type="text/javascript">(function($) { hljs.initHighlightingOnLoad(); })(jQuery);</script>
<script type="text/javascript">
(function($) {
// Collapsible articles
$('article').each(function () {
var that = $(this);
var header = that.children('a');
var body = that.children('.body');
body.hide();
header.toggle(
function () { body.slideDown('fast'); that.addClass('active'); },
function () { body.slideUp('fast'); that.removeClass('active'); }
);
});

// Expanding the article on link click and scrolling down to it
$('#links a').each(function () {
var that = $(this);
that.click(function (e) {
e.preventDefault();
var that = $(this);
var id = that.attr('href').substring(1);
var header = $('article a[name="'+ id +'"]')
if (!header.parent().hasClass('active')) header.trigger('click');
$('html, body').animate({
scrollTop: header.offset().top
}, 'fast');
});
});
})(jQuery);
</script>
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
Expand Down
28 changes: 28 additions & 0 deletions _posts/2012-12-24-delete-a-thing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
path: '/stuff/:id'
title: 'Delete a thing'
type: 'DELETE'
parameters:
- name: 'id'
description: 'the id of the thing to delete.'

layout: nil
---

This method allows the user to post a new thing to his stuff.

### Request

* Authentication is required.
* The body is omitted.

### Response

Sends back a collection of things.

```Status: 200 Deleted```

```{
code: 200,
message: 'Your thing (id: 736) was deleted'
}```
38 changes: 0 additions & 38 deletions _posts/2012-12-25-post-a-thing.md

This file was deleted.

43 changes: 43 additions & 0 deletions _posts/2012-12-25-put-a-thing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
path: '/stuff/:id'
title: 'Update a thing'
type: 'PUT'

layout: post
---

This method allows the user to retrieve his stuff.

### Request

#### Requirements

* **URL**: `:id` is the id the thing to update.'
* **Header**: Valid authentication token.
* **Body**: can't be empty and must include at least **name**, a `string` that will be used as the name of the thing.

#### Sample

```Authentication: bearer f862f658-ad89-4fcb-995b-7a4c50554ff6```
```{
name: 'My new thing'
}```
### Response
Sends back a collection of things.
```Status: 200 OK```
```{
{
id: thing_1,
name: 'My first thing'
},
{
id: thing_2,
name: 'My second thing'
}
}```
For errors, see the [code]
29 changes: 0 additions & 29 deletions _posts/2012-12-26-get-stuff.md

This file was deleted.

32 changes: 32 additions & 0 deletions _posts/2012-12-26-post-a-thing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
path: '/stuff'
title: 'Post a thing'
type: 'POST'

layout: post
---

This method allows users to crate a new thing.

### Request

Expects a fully formed thing object.

```Authentication: bearer TOKEN```

```{
name: 'My new thing'
}```
### Response
**If succeeds**, returns the created thing.
```Status: 201 Created```
```{
id: new_thing,
name: 'My new thing'
}```
ERROR
28 changes: 28 additions & 0 deletions _posts/2012-12-27-get-stuff.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
path: '/stuff'
title: 'Get stuff'
type: 'GET'

layout: post
---

This method allows users to retrieve stuff.

### Response

Sends back a collection of things.

```Status: 200 OK```

```{
{
id: thing_1,
name: 'My first thing'
},
{
id: thing_2,
name: 'My second thing'
}
}```
ERROR
19 changes: 19 additions & 0 deletions _posts/2012-12-28-authentication.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
path: '/login'
title: 'Authenticate'

layout: post
---

This method allows users to retrieve stuff.

### Response

Sends back a collection of things.

```Authentication: bearer TOKEN```

```{
id: thing_2,
name: 'My second thing'
}```
16 changes: 16 additions & 0 deletions _posts/2012-12-28-response-status-codes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
title: 'Response status codes'

layout: nil
---

### Success

### Error

```Status: 401 Access denied```

```{
code: 401,
message: 'Access denied: invalid authentication token.'
}```
Loading

0 comments on commit bc89a10

Please sign in to comment.