mirror of
https://github.com/GitbookIO/gitbook.git
synced 2026-09-17 08:05:19 +00:00
Add test/bin/lex.js utility
Helpful binary when developing / debugging
This commit is contained in:
Executable
+16
@@ -0,0 +1,16 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
var fs = require('fs');
|
||||
|
||||
var gitbook = require('../../');
|
||||
|
||||
if(process.argv < 3) {
|
||||
console.error('Please specify a filename');
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
var content = fs.readFileSync(process.argv[2], 'utf8');
|
||||
|
||||
var lexed = gitbook.parse.lex(content);
|
||||
|
||||
console.log(JSON.stringify(lexed, null, 2));
|
||||
Reference in New Issue
Block a user