Add buttons

This commit is contained in:
flaviut 2014-06-04 18:54:54 -04:00
commit b9b9848039
10 changed files with 91 additions and 35 deletions

View file

@ -1,12 +0,0 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg">
<metadata>Copyright (C) 2014 by original authors @ fontello.com</metadata>
<defs>
<font id="fontello" horiz-adv-x="1000" >
<font-face font-family="fontello" font-weight="400" font-stretch="normal" units-per-em="1000" ascent="850" descent="-150" />
<missing-glyph horiz-adv-x="1000" />
<glyph glyph-name="ok" unicode="&#xe800;" d="m932 534q0-22-15-38l-404-404-76-76q-16-15-38-15t-38 15l-76 76-202 202q-15 16-15 38t15 38l76 76q16 16 38 16t38-16l164-165 366 367q16 16 38 16t38-16l76-76q15-16 15-38z" horiz-adv-x="1000" />
</font>
</defs>
</svg>

Before

Width:  |  Height:  |  Size: 719 B

Binary file not shown.

View file

@ -0,0 +1,14 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg">
<metadata>Copyright (C) 2014 by original authors @ fontello.com</metadata>
<defs>
<font id="fontello" horiz-adv-x="1000" >
<font-face font-family="fontello" font-weight="400" font-stretch="normal" units-per-em="1000" ascent="850" descent="-150" />
<missing-glyph horiz-adv-x="1000" />
<glyph glyph-name="check" unicode="&#xe800;" d="m932 534q0-22-15-38l-404-404-76-76q-16-15-38-15t-38 15l-76 76-202 202q-15 16-15 38t15 38l76 76q16 16 38 16t38-16l164-165 366 367q16 16 38 16t38-16l76-76q15-16 15-38z" horiz-adv-x="1000" />
<glyph glyph-name="star" unicode="&#xe801;" d="m634 290l171 165-235 35-106 213-105-213-236-35 171-165-41-235 211 111 211-111z m295 199q0-12-15-27l-203-197 48-279q1-4 1-12 0-28-23-28-10 0-22 7l-251 132-250-132q-13-7-23-7-11 0-17 9t-6 19q0 4 1 12l48 279-203 197q-14 15-14 27 0 21 31 26l280 40 126 254q11 23 27 23t28-23l125-254 280-40q32-5 32-26z" horiz-adv-x="928.6" />
<glyph glyph-name="fork" unicode="&#xe802;" d="m161 29q0 22-16 38t-38 15-38-15-15-38 15-38 38-16 38 16 16 38z m0 642q0 23-16 38t-38 16-38-16-15-38 15-38 38-15 38 15 16 38z m357-71q0 22-16 38t-38 16-38-16-15-38 15-38 38-16 38 16 16 38z m53 0q0-29-14-54t-39-39q-1-160-126-231-38-21-114-45-71-22-94-39t-23-56v-15q24-14 39-39t14-53q0-45-31-76t-76-32-76 32-31 76q0 29 15 53t39 39v458q-25 14-39 39t-15 53q0 45 31 76t76 32 76-32 31-76q0-29-14-53t-39-39v-278q30 15 86 32 30 10 49 17t39 17 33 22 22 29 16 38 5 51q-25 14-39 39t-15 54q0 45 31 76t76 31 76-31 31-76z" horiz-adv-x="571.4" />
</font>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

30
content/stylesheets/fontello.css vendored Normal file
View file

@ -0,0 +1,30 @@
@font-face {
font-family: 'fontello';
src: url('/fonts/fontelloe.eot?23005170');
src: url('/fonts/fontelloe.eot?23005170#iefix') format('embedded-opentype'),
url('/fonts/fontellow.woff?23005170') format('woff'),
url('/fonts/fontellot.ttf?23005170') format('truetype'),
url('/fonts/fontellos.svg?23005170#fontello') format('svg');
font-weight: normal;
font-style: normal;
}
[class^="icon-"]:before, [class*=" icon-"]:before {
font-family: "fontello";
font-style: normal;
font-weight: normal;
speak: none;
display: inline-block;
text-decoration: inherit;
width: 1em;
margin-right: .2em;
text-align: center;
font-variant: normal;
text-transform: none;
}
.icon-check:before { content: '\e800'; } /* '' */
.icon-star:before { content: '\e801'; } /* '' */
.icon-fork:before { content: '\e802'; } /* '' */

