Permalink
Browse files

Update jade template and add self-documenting example

  • Loading branch information...
1 parent 3454f82 commit e8b528582daea7d51209a7dec87b6fce334aba40 @jacobrask committed Nov 11, 2012
Showing with 70 additions and 25 deletions.
  1. +0 −1 .gitignore
  2. +36 −0 examples/styledocco.html
  3. +8 −6 web/app.js
  4. +4 −4 web/bar.css
  5. +21 −13 web/index.jade
  6. +1 −1 web/models/documentation.js
View
@@ -1,4 +1,3 @@
node_modules/
-examples/
dist/
test/lib/
View
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title></title>
+ <meta charset="utf-8">
+ <script>
+ var styledocco = {
+ project: {
+ name: "StyleDocco",
+ // Array of CSS file paths.
+ stylesheets: [
+ '../web/app.css',
+ '../web/bar.css',
+ '../web/views/navbar.css',
+ '../web/views/preview.css'
+ ]
+ }
+ };
+ </script>
+ <link rel="stylesheet" href="../dist/docs.css">
+ <script src="../dist/docs.js"></script>
+ </head>
+ <body>
+ <div class="bar top">
+ <div id="navbar" class="container"></div>
+ </div>
+ <section id="content" class="container">
+ <article class="section">
+ <div class="docs">
+ <p>Write an introduction to your project here.</p>
+ </div>
+ </article>
+ </section>
+ </body>
+</html>
+<!-- Generated with StyleDocco (http://jacobrask.github.com/styledocco).-->
View
@@ -36,17 +36,19 @@ var ajax = function(path, cb) {
};
var docus = new DocuCollection();
-_.forEach(styledocco.config.stylesheets, function(file) {
+_.forEach(styledocco.project.stylesheets, function(file) {
docus.add(new Docu({ path: file }));
});
-async.map(styledocco.config.includes, ajax, function(err, res) {
- docus.forEach(function(docu) {
- docu.set('extraCss', res.join(''));
+if (styledocco.project.includes) {
+ async.map(styledocco.project.includes, ajax, function(err, res) {
+ docus.forEach(function(docu) {
+ docu.set('extraCss', res.join(''));
+ });
});
-});
+}
-var navBar = new NavBarModel({ name: styledocco.config.name });
+var navBar = new NavBarModel({ name: styledocco.project.name });
var Router = Backbone.Router.extend({
routes: {
View
@@ -9,13 +9,13 @@ Bars for navigation or settings, fixed to top or bottom. */
line-height: 3em;
/* The bars have a slightly faded background and a little transparency. */
background-image: -webkit-linear-gradient(hsl(200, 14%, 95%),
- hsla(200, 14%, 88%, .95));
+ hsla(201, 14%, 88%, .97));
background-image: -moz-linear-gradient(hsl(200, 14%, 95%),
- hsla(200, 14%, 88%, .95));
+ hsla(200, 14%, 88%, .97));
background-image: -o-linear-gradient(hsl(200, 14%, 95%),
- hsla(200, 14%, 88%, .95));
+ hsla(200, 14%, 88%, .97));
background-image: linear-gradient(hsl(200, 14%, 95%),
- hsla(200, 14%, 88%, .95));
+ hsla(200, 14%, 88%, .97));
}
.bar {
border: 0 solid hsla(200, 14%, 28%, .2);
View
@@ -4,19 +4,25 @@ html
title
meta(charset='utf-8')
script
- var styledocco = {};
- styledocco.config = {
- name: "Project name",
- // All paths must be same origin.
- // Array of CSS file paths.
- stylesheets: [
- '../web/app.css',
- '../web/bar.css',
- '../web/views/navbar.css',
- '../web/views/preview.css'
- ],
- // Paths to extra CSS and/or JavaScript to include in previews.
- includes: [ '../web/docs.css' ]
+ var styledocco = {
+ project: {
+
+ name: "Project name",
+
+ // All paths must be same origin.
+
+ // Array of CSS file paths.
+ stylesheets: [
+ // 'stylesheet.css',
+ ],
+
+ // Paths to optional CSS and/or JavaScript to include in previews.
+ includes: [
+ // 'docs.css',
+ // 'app.js'
+ ]
+
+ }
};
link(rel="stylesheet",href="docs.css")
script(src="docs.js")
@@ -26,6 +32,8 @@ html
section#content.container
article.section
.docs
+
p Write an introduction to your project here.
+
// Generated with StyleDocco (http://jacobrask.github.com/styledocco).
@@ -44,7 +44,7 @@ var Documentation = Model.extend({
});
},
- error: function() {
+ error: function (req, err, ex) {
this.set('docs', "Could not fetch documentation from " + this.get('path'));
},

0 comments on commit e8b5285

Please sign in to comment.