forked from angular/angular.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added documentation for ng:include and ng:widget and test for doc col…
…lector.
- Loading branch information
Showing
12 changed files
with
374 additions
and
31 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
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
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 +1,6 @@ | ||
{{{description}}} | ||
<h1><tt>{{name}}</tt></h1> | ||
{{{description}}} | ||
|
||
<WIKI:SOURCE style="display:block;"> | ||
{{{example}}} | ||
</WIKI:SOURCE> |
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,47 @@ | ||
console.log(__dirname); | ||
require.paths.push(__dirname + "/../"); | ||
require.paths.push(__dirname + "/../../"); | ||
var fs = require('fs'); | ||
var Script = process.binding('evals').Script; | ||
var collect = load('docs/collect.js'); | ||
|
||
describe('collect', function(){ | ||
describe('TAG', function(){ | ||
var TAG = collect.TAG; | ||
describe('@param', function(){ | ||
var doc; | ||
beforeEach(function(){ | ||
doc = {}; | ||
}); | ||
it('should parse with no default', function(){ | ||
TAG.param(doc, 'param', | ||
'{(number|string)} number Number to format.'); | ||
expect(doc.param).toEqual([{ | ||
type : '(number|string)', | ||
name : 'number', | ||
'default' : undefined, | ||
description : 'Number to format.' }]); | ||
}); | ||
it('should parse with default', function(){ | ||
TAG.param(doc, 'param', | ||
'{(number|string)=} [fractionSize=2] desc'); | ||
expect(doc.param).toEqual([{ | ||
type : '(number|string)', | ||
name : 'fractionSize', | ||
'default' : '2', | ||
description : 'desc' }]); | ||
}); | ||
}); | ||
}); | ||
}); | ||
|
||
function load(path){ | ||
var sandbox = { | ||
require: require, | ||
console: console, | ||
__dirname: __dirname, | ||
testmode: true | ||
}; | ||
Script.runInNewContext(fs.readFileSync(path), sandbox, path); | ||
return sandbox; | ||
} |
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,21 @@ | ||
require.paths.push("./lib"); | ||
var jasmine = require('jasmine-1.0.1'); | ||
var sys = require('sys'); | ||
|
||
for(var key in jasmine) { | ||
global[key] = jasmine[key]; | ||
} | ||
|
||
var isVerbose = false; | ||
var showColors = true; | ||
process.argv.forEach(function(arg){ | ||
switch(arg) { | ||
case '--color': showColors = true; break; | ||
case '--noColor': showColors = false; break; | ||
case '--verbose': isVerbose = true; break; | ||
} | ||
}); | ||
|
||
jasmine.executeSpecsInFolder(__dirname + '/spec', function(runner, log){ | ||
process.exit(runner.results().failedCount); | ||
}, isVerbose, showColors); |
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,28 @@ | ||
<h1><tt>{{name}}</tt></h1> | ||
<h2>Usage</h2> | ||
<h3>In HTML Template Binding</h3> | ||
<tt> | ||
<pre> | ||
<{{shortName}}{{#param}} {{#default}}<i>[</i>{{/default}}{{name}}="..."{{#default}}<i>]</i>{{/default}}{{/param}}>{{#usageContent}} | ||
|
||
{{usageContent}} | ||
{{/usageContent}}</{{shortName}}> | ||
</pre> | ||
</tt> | ||
|
||
<h3>Parameters</h3> | ||
<ul> | ||
{{#param}} | ||
<li><tt>{{name}}:{{#type}}{{type}}{{/type}}{{^type}}:*{{/type}}{{#default}}={{default}}{{/default}}</tt>: {{{description}}}</li> | ||
{{/param}} | ||
</ul> | ||
|
||
<h3>CSS</h3> | ||
{{{css}}} | ||
|
||
<h2>Description</h2> | ||
{{{description}}} | ||
|
||
<WIKI:SOURCE style="display:block;"> | ||
{{{example}}} | ||
</WIKI:SOURCE> |
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,3 @@ | ||
#!/bin/sh | ||
|
||
/usr/local/bin/node docs/collect.js | ||
/usr/local/bin/node docs/specs.js --noColor && /usr/local/bin/node docs/collect.js |
Oops, something went wrong.