Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Generate the TOC from data, making it easier to modify. Adjust layout
to include generated TOC. Fix error in running that stopped TOC being generated. Add _view.sh to view locally and modify _deploy.sh to build TOC.
- Loading branch information
Noel Welsh
committed
Apr 18, 2012
1 parent
059608a
commit cadb197
Showing
7 changed files
with
100 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
#!/bin/bash | ||
rvm use ruby-1.9.2 | ||
racket -e '(begin (require "toc.rkt") (make-toc toc))' | ||
jekyll | ||
rsync -av _site/* admin@unweb:/srv/noelwelsh.com/public/htdocs/blueeyes | ||
rsync -av _site/* admin@unweb:/srv/noelwelsh.com/public/htdocs/blueeyes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<ul> | ||
<li><a href="intro.html">A Quick Introduction to BlueEyes</a></li> | ||
<li><a href="setup.html">Setting up a BlueEyes Project</a></li> | ||
<li><a href="request-handlers.html">Building Request Handlers</a></li> | ||
<li><a href="running.html">Running Services</a></li> | ||
<li><a href="concurrency.html">BlueEyes' Concurrency Model</a></li> | ||
<li><a href="http-client.html">Consuming REST Services</a></li> | ||
<li><a href="testing.html">Testing BlueEyes Services</a></li> | ||
<li><a href="json.html">Manipulating JSON</a></li> | ||
<li><a href="mongo.html">Working with Mongo</a></li> | ||
<li><a href="streaming.html">Streaming Requests and Responses</a></li> | ||
<li><a href="deployment.html">Deploying Services in Production</a></li> | ||
</ul> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/bash | ||
rvm use ruby-1.9.2 | ||
racket -e '(begin (require "toc.rkt") (make-toc toc))' | ||
jekyll --server --auto |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
--- | ||
layout: page | ||
titie: Running Services | ||
title: Running Services | ||
--- | ||
|
||
## Configuration | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--- | ||
layout: page | ||
title: Setting up a BlueEyes Project | ||
--- | ||
|
||
Setting up a BlueEyes project using SBT just requires adding ReportGrid's repository to your resolvers, and then creating a dependency on the three BlueEyes packages. The relevant lines are: | ||
|
||
{% highlight scala %} | ||
resolvers ++= Seq( | ||
"ReportGrid" at "http://nexus.reportgrid.com/content/repositories/public-snapshots" | ||
) | ||
|
||
libraryDependencies ++= Seq( | ||
"com.reportgrid" %% "blueeyes-core" % "0.6.0-SNAPSHOT", | ||
"com.reportgrid" %% "blueeyes-mongo" % "0.6.0-SNAPSHOT", | ||
"com.reportgrid" %% "blueeyes-json" % "0.6.0-SNAPSHOT" | ||
) | ||
{% endhighlight scala %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
#lang racket | ||
|
||
(provide | ||
toc | ||
make-toc) | ||
|
||
(define toc | ||
'("intro.html" | ||
"setup.html" | ||
"request-handlers.html" | ||
"running.html" | ||
"concurrency.html" | ||
"http-client.html" | ||
"testing.html" | ||
"json.html" | ||
"mongo.html" | ||
"streaming.html" | ||
"deployment.html" | ||
)) | ||
|
||
(define toc-file-name "_includes/toc.html") | ||
|
||
(define (make-toc toc) | ||
(define (build-toc toc) | ||
(displayln "<ul>") | ||
(map build-item toc) | ||
(displayln "</ul>")) | ||
(define (build-item item) | ||
(cond | ||
[(string? item) | ||
(printf "<li><a href=\"~a\">~a</a></li>\n" item (title item))] | ||
[(pair? item) | ||
(build-toc item)])) | ||
|
||
(with-output-to-file toc-file-name | ||
(lambda () (build-toc toc)) | ||
#:exists 'replace)) | ||
|
||
|
||
(define (source-file-name file-name) | ||
(cond | ||
[(file-exists? file-name) | ||
file-name] | ||
[(file-exists? (regexp-replace ".html" file-name ".markdown")) | ||
(regexp-replace ".html" file-name ".markdown")] | ||
[else | ||
(error (format "~a does not exist" file-name))])) | ||
|
||
(define (title file-name) | ||
(with-input-from-file (source-file-name file-name) | ||
(lambda () | ||
(define (find-title) | ||
(let* ([line (read-line)] | ||
[_ (if (eof-object? line) | ||
(error (format "No title found in ~a\n" file-name)) | ||
#t)] | ||
[mtch (regexp-match #rx"^title: (.*)$" line)]) | ||
(match mtch | ||
[(cons _ (list ttl)) ttl] | ||
[#f (find-title)]))) | ||
(find-title)))) |