Skip to content

Commit

Permalink
Documenting Journo a bit better.
Browse files Browse the repository at this point in the history
  • Loading branch information
jashkenas committed Mar 17, 2013
1 parent eaefe05 commit 682e170
Show file tree
Hide file tree
Showing 23 changed files with 1,467 additions and 5 deletions.
5 changes: 4 additions & 1 deletion Cakefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
{spawn} = require 'child_process'
{spawn, exec} = require 'child_process'
fs = require 'fs'

task "build", "watch and build the Journo source", ->
compiler = spawn 'coffee', ['-cw', '.']
compiler.stdout.on 'data', (data) -> console.log data.toString().trim()
compiler.stderr.on 'data', (data) -> console.error data.toString().trim()

task "doc", "generate documentation", ->
exec "docco -l linear journo.litcoffee"

# Until GitHub has proper Literate CoffeeScript highlighting support, let's
# manually futz the README ourselves.
task "readme", "rebuild the readme file", ->
Expand Down
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,18 @@ You can install and use the `journo` command via npm: `sudo npm install -g journ
... now, let's go through those features one at a time:


Getting Started
---------------

1. Create a folder for your blog, and `cd` into it.

2. Type `journo init` to bootstrap a new empty blog.

3. Edit the `config.json`, `layout.html`, and `posts/index.md` files to suit.

4. Type `journo` to start the preview server, and have at it.


Write in Markdown
-----------------

Expand Down
29 changes: 29 additions & 0 deletions bootstrap/layout.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title><%= title || "Journo" %></title>
</head>

<body>

<div class="content">

<%= content %>

<% if (post != 'index.md') { %>
<div class="nav">
<% var idx = posts.indexOf(post); %>
<% if (idx > 0) { %>
<a class="prev" href="/<%= postName(posts[idx - 1]) %>/"><span class="arrow">&larr;</span> Prev</a>
<% } %>
<% if (idx < posts.length - 1) { %>
<a class="next" href="/<%= postName(posts[idx + 1]) %>/">Next <span class="arrow">&rarr;</span></a>
<% } %>
</div>
<% } %>

</div>

</body>
</html>
15 changes: 14 additions & 1 deletion bootstrap/posts/index.md
Original file line number Diff line number Diff line change
@@ -1 +1,14 @@
Home page
<div class="index-page">

<%
_.each(posts.reverse(), function(file) {
var post = postName(file);
var data = manifest[file];
if (post == 'index') return;
%>
<a class="post-item" href="/<%= post %>/">
<%= data.title %>
</a>
<% }); %>

</div>
Loading

0 comments on commit 682e170

Please sign in to comment.