Add hyphenation

This commit is contained in:
Flaviu Tamas 2015-04-27 17:15:48 -04:00
commit 440cba53d3
6 changed files with 141 additions and 37 deletions

View file

@ -1,5 +1,5 @@
<!DOCTYPE HTML>
<html lang="en">
<html lang="en-US">
<head>
<meta charset="utf-8">
<title>Nim by Example - <%= @item[:title] %></title>
@ -8,7 +8,6 @@
<link rel="stylesheet" href="<%= @items['/stylesheets/colorful/'].path %>" title="colorful">
<link rel="stylesheet" href="<%= @items['/stylesheets/fontello/'].path %>">
<script type="text/x-mathjax-config">
MathJax.Hub.Config({tex2jax: {inlineMath: [['«', '»']]}});
MathJax.Hub.config.tex2jax.skipTags = ["script", "noscript", "style", "textarea", "annotation", "annotation-xml"];
@ -28,44 +27,27 @@
<meta http-equiv="Default-Style" content="colorful">
</head>
<body>
<div id="sidebar">
<%= @items["/toc/"].compiled_content(:snapshot => :last) %>
</div>
<div id="main">
<h1 id="gh-buttons"><a class="icon-fork" href="https://github.com/flaviut/nim-by-example/"></a> <a class="icon-star" href="https://github.com/flaviut/nim-by-example/stargazers" /><div id="starcount"></div></a></h1>
<script>
function setVisibleTags(){
var tocLinks = document.querySelectorAll("#sidebar a:link, a:visited");
for(var i = 0; i < tocLinks.length; i++){
if(localStorage.getItem(tocLinks[i].getAttribute("href")) != null){
tocLinks[i].classList.add("visited");
}
}
}
var starcount_elem = document.getElementById("starcount");
function updateStarCounter(){
if(localStorage.getItem("_watchers") != null){
starcount_elem.innerHTML = localStorage.getItem("_watchers");
}
var request = new XMLHttpRequest();
// horrible hack... but stargazer output is capped at 30 per request.
request.open("GET", "https://api.github.com/search/repositories?q=nim-by-example", true);
request.onload = function (e) {
var searchResults = JSON.parse(request.responseText);
var starcount = searchResults.items[0].stargazers_count;
starcount_elem.innerHTML = starcount;
localStorage.setItem("_watchers", starcount)
};
request.onerror = function (e) {
console.error(request.statusText);
};
request.send(null);
}
updateStarCounter()
localStorage.setItem(window.location.pathname, true);
setVisibleTags()
</script>
<div id="main" class="hyphenate">
<h1 id="gh-buttons">
<a class="icon-fork" href="https://github.com/flaviut/nim-by-example/"></a>
<a class="icon-star" href="https://github.com/flaviut/nim-by-example/stargazers">
<div id="starcount"></div>
</a>
</h1>
<%= yield %>
</div>
<script src="/js/main.js" type="text/javascript"></script>
<script src="/js/hypth_loader.js" type="text/javascript"></script>
<script> Hyphenator_Loader.init({ "en": "automatically" }, "/js/hypth.js") </script>
</body>
</html>