grunt-ngdocs
Advanced tools
Comparing version 0.2.1 to 0.2.2
@@ -0,1 +1,18 @@ | ||
# 0.2.2 (2014-04-29) | ||
## Features | ||
### docs | ||
* make the app load deferrable ([8b714eb9](https://github.com/m7r/grunt-ngdocs/commit/8b714eb9)) | ||
### ngdocs | ||
* Support for documenting controllers and capitalized services, prettyprint custom usage examples ([24a26807](https://github.com/m7r/grunt-ngdocs/commit/24a26807)) | ||
## Bug fixes | ||
##docs | ||
* proper header img styling in ie8 ([9c8ca7b3](https://github.com/m7r/grunt-ngdocs/commit/9c8ca7b3)) | ||
# 0.2.1 (2014-01-13) | ||
@@ -2,0 +19,0 @@ |
{ | ||
"name": "grunt-ngdocs", | ||
"version": "0.2.1", | ||
"version": "0.2.2", | ||
"description": "grunt plugin for angularjs documentation", | ||
@@ -5,0 +5,0 @@ "main": "tasks", |
@@ -70,7 +70,7 @@ #grunt-ngdocs | ||
####dest | ||
[default] 'docs' | ||
Folder relative to your Gruntfile where the documentation should be build. | ||
[default] 'docs' | ||
Folder relative to your Gruntfile where the documentation should be built. | ||
####scripts | ||
[default] ['angular.js'] | ||
[default] ['angular.js'] | ||
Set which angular.js file or addional custom js files are loaded to the app. This allows the live examples to use custom directives, services, etc. The documentation app works with angular.js 1.0.+ and 1.1.+. | ||
@@ -85,4 +85,9 @@ | ||
####deferLoad | ||
[default] 'false' | ||
If you want to use requirejs as loader set this to `true`. | ||
Include 'js/angular-bootstrap.js', 'js/angular-bootstrap-prettify.js', 'js/docs-setup.js', 'js/docs.js' with requirejs and finally bootstrap the app `angular.bootstrap(document, ['docsApp']);`. | ||
####styles | ||
[default] [] | ||
[default] [] | ||
Copy additional css files to the documentation app | ||
@@ -94,6 +99,6 @@ | ||
####discussions | ||
Optional include [discussions](http://http://disqus.com) in the documentation app. | ||
Optional include [discussions](http://disqus.com) in the documentation app. | ||
####title | ||
[default] "name" or "title" field in `pkg` | ||
[default] "name" or "title" field in `pkg` | ||
Title to put on the navbar and the page's `title` attribute. By default, tries to | ||
@@ -104,7 +109,7 @@ find the title in the `pkg`. If it can't find it, it will go to an empty string. | ||
[default] '/api' | ||
Set first page to open. | ||
Set first page to open. | ||
####html5Mode | ||
[default] 'true' | ||
Whether or not to enable `html5Mode` in the docs application. If true, then links will be absolute. If false, they will be prefixed by `#/`. | ||
[default] 'true' | ||
Whether or not to enable `html5Mode` in the docs application. If true, then links will be absolute. If false, they will be prefixed by `#/`. | ||
@@ -128,4 +133,4 @@ ####image | ||
####navTemplate | ||
[default] null | ||
Path to a template of a nav HTML template to include. The css for it | ||
[default] null | ||
Path to a template of a nav HTML template to include. The css for it | ||
should be that of listitems inside a bootstrap navbar: | ||
@@ -153,7 +158,7 @@ ```html | ||
####title | ||
[default] 'API Documentation' | ||
[default] 'API Documentation' | ||
Set the name for the section in the documentation app. | ||
####api | ||
[default] true for target api | ||
[default] true for target api | ||
Set the sidebar to advanced mode, with sections for modules, services, etc. | ||
@@ -188,3 +193,3 @@ | ||
<file name="index.html"> | ||
<textarea ng-model="text" r-autogrow class="input-block-level"></textarea> | ||
<textarea ng-model="text"rx-autogrow class="input-block-level"></textarea> | ||
<pre>{{text}}</pre> | ||
@@ -191,0 +196,0 @@ </file> |
@@ -109,2 +109,9 @@ var ngdoc = require('../src/ngdoc.js'); | ||
it('should correctly parse capitalized service names', function(){ | ||
var doc = new Doc('@ngdoc service\n@name my.module.Service'); | ||
doc.parse(); | ||
expect(ngdoc.metadata([doc])[0].shortName).toEqual('my.module.Service'); | ||
expect(ngdoc.metadata([doc])[0].moduleName).toEqual('my.module'); | ||
}); | ||
describe('convertUrlToAbsolute', function() { | ||
@@ -111,0 +118,0 @@ var doc; |
@@ -675,6 +675,4 @@ /** | ||
if (self.usage) { | ||
dom.tag('pre', function() { | ||
dom.tag('code', function() { | ||
dom.text(self.usage); | ||
}); | ||
dom.code(function() { | ||
dom.text(self.usage); | ||
}); | ||
@@ -851,2 +849,6 @@ } else { | ||
html_usage_controller: function(dom) { | ||
this.html_usage_interface(dom) | ||
}, | ||
method_properties_events: function(dom) { | ||
@@ -934,4 +936,5 @@ var self = this; | ||
MODULE_MOCK = /^angular\.mock\.([^\.]+)$/, | ||
MODULE_DIRECTIVE = /^(.+)\.directive:([^\.]+)$/, | ||
MODULE_DIRECTIVE_INPUT = /^(.+)\.directive:input\.([^\.]+)$/, | ||
MODULE_CONTROLLER = /^(.+)\.controllers?:([^\.]+)$/, | ||
MODULE_DIRECTIVE = /^(.+)\.directives?:([^\.]+)$/, | ||
MODULE_DIRECTIVE_INPUT = /^(.+)\.directives?:input\.([^\.]+)$/, | ||
MODULE_CUSTOM = /^(.+)\.([^\.]+):([^\.]+)$/, | ||
@@ -983,2 +986,4 @@ MODULE_SERVICE = /^(.+)\.([^\.]+?)(Provider)?$/, | ||
return makeTitle('angular.mock.' + match[1], 'API', 'module', 'ng'); | ||
} else if (match = text.match(MODULE_CONTROLLER) && doc.type === 'controller') { | ||
return makeTitle(match[2], 'controller', 'module', match[1]); | ||
} else if (match = text.match(MODULE_DIRECTIVE)) { | ||
@@ -989,4 +994,4 @@ return makeTitle(match[2], 'directive', 'module', match[1]); | ||
} else if (match = text.match(MODULE_CUSTOM)) { | ||
return makeTitle(match[3], match[2], 'module', match[1]); | ||
} else if (match = text.match(MODULE_TYPE)) { | ||
return makeTitle(match[3], doc.ngdoc || match[2], 'module', match[1]); | ||
} else if (match = text.match(MODULE_TYPE) && doc.ngdoc === 'type') { | ||
return makeTitle(match[2], 'type', 'module', module || match[1]); | ||
@@ -993,0 +998,0 @@ } else if (match = text.match(MODULE_SERVICE)) { |
@@ -285,5 +285,6 @@ var docsApp = { | ||
MODULE_MOCK = /^angular\.mock\.([^\.]+)$/, | ||
MODULE_DIRECTIVE = /^(.+)\.directive:([^\.]+)$/, | ||
MODULE_DIRECTIVE_INPUT = /^(.+)\.directive:input\.([^\.]+)$/, | ||
MODULE_FILTER = /^(.+)\.filter:([^\.]+)$/, | ||
MODULE_CONTROLLER = /^(.+)\.controllers?:([^\.]+)$/, | ||
MODULE_DIRECTIVE = /^(.+)\.directives?:([^\.]+)$/, | ||
MODULE_DIRECTIVE_INPUT = /^(.+)\.directives?:input\.([^\.]+)$/, | ||
MODULE_FILTER = /^(.+)\.filters?:([^\.]+)$/, | ||
MODULE_CUSTOM = /^(.+)\.([^\.]+):([^\.]+)$/, | ||
@@ -374,2 +375,5 @@ MODULE_SERVICE = /^(.+)\.([^\.]+?)(Provider)?$/, | ||
breadcrumb.push({ name: match[2] }); | ||
} else if (match = partialId.match(MODULE_CONTROLLER)) { | ||
breadcrumb.push({ name: match[1], url: sectionPath + '/' + match[1] }); | ||
breadcrumb.push({ name: match[2] }); | ||
} else if (match = partialId.match(MODULE_DIRECTIVE)) { | ||
@@ -461,2 +465,4 @@ breadcrumb.push({ name: match[1], url: sectionPath + '/' + match[1] }); | ||
module(page.moduleName || match[1], section).filters.push(page); | ||
} else if (match = id.match(MODULE_CONTROLLER) && page.type === 'controller') { | ||
module(page.moduleName || match[1], section).controllers.push(page); | ||
} else if (match = id.match(MODULE_DIRECTIVE)) { | ||
@@ -467,4 +473,15 @@ module(page.moduleName || match[1], section).directives.push(page); | ||
} else if (match = id.match(MODULE_CUSTOM)) { | ||
module(page.moduleName || match[1], section).others.push(page); | ||
} else if (match = id.match(MODULE_TYPE)) { | ||
if (page.type === 'service') { | ||
module(page.moduleName || match[1], section).service(match[3])[page.id.match(/^.+Provider$/) ? 'provider' : 'instance'] = page; | ||
} else { | ||
var m = module(page.moduleName || match[1], section), | ||
listName = page.type + 's'; | ||
if (m[listName]) { | ||
m[listName].push(page); | ||
} else { | ||
m.others.push(page); | ||
} | ||
} | ||
} else if (match = id.match(MODULE_TYPE) && page.type === 'type') { | ||
module(page.moduleName || match[1], section).types.push(page); | ||
@@ -494,2 +511,3 @@ } else if (match = id.match(MODULE_SERVICE)) { | ||
globals: [], | ||
controllers: [], | ||
directives: [], | ||
@@ -496,0 +514,0 @@ services: [], |
@@ -143,2 +143,3 @@ /* | ||
bestMatch: options.bestMatch, | ||
deferLoad: !!options.deferLoad | ||
}; | ||
@@ -145,0 +146,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
856772
13307
206