From cd3abea318e334281c399d4b4f7bc49e34905f9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Wrzeszcz?= Date: Wed, 4 Jan 2012 11:50:33 +0100 Subject: [PATCH] Dropped print() calls in template in favor of templating engine. --- templates/default/tmpl/container.tmpl | 183 ++++++++----------------- templates/default/tmpl/details.tmpl | 45 +++--- templates/default/tmpl/exceptions.tmpl | 17 +-- templates/default/tmpl/members.tmpl | 10 +- templates/default/tmpl/method.tmpl | 63 ++++----- templates/default/tmpl/params.tmpl | 37 +++-- templates/default/tmpl/properties.tmpl | 36 +++-- templates/default/tmpl/returns.tmpl | 9 +- templates/default/tmpl/tutorial.tmpl | 7 +- 9 files changed, 149 insertions(+), 258 deletions(-) diff --git a/templates/default/tmpl/container.tmpl b/templates/default/tmpl/container.tmpl index 913f08bb..e113e69d 100644 --- a/templates/default/tmpl/container.tmpl +++ b/templates/default/tmpl/container.tmpl @@ -6,199 +6,130 @@
-

'); - print( doc.ancestors.join('') ); - print('' + doc.name); - } - else { - print(doc.name) - } - - if (doc.variation) { - print(''+doc.variation+''); - } - - ?>

- '+doc.classdesc+'

'); - } - ?> +

+ + + + + +

+ +

+
- + + - if (doc.kind === 'class') { - print(self.partial('method.tmpl', doc)); - } - else { - if (doc.description) { - print('

' + doc.description + '

'); - } + + + + +

+ - print(self.partial('details.tmpl', doc)); + - if (doc.examples && doc.examples.length) { - print('

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

'); - print( self.partial('examples.tmpl', doc.examples) ); - } - } - ?> + +

Example 1? 's':'' ?>

+ + +
- +

Extends

-
    +
    • -
    - +
+ - +

Mixes In

-
    +
    • -
    - +
+ - +

Requires

-
    +
    • -
    - +
+ -

Classes

-
+
-
-
- +
+
-

Namespaces

-
+
-
-
- +
+
-

Members

-
- +
+ +
-

Methods

-
- +
+ +
-

TypeDefs

-
+
+ +
-

Events

-
+
+ +
diff --git a/templates/default/tmpl/details.tmpl b/templates/default/tmpl/details.tmpl index 7eca7aac..4e8b4be6 100644 --- a/templates/default/tmpl/details.tmpl +++ b/templates/default/tmpl/details.tmpl @@ -7,9 +7,7 @@
Properties:
-
+
@@ -24,21 +22,18 @@ -
Deprecated
  • Yes
'); - else print(':
  • '+data.deprecated+'
    '); +
    Deprecated:
    • Yes
      - - +
      Author:
      -
        '+a+''); - }); - ?>
      +
        +
      • +
      @@ -65,33 +60,27 @@
      Tutorials:
      -
        '+self.tutoriallink(t)+''); - }); - ?>
      +
        +
      • +
      See:
      -
        '+self.linkto(s)+''); - }); - ?>
      +
        +
      • +
      To Do:
      -
        '+t+''); - }); - ?>
      +
        +
      • +
      diff --git a/templates/default/tmpl/exceptions.tmpl b/templates/default/tmpl/exceptions.tmpl index a6e23e7d..ea02ff56 100644 --- a/templates/default/tmpl/exceptions.tmpl +++ b/templates/default/tmpl/exceptions.tmpl @@ -4,9 +4,7 @@ - +
      Type @@ -15,14 +13,9 @@ - - + typeNames.forEach(function(name, i) { ?> + | +
      - \ No newline at end of file + \ No newline at end of file diff --git a/templates/default/tmpl/members.tmpl b/templates/default/tmpl/members.tmpl index 1197405a..fea8f128 100644 --- a/templates/default/tmpl/members.tmpl +++ b/templates/default/tmpl/members.tmpl @@ -15,10 +15,8 @@ - Example' + (examples.length > 1? 's':'') + ''); - print( this.partial('examples.tmpl', examples) ); - } - ?> + +
      Example 1? 's':'' ?>
      + + diff --git a/templates/default/tmpl/method.tmpl b/templates/default/tmpl/method.tmpl index 58542d7b..0fff976b 100644 --- a/templates/default/tmpl/method.tmpl +++ b/templates/default/tmpl/method.tmpl @@ -14,60 +14,51 @@

      - This:'); - print( '' ); - } - ?> + +
      This:
      + + - Parameters:'); - print( this.partial('params.tmpl', params) ); - } - ?> + +
      Parameters:
      + +
      Fires:
      - +
      Throws:
      1) { ?> + +
      Returns:
      1) { ?> + + - Example' + (examples.length > 1? 's':'') + ''); - print( this.partial('examples.tmpl', examples) ); - } - ?> - + +
      Example 1? 's':'' ?>
      + + diff --git a/templates/default/tmpl/params.tmpl b/templates/default/tmpl/params.tmpl index 96989dec..190a53c2 100644 --- a/templates/default/tmpl/params.tmpl +++ b/templates/default/tmpl/params.tmpl @@ -74,41 +74,38 @@ + + | + -
      ' ); - } + + <optional>
      + - if (param.nullable) { - print( '<nullable>
      ' ); - } - ?> + + <nullable>
      + - + + + - Properties' + selfpartial('params.tmpl', param.subparams) ); - }?> + +
      Properties
      + + diff --git a/templates/default/tmpl/properties.tmpl b/templates/default/tmpl/properties.tmpl index 291fd15c..9ec1a997 100644 --- a/templates/default/tmpl/properties.tmpl +++ b/templates/default/tmpl/properties.tmpl @@ -74,41 +74,37 @@ + + | + -
      ' ); - } + + <optional>
      + - if (prop.nullable) { - print( '<nullable>
      ' ); - } - ?> + + <nullable>
      + - + + + - Properties' + self.partial('properties.tmpl', prop.subprops) ); - }?> + +
      Properties
      + diff --git a/templates/default/tmpl/returns.tmpl b/templates/default/tmpl/returns.tmpl index d45de853..257550f9 100644 --- a/templates/default/tmpl/returns.tmpl +++ b/templates/default/tmpl/returns.tmpl @@ -16,12 +16,9 @@
      - - + names.forEach(function(name, i) { ?> + | +
      0) { ?> + children.forEach(function(t) { ?> +
    • +