Skip to content

Commit

Permalink
docs page is done, community page is doneish, starting on tutorial
Browse files Browse the repository at this point in the history
  • Loading branch information
Techwraith committed Oct 7, 2012
1 parent cf954d3 commit 6c37227
Show file tree
Hide file tree
Showing 10 changed files with 188 additions and 37 deletions.
30 changes: 25 additions & 5 deletions site/app/controllers/main.js
Expand Up @@ -79,11 +79,20 @@ var Main = function () {
}
geddy.request(options, function (err, resp) {
var content = new Buffer(resp.content, 'base64').toString('utf8')
, name = paths[i].path.replace('.md','');
, name = paths[i].path.replace('.md','')
, subs = []
, lines = content.split('\n');
for (var l in lines) {
if (lines[l].indexOf('####') == 0) {
subs.push(geddy.string.trim(lines[l].replace('####', '')));
}
}
docs[parseInt(name[0]) - 1] = {
name: name.split('-')[1]
, content: md(content)
, subs: subs
};
console.log(subs);
return respond(paths.length);
});
}
Expand Down Expand Up @@ -138,10 +147,21 @@ var Main = function () {
};

this.community = function (req, resp, params) {
this.respond(params, {
format: 'html'
, template: 'app/views/main/community'
});
var self = this;
var gotStars = function (err, stars) {
self.respond({stars: stars}, {
format: 'html'
, template: 'app/views/main/community'
});
};

// get stargazers
var opts = {
url: 'https://api.github.com/repos/mde/geddy/stargazers?page='+(Math.floor(Math.random()*10)+1)
, dataType: 'json'
};
console.log(opts);
geddy.request(opts, gotStars);
};