View file

@ -1,16 +1,8 @@
@font-face {
font-family: "FontAwesome";
src: url('/fonts/fontawesomee.eot?45135880'); /* IE9 Compat Modes */
src: url('/fonts/fontawesomew.woff?45135880') format('woff'), /* Modern Browsers */
url('/fonts/fontawesomet.ttf?45135880') format('truetype'), /* Safari, Android, iOS */
url('/fonts/fontawesomes.svg?45135880#fontello') format('svg'); /* Legacy iOS */
}
* {
margin: 0;
padding: 0;
font-family: Georgia, Palatino, serif;
font-family: Palatino, serif;
box-sizing: border-box;
}
@ -41,6 +33,28 @@ a:hover {
max-width: 600px;
}
#main #gh-buttons {
float: right;
}
#main #starcount {
line-height: 20px;
font-size: 15px;
text-align: center;
color: #000;
position: absolute;
display: block;
float: right;
right: 5px;
width: 3em;
background: #FFF;
border: 1px solid #CCC;
border-radius: 3px;
height: 20px;
}
#main h1 {
font-size: 40px;
font-weight: normal;
@ -72,7 +86,7 @@ a:hover {
#main table, th, td {
border-collapse: collapse;
border: 1px solid #CCC;
background-color: #FFF;
background-color: #FFF;
padding: 3px;
}
@ -88,11 +102,11 @@ a:hover {
#main code {
background: #FFFFFF;
padding: 0px 3px;
padding: 0px 3px;
}
#main pre code { /* Block Code */
display: block;
display: block;
word-wrap: break-word;
overflow: auto;
@ -106,7 +120,7 @@ a:hover {
background:#FFF;
box-shadow:1px 3px 12px #BBB;
padding: 10px 15px;
font-size: 15px;
font-size: 15px;
margin: 20px 10px 20px 0px;
}
@ -124,6 +138,9 @@ a:hover {
padding: 20px;
border-right: 1px solid #ccc;
font-size: 14px;
line-height: 20px;
}
#sidebar h2 {
@ -135,19 +152,14 @@ a:hover {
}
#sidebar ul {
position: relative;
left: 30px;
position: relative;
left: 30px;
list-style: decimal-leading-zero;
}
#sidebar li {
font-size: 14px;
line-height: 20px;
}
#sidebar a.visited:after { /* selected with JS */
content: "";
font-family: "FontAwesome";
font-family: "fontello";
position: absolute;
left: -3em;
color: #EEE;

View file

@ -13,4 +13,4 @@
* [Functions]()
* [Exceptions](/exceptions/)
* [Varargs](/varargs/)
* [OOP Macro](/oop_macro/)
* [OOP Macro](/oop_macro/)

View file

@ -5,7 +5,7 @@
<title>Nimrod by Example - <%= @item[:title] %></title>
<link rel="stylesheet" href="<%= @items['/stylesheets/main/'].path %>">
<link rel="stylesheet" href="<%= @items['/stylesheets/colorful/'].path %>" title="colorful">
<link rel="stylesheet" href="<%= @items['/stylesheets/cotton_candy/'].path %>" title="cottoncandy">
<link rel="stylesheet" href="<%= @items['/stylesheets/fontello/'].path %>">
<meta name="generator" content="nanoc <%= Nanoc::VERSION %>">
<meta http-equiv="Default-Style" content="colorful">
</head>
@ -14,6 +14,7 @@
<%= @items["/toc/"].compiled_content(:snapshot => :last) %>
</div>
<div id="main">
<h1 id="gh-buttons"><a class="icon-fork" href="https://github.com/flaviut/nimrod-by-example/"></a> <a class="icon-star" href="https://github.com/flaviut/nimrod-by-example/stargazers" /><div id="starcount">?</div></a></h1>
<%= yield %>
</div>
<script>
@ -24,6 +25,17 @@
tocLinks[i].classList.add("visited");
}
}
var request = new XMLHttpRequest();
request.open("GET", "https://api.github.com/repos/flaviut/nimrod-by-example/stargazers", true);
request.onload = function (e) {
var starcount = JSON.parse(request.responseText).length;
var starcount_elem = document.getElementById("starcount");
starcount_elem.innerHTML = starcount;
};
request.onerror = function (e) {
console.error(request.statusText);
};
request.send(null);
</script>
</body>
</html>