From 7ae6d436adfa01dafbb9cd871fbcb226655675f7 Mon Sep 17 00:00:00 2001 From: Michael Mathews Date: Sat, 26 Feb 2011 12:01:06 +0000 Subject: [PATCH] Better handling of multiple variations with the same name. --- modules/jsdoc/tag/dictionary/definitions.js | 7 +++++ templates/default/publish.js | 2 +- .../default/static/styles/jsdoc-default.css | 11 ++++++-- templates/default/tmpl/container.tmpl | 21 ++++++-------- templates/default/tmpl/details.tmpl | 13 +++++---- templates/default/tmpl/method.tmpl | 24 +--------------- templates/default/tmpl/properties.tmpl | 28 +------------------ 7 files changed, 34 insertions(+), 72 deletions(-) diff --git a/modules/jsdoc/tag/dictionary/definitions.js b/modules/jsdoc/tag/dictionary/definitions.js index 3b1cce8f..31bce9e0 100644 --- a/modules/jsdoc/tag/dictionary/definitions.js +++ b/modules/jsdoc/tag/dictionary/definitions.js @@ -446,6 +446,13 @@ } }); + dictionary.defineTag('variation', { + mustHaveValue: true, + onTagged: function(doclet, tag) { + doclet.variation = tag.value; + } + }); + dictionary.defineTag('version', { mustHaveValue: true, onTagged: function(doclet, tag) { diff --git a/templates/default/publish.js b/templates/default/publish.js index 1d0eeefd..2e7c5b76 100644 --- a/templates/default/publish.js +++ b/templates/default/publish.js @@ -154,7 +154,7 @@ function linkto(longname, linktext) { var url = longnameToUrl[longname]; - return url? ''+linktext+'' : (linktext || longname); + return url? ''+(linktext || longname)+'' : (linktext || longname); } var urlToLongname = {}, diff --git a/templates/default/static/styles/jsdoc-default.css b/templates/default/static/styles/jsdoc-default.css index 7d038761..f9b58d0c 100644 --- a/templates/default/static/styles/jsdoc-default.css +++ b/templates/default/static/styles/jsdoc-default.css @@ -41,10 +41,14 @@ section background-color: #fff; padding: 12px 24px; - + border-bottom: 1px solid #ccc; margin-right: 240px; } +sup { + color: #aaa; +} + nav { display: block; @@ -92,6 +96,7 @@ footer { padding: 6px; margin-top: 12px; font-style: italic; + font-size: 11px; } h1 @@ -151,8 +156,8 @@ h6 color: #950B02; } -.ancestor-name { - color: #ccc; +.yes-def { + text-indent: -1000px; } .type-signature { diff --git a/templates/default/tmpl/container.tmpl b/templates/default/tmpl/container.tmpl index c73465e9..04c00f36 100644 --- a/templates/default/tmpl/container.tmpl +++ b/templates/default/tmpl/container.tmpl @@ -26,15 +26,14 @@
'+doc.name+''+doc.variation+''); + } + if (doc.classdesc) { print('

'+doc.classdesc+'

'); } ?> - -
@@ -42,12 +41,13 @@ if (doc.kind === 'class') { print(render('method.tmpl', doc)); } - else { if (doc.description) { print('

' + doc.description + '

'); } + print(render('details.tmpl', doc)); + if (doc.examples && doc.examples.length) { print('

Example' + (doc.examples.length > 1? 's':'') + '

'); print( render('examples.tmpl', doc.examples) ); @@ -71,11 +71,6 @@ } ?> -

Details

- - @@ -192,8 +187,8 @@ print(render('method.tmpl', e)); }); ?> -
+ @@ -203,7 +198,7 @@
diff --git a/templates/default/tmpl/details.tmpl b/templates/default/tmpl/details.tmpl index 585097ce..ed2dff3a 100644 --- a/templates/default/tmpl/details.tmpl +++ b/templates/default/tmpl/details.tmpl @@ -9,10 +9,13 @@
- -
Deprecated:
-
Yes
- + +
Deprecated
Yes
'); + else print(':
'+this.deprecated+'
'); + ?> + +
Author:
@@ -37,7 +40,7 @@
diff --git a/templates/default/tmpl/method.tmpl b/templates/default/tmpl/method.tmpl index 2086f4ec..a3294bc5 100644 --- a/templates/default/tmpl/method.tmpl +++ b/templates/default/tmpl/method.tmpl @@ -14,29 +14,7 @@

- -
- -
Version
-
- - - -
Deprecated
- Yes'); - else print('
'+this.deprecated+'
'); - ?> - - - - -
Since
-
- -
- - + - -
- -
Version
-
- - - -
Deprecated
- Yes'); - else print('
'+this.deprecated+'
'); - ?> - - - - -
Since
-
- - - -
Default Value
-
- -
- +