From c7052f098d47f60228c5d60ad16fcac8ce2b22c8 Mon Sep 17 00:00:00 2001 From: Igor Minar Date: Mon, 15 Nov 2010 22:51:16 -0800 Subject: add support for @deprecated ng:doc annotation + show warnings in templates --- docs/collect.js | 1 + docs/directive.template | 8 ++++++++ docs/docs.css | 9 +++++++++ docs/filter.template | 8 ++++++++ docs/formatter.template | 8 ++++++++ docs/function.template | 8 ++++++++ docs/overview.template | 8 ++++++++ docs/service.template | 8 ++++++++ docs/spec/collectSpec.js | 22 ++++++++++++++-------- docs/validator.template | 7 +++++++ docs/widget.template | 7 +++++++ 11 files changed, 86 insertions(+), 8 deletions(-) (limited to 'docs') diff --git a/docs/collect.js b/docs/collect.js index 80053d34..4665133d 100644 --- a/docs/collect.js +++ b/docs/collect.js @@ -212,6 +212,7 @@ var TAG = { namespace: valueTag, css: valueTag, see: valueTag, + deprecated: valueTag, usageContent: valueTag, 'function': valueTag, description: markdownTag, diff --git a/docs/directive.template b/docs/directive.template index 84b87ca7..6fdb6e04 100644 --- a/docs/directive.template +++ b/docs/directive.template @@ -1,4 +1,12 @@

{{name}}

+ +{{#deprecated}} +
+ Deprecated API + {{deprecated}} +
+{{/deprecated}} +

Description

{{{description}}} diff --git a/docs/docs.css b/docs/docs.css index 664328d0..766b6832 100644 --- a/docs/docs.css +++ b/docs/docs.css @@ -130,3 +130,12 @@ a { margin-left: 3em; font-family: monospace; } + +.deprecated { + border: 2px solid red; +} + +.deprecated legend { + font-weight: bold; + color: red; +} diff --git a/docs/filter.template b/docs/filter.template index 2731f5a3..c61b4c2b 100644 --- a/docs/filter.template +++ b/docs/filter.template @@ -1,4 +1,12 @@

{{name}}

+ +{{#deprecated}} +
+ Deprecated API + {{deprecated}} +
+{{/deprecated}} +

Description

{{{description}}} diff --git a/docs/formatter.template b/docs/formatter.template index af95f729..2a9fedd0 100644 --- a/docs/formatter.template +++ b/docs/formatter.template @@ -1,4 +1,12 @@

{{name}}

+ +{{#deprecated}} +
+ Deprecated API + {{deprecated}} +
+{{/deprecated}} +

Description

{{{description}}} diff --git a/docs/function.template b/docs/function.template index 8e89cd18..f5660314 100644 --- a/docs/function.template +++ b/docs/function.template @@ -1,4 +1,12 @@

{{name}}

+ +{{#deprecated}} +
+ Deprecated API + {{deprecated}} +
+{{/deprecated}} +

Description

{{{description}}} diff --git a/docs/overview.template b/docs/overview.template index 7af05ff4..5d3972d7 100644 --- a/docs/overview.template +++ b/docs/overview.template @@ -1,4 +1,12 @@

{{name}}

+ +{{#deprecated}} +
+ Deprecated API + {{deprecated}} +
+{{/deprecated}} + {{{description}}} {{#example}} diff --git a/docs/service.template b/docs/service.template index 2774cad2..4328c21e 100644 --- a/docs/service.template +++ b/docs/service.template @@ -1,4 +1,12 @@

{{name}}

+ +{{#deprecated}} +
+ Deprecated API + {{deprecated}} +
+{{/deprecated}} +

Description

{{{description}}} diff --git a/docs/spec/collectSpec.js b/docs/spec/collectSpec.js index 9de08dc8..6f82ec3d 100644 --- a/docs/spec/collectSpec.js +++ b/docs/spec/collectSpec.js @@ -182,21 +182,27 @@ describe('collect', function(){ }); }); - describe('@describe', function(){ + describe('@description', function(){ it('should support pre blocks', function(){ TAG.description(doc, 'description', '
abc
'); expect(doc.description).toEqual('
abc
'); }); - - describe('@example', function(){ - it('should not remove {{}}', function(){ - TAG.example(doc, 'example', 'text {{ abc }}'); - expect(doc.example).toEqual('text {{ abc }}'); - }); - + }); + + describe('@example', function(){ + it('should not remove {{}}', function(){ + TAG.example(doc, 'example', 'text {{ abc }}'); + expect(doc.example).toEqual('text {{ abc }}'); }); }); + describe('@deprecated', function() { + it('should parse @deprecated', function() { + TAG.deprecated(doc, 'deprecated', 'Replaced with foo.'); + expect(doc.deprecated).toBe('Replaced with foo.'); + }) + }); + }); describe('trim', function(){ diff --git a/docs/validator.template b/docs/validator.template index 63d17072..1b8687a3 100644 --- a/docs/validator.template +++ b/docs/validator.template @@ -1,5 +1,12 @@

{{name}}

+{{#deprecated}} +
+ Deprecated API + {{deprecated}} +
+{{/deprecated}} +

Description

{{{description}}} diff --git a/docs/widget.template b/docs/widget.template index 4a20629e..84566d47 100644 --- a/docs/widget.template +++ b/docs/widget.template @@ -1,5 +1,12 @@

{{name}}

+{{#deprecated}} +
+ Deprecated API + {{deprecated}} +
+{{/deprecated}} +

Description

{{{description}}} -- cgit v1.2.3