Skip to content
This repository was archived by the owner on Sep 26, 2024. It is now read-only.

Commit d3ab3cc

Browse files
committed
Add asides for nice-looking notes and warnings
You can now use <aside> with the classes - warning - success - notice to add little colored notes to your API docs! Examples are in source/index.md. Also, note that if you have a custom variables.scss, you'll have to add +$aside-notice-bg: #8fbcd4; +$aside-warning-bg: #c97a7e; +$aside-success-bg: #6ac174; to it.
1 parent ca40fed commit d3ab3cc

File tree

10 files changed

+128
-5
lines changed

10 files changed

+128
-5
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,4 +184,5 @@ Special Thanks
184184
- [Middleman](https://github.com/middleman/middleman)
185185
- [jquery.tocify.js](https://github.com/gfranko/jquery.tocify.js)
186186
- [middleman-syntax](https://github.com/middleman/middleman-syntax)
187-
- [middleman-gh-pages](https://github.com/neo/middleman-gh-pages)
187+
- [middleman-gh-pages](https://github.com/neo/middleman-gh-pages)
188+
- [Font Awesome](http://fortawesome.github.io/Font-Awesome/)

config.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
set :images_dir, 'images'
66

7+
set :fonts_dir, 'fonts'
8+
79
set :markdown_engine, :redcarpet
810

911
set :markdown, :fenced_code_blocks => true, :smartypants => true, :disable_indented_code_blocks => true, :prettify => true, :tables => true, :with_toc_data => true, :no_intra_emphasis => true

source/fonts/icomoon.eot

2.42 KB
Binary file not shown.

source/fonts/icomoon.svg

Lines changed: 17 additions & 0 deletions
Loading

source/fonts/icomoon.ttf

2.26 KB
Binary file not shown.

source/fonts/icomoon.woff

2.34 KB
Binary file not shown.

source/index.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,9 @@ Kittn expects for the API key to be included in all API requests to the server i
4949

5050
`Authorization: meowmeowmeow`
5151

52-
You must replace `meowmeowmeow` with your personal API key from our developer portal.
52+
<aside class="notice">
53+
You must replace `meowmeowmeow` with your personal API key.
54+
</aside>
5355

5456
# Kittens
5557

@@ -108,6 +110,9 @@ Parameter | Default | Description
108110
include_cats | false | If set to true, the result will also include cats.
109111
available | true | If set to false, the result will include kittens that have already been adopted.
110112

113+
<aside class="success">
114+
Remember — a happy kitten is an authenticated kitten!
115+
</aside>
111116

112117
## Get a Specific Kitten
113118

@@ -144,6 +149,8 @@ curl "http://example.com/api/kittens/3"
144149

145150
This endpoint retrieves a specific kitten.
146151

152+
<aside class="warning">If you're not using an administrator API key, note that some kittens will return 403 Forbidden if they are hidden for admins only.</aside>
153+
147154
### HTTP Request
148155

149156
`GET http://example.com/kittens/<ID>`
@@ -158,6 +165,7 @@ ID | The ID of the cat to retrieve
158165

159166
The Kittn API uses the following error codes:
160167

168+
161169
Error Code | Meaning
162170
---------- | -------
163171
400 | Bad Request -- Your request sucks

source/stylesheets/icon-font.scss

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
@font-face {
2+
font-family: 'icomoon';
3+
src:font-url('icomoon.eot');
4+
src:font-url('icomoon.eot?#iefix') format('embedded-opentype'),
5+
font-url('icomoon.ttf') format('truetype'),
6+
font-url('icomoon.woff') format('woff'),
7+
font-url('icomoon.svg#icomoon') format('svg');
8+
font-weight: normal;
9+
font-style: normal;
10+
}
11+
12+
%icon {
13+
font-family: 'icomoon';
14+
speak: none;
15+
font-style: normal;
16+
font-weight: normal;
17+
font-variant: normal;
18+
text-transform: none;
19+
line-height: 1;
20+
}
21+
22+
%icon-exclamation-sign {
23+
@extend %icon;
24+
content: "\e600";
25+
}
26+
%icon-question-sign {
27+
@extend %icon;
28+
content: "\e601";
29+
}
30+
%icon-info-sign {
31+
@extend %icon;
32+
content: "\e602";
33+
}
34+
%icon-remove-sign {
35+
@extend %icon;
36+
content: "\e603";
37+
}
38+
%icon-plus-sign {
39+
@extend %icon;
40+
content: "\e604";
41+
}
42+
%icon-minus-sign {
43+
@extend %icon;
44+
content: "\e605";
45+
}
46+
%icon-ok-sign {
47+
@extend %icon;
48+
content: "\e606";
49+
}

source/stylesheets/screen.css.scss

Lines changed: 46 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
@import 'compass';
44
@import 'variables';
55
@import 'syntax';
6+
@import 'icon-font';
67

78
/*
89
Copyright 2008-2013 Concur Technologies, Inc.
@@ -29,6 +30,7 @@ html, body {
2930
padding: 0;
3031
margin: 0;
3132
-webkit-font-smoothing: antialiased;
33+
-moz-osx-font-smoothing: grayscale;
3234
@extend %default-font;
3335
background-color: $main-bg;
3436
}
@@ -212,10 +214,8 @@ html, body {
212214
z-index: 30;
213215

214216

215-
&>h1, &>h2, &>h3, &>p, &>table, &>ul, &>ol {
217+
&>h1, &>h2, &>h3, &>p, &>table, &>ul, &>ol, &>aside {
216218
margin-right: $examples-width;
217-
}
218-
&>h1, &>h2, &>h3, &>p, &>table, &>ul, &>ol {
219219
padding: 0 $main-padding;
220220
@include box-sizing(border-box);
221221
display: block;
@@ -330,6 +330,49 @@ html, body {
330330
@extend %break-words;
331331
@extend %code-font;
332332
}
333+
334+
aside {
335+
padding-top: 1em;
336+
padding-bottom: 1em;
337+
text-shadow: 0 1px 0 lighten($aside-notice-bg, 15%);
338+
margin-top: 1.5em;
339+
margin-bottom: 1.5em;
340+
background: $aside-notice-bg;
341+
line-height: 1.6;
342+
343+
&.warning {
344+
background-color: $aside-warning-bg;
345+
text-shadow: 0 1px 0 lighten($aside-warning-bg, 15%);
346+
}
347+
348+
&.success {
349+
background-color: $aside-success-bg;
350+
text-shadow: 0 1px 0 lighten($aside-success-bg, 15%);
351+
}
352+
}
353+
354+
355+
aside.warning {
356+
}
357+
358+
aside:before {
359+
vertical-align: middle;
360+
padding-right: 0.5em;
361+
font-size: 14px;
362+
}
363+
364+
aside.notice:before {
365+
@extend %icon-info-sign;
366+
}
367+
368+
aside.warning:before {
369+
@extend %icon-exclamation-sign;
370+
}
371+
372+
aside.success:before {
373+
@extend %icon-ok-sign;
374+
}
375+
333376
}
334377

335378

source/stylesheets/variables.scss

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ $lang-select-bg: #222;
3434
$lang-select-active-bg: $examples-bg; // feel free to change this to blue or something
3535
$lang-select-pressed-bg: #111; // color of language tab bg when mouse is pressed
3636
$main-bg: #eaf2f6;
37+
$aside-notice-bg: #8fbcd4;
38+
$aside-warning-bg: #c97a7e;
39+
$aside-success-bg: #6ac174;
3740

3841

3942
// TEXT COLORS

0 commit comments

Comments
 (0)