Permalink
Browse files

compile docs

  • Loading branch information...
1 parent 21fcaf7 commit 23b2ab0e974692d990a03c99132b36f017cb96c1 @lancejpollard lancejpollard committed Oct 9, 2012
Showing 568 changed files with 127,987 additions and 41,139 deletions.
View
@@ -10,4 +10,13 @@
- /examples
- /tutorials
- /contributors
-- /roadmap
+- /roadmap
+
+## Development
+
+Create a symlink to the tower wiki:
+
+```
+cd towerjs.org
+ln -s /Users/viatropos/Documents/git/modules/tower/wiki
+```
View
@@ -12,6 +12,22 @@ module.exports = (grunt) ->
# @todo grunt.loadNpmTasks('tower-tasks')
require(require('path').join(Tower.srcRoot, 'lib/tower-tasks/tasks'))(grunt)
+ grunt.registerMultiTask 'wiki', 'Compile wiki for towerjs.org', ->
+ markdown = require('github-flavored-markdown')
+
+ wikiRoot = Tower.join(Tower.srcRoot, 'wiki')
+ docs = file.expand(Tower.join(wikiRoot, 'en/docs/**/*.md'))
+ guides = file.expand(Tower.join(wikiRoot, 'en/guides/**/*.md'))
+ cheatSheets = file.expand(Tower.join(wikiRoot, 'en/cheat-sheets/**/*.md'))
+
+ renderMarkdown = (doc) ->
+ filePath = Tower.join(Tower.root, 'public/docs', Tower.basename(doc, '.md') + '.html')
+ Tower.writeFileSync(filePath, markdown.parse(Tower.readFileSync(doc, 'utf-8')))
+
+ docs.forEach(renderMarkdown)
+ guides.forEach(renderMarkdown)
+ cheatSheets.forEach(renderMarkdown)
+
# script files
scriptPaths = file.expand([
'app/!(templates)/**/*.coffee'
@@ -48,14 +64,23 @@ module.exports = (grunt) ->
files: ['app/stylesheets/client/application.styl']
tasks: ['stylus']
copy:
- js:
+ javascripts:
src: ['vendor/**/*.js']
dest: 'public/javascripts'
- css:
+ stylesheets:
src: ['vendor/**/*.css']
dest: 'public/stylesheets'
+ images:
+ src: ['vendor/**/*.{png,gif,jpg}']
+ dest: 'public/images'
+ api:
+ src: [Tower.join(Tower.srcRoot, 'doc/**/*')]
+ strip: "#{Tower.srcRoot}/doc#{Tower.pathSeparator}"
+ dest: 'public/api'
+ wiki:
+ compile: {}
templates:
- all: {}
+ compile: {}
stylus:
compile:
options:
@@ -87,5 +112,6 @@ module.exports = (grunt) ->
grunt.initConfig(config)
- grunt.registerTask 'default', 'copy:js copy:css coffee:all less stylus templates'
+ grunt.registerTask 'copy:assets', 'copy:api copy:stylesheets copy:javascripts copy:images'
+ grunt.registerTask 'default', 'copy:assets wiki coffee:all less stylus templates'
grunt.registerTask 'start', 'default watch'
View
@@ -1,27 +0,0 @@
-require 'rubygems'
-require 'redcarpet'
-require 'json'
-require 'albino'
-
-# create a custom renderer that allows highlighting of code blocks
-class HTMLwithAlbino < Redcarpet::Render::HTML
- def block_code(code, language)
- Albino.colorize(code, language)
- end
-end
-
-STDOUT.sync = true
-io = STDOUT
-json = STDIN.read
-json = JSON.parse(json)
-input = json.delete("input")
-markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML,#HTMLwithAlbino,
- :autolink => true,
- :space_after_headers => true,
- :fenced_code_blocks => true,
- :hard_wrap => true,
- :gh_blockcode => true,
- :filter_html => false,
- :safe_links_only => true
-)
-io.write markdown.render(input)
View
@@ -10,13 +10,13 @@
"keywords": [
"node"
],
- "maintainers": [{
- "name": "Lance Pollard",
- "email": "lancejpollard@gmail.com"
- }],
- "contributors": [
-
+ "maintainers": [
+ {
+ "name": "Lance Pollard",
+ "email": "lancejpollard@gmail.com"
+ }
],
+ "contributors": [],
"licenses": [
{
"type": "MIT",
@@ -42,7 +42,8 @@
"socket.io": ">= 0.8.7",
"socket.io-client": ">= 0.9.5",
"tower": ">= 0.4.2",
- "which": ">= 1.0.5"
+ "which": ">= 1.0.5",
+ "github-flavored-markdown": "~1.0.1"
},
"optionalDependencies": {
"nodemailer": ">= 0.3.28",
Oops, something went wrong.

0 comments on commit 23b2ab0

Please sign in to comment.