this.faq = function (req, resp, params) {
Expand Down
1 change: 1 addition & 0 deletions site/app/views/layouts/application.html.jade
Expand Up @@ -14,6 +14,7 @@ html(lang="en")
!= scriptLink('/js/jquery.min.js', {type:'text/javascript'})
!= scriptLink('/js/bootstrap.min.js', {type:'text/javascript'})
!= scriptLink('/js/site.js', {type: 'text/javascript'});

!= styleLink('/css/bootstrap.min.css', {rel:'stylesheet'})
!= styleLink('/css/bootstrap.responsive.min.css', {rel:'stylesheet'})
Expand Down
69 changes: 39 additions & 30 deletions site/app/views/main/community.html.jade
Expand Up @@ -3,43 +3,52 @@
h2 Community resources
.row
.span6.box
.span2.avatar
.span2.avatar
.span2.avatar
.span2.avatar
.span2.avatar
.span2.avatar
- for (var i=0; i<6; i++) {
- star = stars.pop();
.span2.avatar
a(href="http://github.com/" + star.login, target="blank")
img(src=star.avatar_url + "&s=300")
- }
.span6.info
h3 Fork it on Github
p Geddy has a vibrant community of users and contributors. Check out the source on github, join the mailing list, and get a jump start on your next app.
a(href="http://github.com/mde/geddy") View the source, Luke.
.row
.span2.avatar
.span2.avatar
.span2.avatar
.span2.avatar
.span2.avatar
.span2.avatar
- for (var i=0; i<6; i++) {
- star = stars.pop();
.span2.avatar
a(href="http://github.com/" + star.login, target="blank")
img(src=star.avatar_url + "&s=300")
- }
.row
.span6.info
h3 Bug reports and feature requests
p We love getting feedback from the community. Voice your opinion and hear about new features on the mailing list, contribute to our issue list, or go fix a bug yourself.
a(href="") Report a bug.
.span6.box
.span2.avatar
.span2.avatar
.span2.avatar
.span2.avatar
.span2.avatar
.span2.avatar
- for (var i=0; i<6; i++) {
- star = stars.pop();
.span2.avatar
a(href="http://github.com/" + star.login, target="blank")
img(src=star.avatar_url + "&s=300")
- }
.row
.span2.avatar
.span2.avatar
.span2.avatar
.span2.avatar
.span2.avatar
.span2.avatar
- for (var i=0; i<6; i++) {
- star = stars.pop();
.span2.avatar
a(href="http://github.com/" + star.login, target="blank")
img(src=star.avatar_url + "&s=300")
- }
.row
.span6.box
.span2.avatar
.span2.avatar
.span2.avatar
.span2.avatar
.span2.avatar
.span2.avatar
- for (var i=0; i<6; i++) {
- star = stars.pop();
.span2.avatar
a(href="http://github.com/" + star.login, target="blank")
img(src=star.avatar_url + "&s=300")
- }
.span6.info
h3 Example Applications
p Take a look at our example apps in the Github repo. Learn how to requre authentication, hook your app up to MongoDB, or use Jade as your templating language.
a(href="") Learn by example.

5 changes: 5 additions & 0 deletions site/app/views/main/documentation.html.jade
Expand Up @@ -7,6 +7,11 @@
each doc in docs
li
a(href="#"+doc.name)=doc.name
if doc.subs
ul
each sub in doc.subs
li
a(href="#"+doc.name+sub)=sub
.span8
each doc in docs
h3(id=doc.name)=geddy.string.capitalize(doc.name)
Expand Down
2 changes: 2 additions & 0 deletions site/log/stderr.log
@@ -0,0 +1,2 @@
[Sun, 07 Oct 2012 03:09:29 GMT] ERROR Worker 83775 died.
[Sun, 07 Oct 2012 03:14:16 GMT] ERROR Worker 83904 died.
40 changes: 40 additions & 0 deletions site/public/css/style.css
Expand Up @@ -170,6 +170,36 @@ input:-ms-input-placeholder {
.info {
height: 300px;
background: #3399cc;
position: relative;
}

.info h3 {
color: white;
margin: 10px 15px;
font-size: 42px;
line-height: 120%;
font-weight: lighter;
}

.info p {
font-size: 20px;
margin: 0 15px;
color: white;
line-height: 130%;
}

.info a {
display: block;
font-size: 20px;
text-align: right;
position: absolute;
bottom: 20px;
right: 20px;
}

.info a:hover {
color: white;
text-decoration: none;
}

/* END Community Page */
Expand All @@ -183,6 +213,7 @@ input:-ms-input-placeholder {
.toc {
margin-top: -60px;
float: right;
right: 0;
}

.toc ul {
Expand All @@ -199,12 +230,21 @@ input:-ms-input-placeholder {
margin-bottom: 20px;
}

.toc ul li a:hover {
text-decoration: none;
}

.toc ul li a.selected {
color: #14509e;
}

.toc ul li ul {
margin: 15px 0 15px 0;
display: none;
}

.toc ul li ul.selected {
display: block;
}

.toc ul li ul li {
Expand Down
2 changes: 1 addition & 1 deletion site/public/js/jquery.min.js

Large diffs are not rendered by default.

67 changes: 67 additions & 0 deletions site/public/js/site.js
@@ -0,0 +1,67 @@
var app = {}
// set up some state
app.init = function () {
app.state = {};
app.state.location = window.location;
app.state.page = app.state.location.pathname.replace('/','');
};

app.docs = new (function() {

this.init = function() {
this.$toc = $('.toc');
this.$content = $('content .span8');
this.giveSubIDs();
this.registerScroll();
this.registerMenu();
};

// register the collapsible menu
this.registerMenu = function() {
var self = this;
this.$toc.find('ul > li').click(function(e) {
var $el = $(this);
self.$toc.find('.selected').removeClass('selected');
$el.find('ul').addClass('selected');
$el.find('a:first').addClass('selected');
});
};

// register the scrolling menu
this.registerScroll = function() {
var self = this;
$(window).scroll(function(e) {
var newTop = $(this).scrollTop();
if (newTop > 462) {
self.$toc.offset({top: newTop + 20});
} else {
self.$toc.css({'top': 0, 'position': 'static'});
}
});
};

// make internal anchor links work for sub menu items
this.giveSubIDs = function() {
var section;
$('.content .span8').children('h3, h4').each(function (i, el) {
var $el = $(el);
if (el.nodeName == "H3") {
section = $el.attr('id');
} else {
$el.attr('id', section + $el.text());
}
});
};

})();

// wait for document to load
// then init this page
$(document).ready(function () {
if (app.state.page == 'documentation' || app.state.page == 'tutorial') {
app.docs.init();
}
});

// Start shit up
app.init();
2 changes: 1 addition & 1 deletion templates/base/public/js/jquery.min.js

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions tutorial.md
@@ -0,0 +1,7 @@
### Introduction

This is an intro paragraph, it's only here to see what this will look like.

#### this is a sub heading

heres some more text

0 comments on commit 6c37227

Please sign in to comment.