-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
72 additions
and
2 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,3 +1,4 @@ | ||
_site/ | ||
spm_modules/ | ||
.DS_Store | ||
node_modules/ |
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,35 @@ | ||
#!/usr/bin/env node | ||
|
||
var commander = require('commander'); | ||
var markline = require("../index"); | ||
|
||
commander | ||
.version(require('../package').version) | ||
.usage('[options]') | ||
.option('-v, --version', 'output the version number') | ||
.option('build', 'build markdown to markline page.') | ||
.option('server', 'build markdown to markline page.') | ||
.parse(process.argv); | ||
|
||
|
||
var cwd = process.cwd(); | ||
var options = { | ||
src: commander.source || cwd, | ||
dist: commander.dist || cwd + "/dist" | ||
}; | ||
|
||
if (commander.build) { | ||
markline.build(options); | ||
process.exit(); | ||
} else if (commander.server){ | ||
markline.server(options); | ||
process.exit(); | ||
} | ||
|
||
// output help and exit if no args found | ||
if (commander.args.length === 0) { | ||
commander.help(); | ||
} | ||
|
||
|
||
// vim:ft=javascript |
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,24 @@ | ||
|
||
function build(options){ | ||
console.log(options.src) | ||
console.log(options.dist) | ||
} | ||
|
||
function server(options){ | ||
var http = require('http'); | ||
var app = http.createServer(function (req, res) { | ||
res.writeHead(200, {'Content-Type': 'text/plain'}); | ||
res.end('Hello World\n'); | ||
}); | ||
app.listen(8080); | ||
console.log("Server Started 127.0.0.1:8080") | ||
} | ||
|
||
function watch(){ | ||
} | ||
|
||
module.exports = { | ||
build: build, | ||
server: server, | ||
watch: watch | ||
} |
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