aboutsummaryrefslogtreecommitdiffstats
path: root/docs/src/ngdoc.js
diff options
context:
space:
mode:
authorMisko Hevery2011-03-10 13:39:59 -0800
committerMisko Hevery2011-03-11 14:16:52 -0800
commit5b05c0de036f77db0cc493082e21b1451c6b9a5f (patch)
treefe614b0758d339600477ac459bdd532711725f48 /docs/src/ngdoc.js
parentd19c0ac6d32319200f0d94df9b07f63a39aecf70 (diff)
downloadangular.js-5b05c0de036f77db0cc493082e21b1451c6b9a5f.tar.bz2
@require in ngdoc now takes reason for dependency
Diffstat (limited to 'docs/src/ngdoc.js')
-rw-r--r--docs/src/ngdoc.js30
1 files changed, 15 insertions, 15 deletions
diff --git a/docs/src/ngdoc.js b/docs/src/ngdoc.js
index 2f59f044..875b24df 100644
--- a/docs/src/ngdoc.js
+++ b/docs/src/ngdoc.js
@@ -157,7 +157,11 @@ Doc.prototype = {
description: self.markdown(text.replace(match[0], match[2]))
};
} else if(atName == 'requires') {
- self.requires.push(text);
+ var match = text.match(/^([^\s]*)\s*([\S\s]*)/);
+ self.requires.push({
+ name: match[1],
+ text: self.markdown(match[2])
+ });
} else if(atName == 'property') {
var match = text.match(/^{(\S+)}\s+(\S+)(\s+(.*))?/);
if (!match) {
@@ -185,6 +189,16 @@ Doc.prototype = {
'This page is currently being revised. It might be incomplete or contain inaccuracies.');
notice('deprecated', 'Deprecated API', self.deprecated);
+ if (self.ngdoc != 'overview') {
+ dom.h('Description', self.description, dom.html);
+ }
+ dom.h('Dependencies', self.requires, function(require){
+ dom.tag('code', function(){
+ dom.tag('a', {href:"#!angular.service." + require.name}, require.name);
+ });
+ dom.html(require.text);
+ });
+
(self['html_usage_' + self.ngdoc] || function(){
throw new Error("Don't know how to format @ngdoc: " + self.ngdoc);
}).call(self, dom);
@@ -251,8 +265,6 @@ Doc.prototype = {
html_usage_function: function(dom){
var self = this;
- dom.h('Description', self.description, dom.html);
- dom.h('Dependencies', self.requires);
dom.h('Usage', function(){
dom.code(function(){
dom.text(self.name);
@@ -269,8 +281,6 @@ Doc.prototype = {
html_usage_directive: function(dom){
var self = this;
- dom.h('Description', self.description, dom.html);
- dom.h('Dependencies', self.requires);
dom.h('Usage', function(){
dom.tag('pre', {'class':"brush: js; html-script: true;"}, function(){
dom.text('<' + self.element + ' ');
@@ -287,8 +297,6 @@ Doc.prototype = {
html_usage_filter: function(dom){
var self = this;
- dom.h('Description', self.description, dom.html);
- dom.h('Dependencies', self.requires);
dom.h('Usage', function(){
dom.h('In HTML Template Binding', function(){
dom.tag('code', function(){
@@ -319,8 +327,6 @@ Doc.prototype = {
html_usage_formatter: function(dom){
var self = this;
- dom.h('Description', self.description, dom.html);
- dom.h('Dependencies', self.requires);
dom.h('Usage', function(){
dom.h('In HTML Template Binding', function(){
dom.code(function(){
@@ -359,8 +365,6 @@ Doc.prototype = {
html_usage_validator: function(dom){
var self = this;
- dom.h('Description', self.description, dom.html);
- dom.h('Dependencies', self.requires);
dom.h('Usage', function(){
dom.h('In HTML Template Binding', function(){
dom.code(function(){
@@ -389,8 +393,6 @@ Doc.prototype = {
html_usage_widget: function(dom){
var self = this;
- dom.h('Description', self.description, dom.html);
- dom.h('Dependencies', self.requires);
dom.h('Usage', function(){
dom.h('In HTML Template Binding', function(){
dom.code(function(){
@@ -435,8 +437,6 @@ Doc.prototype = {
html_usage_service: function(dom){
var self = this;
- dom.h('Description', this.description, dom.html);
- dom.h('Dependencies', this.requires);
if (this.param.length) {
dom.h('Usage', function(){