mirror of
https://github.com/marko-js/marko.git
synced 2025-12-08 19:26:05 +00:00
Better docs for rhtmlc
This commit is contained in:
parent
4ff4b0b506
commit
942550eaf3
@ -1,26 +1,46 @@
|
||||
var raptorTemplatesCompiler = require('../compiler');
|
||||
var glob = require("glob");
|
||||
var optimist = require('optimist');
|
||||
var fs = require('fs');
|
||||
var globPatterns;
|
||||
var raptorPromises = require('raptor-promises');
|
||||
|
||||
var argv = optimist
|
||||
.alias('n', 'name')
|
||||
.describe('n', 'The name of the page being optimized (e.g. "my-page")')
|
||||
.usage('Usage: $0 <pattern> [options]\nExamples:\n' +
|
||||
' Compile a single template:\n' +
|
||||
' $0 rhtml template.rhtml\n\n' +
|
||||
' Compile all templates in the directory tree:\n' +
|
||||
' $0 rhtml **/*.rhtml')
|
||||
.check(function(argv) {
|
||||
if (!argv._) {
|
||||
throw '';
|
||||
var argv = require('raptor-args').createParser({
|
||||
'--help': {
|
||||
type: 'boolean',
|
||||
description: 'Show this help message'
|
||||
},
|
||||
'--templates --template -t *': {
|
||||
type: 'string[]',
|
||||
description: 'The path to a template to compile'
|
||||
}
|
||||
})
|
||||
.argv;
|
||||
.usage('Usage: $0 <pattern> [options]')
|
||||
.example('Compile a single template', '$0 rhtml template.rhtml')
|
||||
.example('Compile all templates in the directory tree', '$0 rhtml **/*.rhtml')
|
||||
.validate(function(result) {
|
||||
if (result.help) {
|
||||
this.printUsage();
|
||||
process.exit(0);
|
||||
}
|
||||
|
||||
globPatterns = argv._;
|
||||
if (!result.templates || result.templates.length === 0) {
|
||||
this.printUsage();
|
||||
process.exit(1);
|
||||
}
|
||||
})
|
||||
.onError(function(err) {
|
||||
this.printUsage();
|
||||
|
||||
if (err) {
|
||||
console.log();
|
||||
console.log(err);
|
||||
}
|
||||
|
||||
process.exit(1);
|
||||
})
|
||||
.parse();
|
||||
|
||||
globPatterns = argv.templates;
|
||||
var found = {};
|
||||
var promises = [];
|
||||
|
||||
|
||||
108
package.json
108
package.json
@ -1,54 +1,56 @@
|
||||
{
|
||||
"name": "raptor-templates",
|
||||
"description": "Raptor Templates",
|
||||
"keywords": [
|
||||
"templating",
|
||||
"template",
|
||||
"async",
|
||||
"streaming"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/raptorjs3/raptor-templates.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "node_modules/.bin/mocha --ui bdd --reporter spec ./test"
|
||||
},
|
||||
"author": "Patrick Steele-Idem <pnidem@gmail.com>",
|
||||
"maintainers": [
|
||||
"Patrick Steele-Idem <pnidem@gmail.com>"
|
||||
],
|
||||
"dependencies": {
|
||||
"raptor-detect": "^0.2.0-beta",
|
||||
"raptor-logging": "^0.2.0-beta",
|
||||
"raptor-strings": "^0.2.0-beta",
|
||||
"raptor-regexp": "^0.2.0-beta",
|
||||
"raptor-util": "^0.2.0-beta",
|
||||
"raptor-arrays": "^0.2.0-beta",
|
||||
"raptor-json": "^0.2.0-beta",
|
||||
"raptor-modules": "^0.2.0-beta",
|
||||
"raptor-render-context": "^0.2.0-beta",
|
||||
"raptor-data-providers": "^0.2.0-beta",
|
||||
"raptor-xml": "^0.2.0-beta",
|
||||
"raptor-objects": "^0.2.0-beta",
|
||||
"raptor-ecma": "^0.2.0-beta",
|
||||
"raptor-files": "^0.2.0-beta",
|
||||
"htmlparser2": "~3.5.1",
|
||||
"char-props": "~0.1.5",
|
||||
"raptor-promises": "^0.2.0-beta"
|
||||
},
|
||||
"devDependencies": {
|
||||
"mocha": "~1.15.1",
|
||||
"chai": "~1.8.1",
|
||||
"raptor-cache": "^0.2.0-beta"
|
||||
},
|
||||
"license": "Apache License v2.0",
|
||||
"bin": {
|
||||
"rhtmlc": "bin/rhtmlc"
|
||||
},
|
||||
"main": "runtime/lib/raptor-templates.js",
|
||||
"publishConfig": {
|
||||
"registry": "https://registry.npmjs.org/"
|
||||
},
|
||||
"version": "0.2.17-beta"
|
||||
}
|
||||
"name": "raptor-templates",
|
||||
"description": "Raptor Templates",
|
||||
"keywords": [
|
||||
"templating",
|
||||
"template",
|
||||
"async",
|
||||
"streaming"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/raptorjs3/raptor-templates.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "node_modules/.bin/mocha --ui bdd --reporter spec ./test"
|
||||
},
|
||||
"author": "Patrick Steele-Idem <pnidem@gmail.com>",
|
||||
"maintainers": [
|
||||
"Patrick Steele-Idem <pnidem@gmail.com>"
|
||||
],
|
||||
"dependencies": {
|
||||
"raptor-detect": "^0.2.0-beta",
|
||||
"raptor-logging": "^0.2.0-beta",
|
||||
"raptor-strings": "^0.2.0-beta",
|
||||
"raptor-regexp": "^0.2.0-beta",
|
||||
"raptor-util": "^0.2.0-beta",
|
||||
"raptor-arrays": "^0.2.0-beta",
|
||||
"raptor-json": "^0.2.0-beta",
|
||||
"raptor-modules": "^0.2.0-beta",
|
||||
"raptor-render-context": "^0.2.0-beta",
|
||||
"raptor-data-providers": "^0.2.0-beta",
|
||||
"raptor-xml": "^0.2.0-beta",
|
||||
"raptor-objects": "^0.2.0-beta",
|
||||
"raptor-ecma": "^0.2.0-beta",
|
||||
"raptor-files": "^0.2.0-beta",
|
||||
"htmlparser2": "~3.5.1",
|
||||
"char-props": "~0.1.5",
|
||||
"raptor-promises": "^0.2.0-beta",
|
||||
"glob": "^3.2.9",
|
||||
"raptor-args": "^0.1.9-beta"
|
||||
},
|
||||
"devDependencies": {
|
||||
"mocha": "~1.15.1",
|
||||
"chai": "~1.8.1",
|
||||
"raptor-cache": "^0.2.0-beta"
|
||||
},
|
||||
"license": "Apache License v2.0",
|
||||
"bin": {
|
||||
"rhtmlc": "bin/rhtmlc"
|
||||
},
|
||||
"main": "runtime/lib/raptor-templates.js",
|
||||
"publishConfig": {
|
||||
"registry": "https://registry.npmjs.org/"
|
||||
},
|
||||
"version": "0.2.17-beta"
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user