diff options
| author | Misko Hevery | 2011-04-29 15:18:27 -0700 | 
|---|---|---|
| committer | Igor Minar | 2011-06-06 22:28:38 -0700 | 
| commit | 11e9572b952e49b01035e956c412d6095533031a (patch) | |
| tree | 04dbf96802f552693d44c541c0d825a2769e3d57 /docs | |
| parent | b6bc6c2ddf1ae1523ec7e4cb92db209cd6501181 (diff) | |
| download | angular.js-11e9572b952e49b01035e956c412d6095533031a.tar.bz2 | |
Move documentation under individual headings
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/content/api/angular.attrMarkup.ngdoc (renamed from docs/angular.attrMarkup.ngdoc) | 0 | ||||
| -rw-r--r-- | docs/content/api/angular.directive.ngdoc (renamed from docs/angular.directive.ngdoc) | 0 | ||||
| -rw-r--r-- | docs/content/api/angular.element.ngdoc (renamed from docs/angular.element.ngdoc) | 0 | ||||
| -rw-r--r-- | docs/content/api/angular.filter.ngdoc (renamed from docs/angular.filter.ngdoc) | 0 | ||||
| -rw-r--r-- | docs/content/api/angular.formatter.ngdoc (renamed from docs/angular.formatter.ngdoc) | 0 | ||||
| -rw-r--r-- | docs/content/api/angular.markup.ngdoc (renamed from docs/angular.markup.ngdoc) | 0 | ||||
| -rw-r--r-- | docs/content/api/angular.ngdoc (renamed from docs/angular.ngdoc) | 0 | ||||
| -rw-r--r-- | docs/content/api/angular.service.ngdoc (renamed from docs/angular.service.ngdoc) | 0 | ||||
| -rw-r--r-- | docs/content/api/angular.validator.ngdoc (renamed from docs/angular.validator.ngdoc) | 0 | ||||
| -rw-r--r-- | docs/content/api/angular.widget.ngdoc (renamed from docs/angular.widget.ngdoc) | 0 | ||||
| -rw-r--r-- | docs/content/cookbook/buzz.ngdoc (renamed from docs/cookbook.buzz.ngdoc) | 0 | ||||
| -rw-r--r-- | docs/content/cookbook/deeplinking.ngdoc (renamed from docs/cookbook.deeplinking.ngdoc) | 0 | ||||
| -rw-r--r-- | docs/content/cookbook/form.ngdoc (renamed from docs/cookbook.form.ngdoc) | 0 | ||||
| -rw-r--r-- | docs/content/cookbook/formadvanced.ngdoc (renamed from docs/cookbook.formadvanced.ngdoc) | 0 | ||||
| -rw-r--r-- | docs/content/cookbook/helloworld.ngdoc (renamed from docs/cookbook.helloworld.ngdoc) | 0 | ||||
| -rw-r--r-- | docs/content/cookbook/index.ngdoc (renamed from docs/cookbook.ngdoc) | 0 | ||||
| -rw-r--r-- | docs/content/cookbook/mvc.ngdoc (renamed from docs/cookbook.mvc.ngdoc) | 0 | ||||
| -rw-r--r-- | docs/content/guide/bootstrap.ngdoc (renamed from docs/guide.bootstrap.ngdoc) | 0 | ||||
| -rw-r--r-- | docs/content/guide/data-binding.ngdoc (renamed from docs/guide.data-binding.ngdoc) | 0 | ||||
| -rw-r--r-- | docs/content/guide/expression.ngdoc (renamed from docs/guide.expression.ngdoc) | 0 | ||||
| -rw-r--r-- | docs/content/guide/guide.compiler.ngdoc (renamed from docs/guide.compiler.ngdoc) | 0 | ||||
| -rw-r--r-- | docs/content/guide/guide.css.ngdoc (renamed from docs/guide.css.ngdoc) | 0 | ||||
| -rw-r--r-- | docs/content/guide/guide.di.ngdoc (renamed from docs/guide.di.ngdoc) | 0 | ||||
| -rw-r--r-- | docs/content/guide/index.ngdoc (renamed from docs/guide.ngdoc) | 0 | ||||
| -rw-r--r-- | docs/content/guide/overview.ngdoc (renamed from docs/guide.overview.ngdoc) | 0 | ||||
| -rw-r--r-- | docs/content/guide/template.ngdoc (renamed from docs/guide.template.ngdoc) | 0 | ||||
| -rw-r--r-- | docs/content/guide/testing.ngdoc (renamed from docs/guide.testing.ngdoc) | 0 | ||||
| -rw-r--r-- | docs/content/intro/contribute.ngdoc (renamed from docs/contribute.ngdoc) | 0 | ||||
| -rw-r--r-- | docs/content/intro/downloading.ngdoc (renamed from docs/downloading.ngdoc) | 0 | ||||
| -rw-r--r-- | docs/content/intro/faq.ngdoc (renamed from docs/faq.ngdoc) | 0 | ||||
| -rw-r--r-- | docs/content/intro/started.ngdoc (renamed from docs/started.ngdoc) | 0 | ||||
| -rw-r--r-- | docs/content/intro/testimonials.ngdoc (renamed from docs/testimonials.ngdoc) | 0 | ||||
| -rw-r--r-- | docs/content/tutorial/index.ngdoc (renamed from docs/tutorial.ngdoc) | 0 | ||||
| -rwxr-xr-x | docs/content/tutorial/step_00.ngdoc (renamed from docs/tutorial.step_00.ngdoc) | 3 | ||||
| -rwxr-xr-x | docs/content/tutorial/step_01.ngdoc (renamed from docs/tutorial.step_01.ngdoc) | 22 | ||||
| -rwxr-xr-x | docs/content/tutorial/step_02.ngdoc (renamed from docs/tutorial.step_02.ngdoc) | 18 | ||||
| -rwxr-xr-x | docs/content/tutorial/step_03.ngdoc (renamed from docs/tutorial.step_03.ngdoc) | 14 | ||||
| -rwxr-xr-x | docs/content/tutorial/step_04.ngdoc (renamed from docs/tutorial.step_04.ngdoc) | 10 | ||||
| -rwxr-xr-x | docs/content/tutorial/step_05.ngdoc (renamed from docs/tutorial.step_05.ngdoc) | 12 | ||||
| -rwxr-xr-x | docs/content/tutorial/step_06.ngdoc (renamed from docs/tutorial.step_06.ngdoc) | 24 | ||||
| -rwxr-xr-x | docs/content/tutorial/step_07.ngdoc (renamed from docs/tutorial.step_07.ngdoc) | 16 | ||||
| -rwxr-xr-x | docs/content/tutorial/step_08.ngdoc (renamed from docs/tutorial.step_08.ngdoc) | 26 | ||||
| -rwxr-xr-x | docs/content/tutorial/step_09.ngdoc (renamed from docs/tutorial.step_09.ngdoc) | 20 | ||||
| -rw-r--r-- | docs/content/tutorial/step_10.ngdoc (renamed from docs/tutorial.step_10.ngdoc) | 0 | ||||
| -rw-r--r-- | docs/content/tutorial/step_11.ngdoc (renamed from docs/tutorial.step_11.ngdoc) | 6 | ||||
| -rw-r--r-- | docs/service.template | 57 | ||||
| -rw-r--r-- | docs/src/gen-docs.js | 2 | ||||
| -rw-r--r-- | docs/src/ngdoc.js | 43 | ||||
| -rw-r--r-- | docs/src/reader.js | 23 | ||||
| -rw-r--r-- | docs/src/templates/docs.css | 27 | ||||
| -rw-r--r-- | docs/src/templates/docs.js | 20 | ||||
| -rw-r--r-- | docs/src/templates/index.html | 44 | ||||
| -rw-r--r-- | docs/src/writer.js | 21 | 
53 files changed, 218 insertions, 190 deletions
| diff --git a/docs/angular.attrMarkup.ngdoc b/docs/content/api/angular.attrMarkup.ngdoc index aad20866..aad20866 100644 --- a/docs/angular.attrMarkup.ngdoc +++ b/docs/content/api/angular.attrMarkup.ngdoc diff --git a/docs/angular.directive.ngdoc b/docs/content/api/angular.directive.ngdoc index 9a08e4c7..9a08e4c7 100644 --- a/docs/angular.directive.ngdoc +++ b/docs/content/api/angular.directive.ngdoc diff --git a/docs/angular.element.ngdoc b/docs/content/api/angular.element.ngdoc index 2ce007fd..2ce007fd 100644 --- a/docs/angular.element.ngdoc +++ b/docs/content/api/angular.element.ngdoc diff --git a/docs/angular.filter.ngdoc b/docs/content/api/angular.filter.ngdoc index 5d4f5940..5d4f5940 100644 --- a/docs/angular.filter.ngdoc +++ b/docs/content/api/angular.filter.ngdoc diff --git a/docs/angular.formatter.ngdoc b/docs/content/api/angular.formatter.ngdoc index 4eef190e..4eef190e 100644 --- a/docs/angular.formatter.ngdoc +++ b/docs/content/api/angular.formatter.ngdoc diff --git a/docs/angular.markup.ngdoc b/docs/content/api/angular.markup.ngdoc index a40385c8..a40385c8 100644 --- a/docs/angular.markup.ngdoc +++ b/docs/content/api/angular.markup.ngdoc diff --git a/docs/angular.ngdoc b/docs/content/api/angular.ngdoc index 3f342d1b..3f342d1b 100644 --- a/docs/angular.ngdoc +++ b/docs/content/api/angular.ngdoc diff --git a/docs/angular.service.ngdoc b/docs/content/api/angular.service.ngdoc index 0d3406e5..0d3406e5 100644 --- a/docs/angular.service.ngdoc +++ b/docs/content/api/angular.service.ngdoc diff --git a/docs/angular.validator.ngdoc b/docs/content/api/angular.validator.ngdoc index 96b1e76a..96b1e76a 100644 --- a/docs/angular.validator.ngdoc +++ b/docs/content/api/angular.validator.ngdoc diff --git a/docs/angular.widget.ngdoc b/docs/content/api/angular.widget.ngdoc index 5fd7b259..5fd7b259 100644 --- a/docs/angular.widget.ngdoc +++ b/docs/content/api/angular.widget.ngdoc diff --git a/docs/cookbook.buzz.ngdoc b/docs/content/cookbook/buzz.ngdoc index 2e82b2d1..2e82b2d1 100644 --- a/docs/cookbook.buzz.ngdoc +++ b/docs/content/cookbook/buzz.ngdoc diff --git a/docs/cookbook.deeplinking.ngdoc b/docs/content/cookbook/deeplinking.ngdoc index 7d69ee84..7d69ee84 100644 --- a/docs/cookbook.deeplinking.ngdoc +++ b/docs/content/cookbook/deeplinking.ngdoc diff --git a/docs/cookbook.form.ngdoc b/docs/content/cookbook/form.ngdoc index c9fd9e9a..c9fd9e9a 100644 --- a/docs/cookbook.form.ngdoc +++ b/docs/content/cookbook/form.ngdoc diff --git a/docs/cookbook.formadvanced.ngdoc b/docs/content/cookbook/formadvanced.ngdoc index 181dd5e9..181dd5e9 100644 --- a/docs/cookbook.formadvanced.ngdoc +++ b/docs/content/cookbook/formadvanced.ngdoc diff --git a/docs/cookbook.helloworld.ngdoc b/docs/content/cookbook/helloworld.ngdoc index ab4c337a..ab4c337a 100644 --- a/docs/cookbook.helloworld.ngdoc +++ b/docs/content/cookbook/helloworld.ngdoc diff --git a/docs/cookbook.ngdoc b/docs/content/cookbook/index.ngdoc index 7dc937c5..7dc937c5 100644 --- a/docs/cookbook.ngdoc +++ b/docs/content/cookbook/index.ngdoc diff --git a/docs/cookbook.mvc.ngdoc b/docs/content/cookbook/mvc.ngdoc index 94688547..94688547 100644 --- a/docs/cookbook.mvc.ngdoc +++ b/docs/content/cookbook/mvc.ngdoc diff --git a/docs/guide.bootstrap.ngdoc b/docs/content/guide/bootstrap.ngdoc index 12028796..12028796 100644 --- a/docs/guide.bootstrap.ngdoc +++ b/docs/content/guide/bootstrap.ngdoc diff --git a/docs/guide.data-binding.ngdoc b/docs/content/guide/data-binding.ngdoc index 12a926bd..12a926bd 100644 --- a/docs/guide.data-binding.ngdoc +++ b/docs/content/guide/data-binding.ngdoc diff --git a/docs/guide.expression.ngdoc b/docs/content/guide/expression.ngdoc index 421dd9c7..421dd9c7 100644 --- a/docs/guide.expression.ngdoc +++ b/docs/content/guide/expression.ngdoc diff --git a/docs/guide.compiler.ngdoc b/docs/content/guide/guide.compiler.ngdoc index 8896db43..8896db43 100644 --- a/docs/guide.compiler.ngdoc +++ b/docs/content/guide/guide.compiler.ngdoc diff --git a/docs/guide.css.ngdoc b/docs/content/guide/guide.css.ngdoc index 6e028f30..6e028f30 100644 --- a/docs/guide.css.ngdoc +++ b/docs/content/guide/guide.css.ngdoc diff --git a/docs/guide.di.ngdoc b/docs/content/guide/guide.di.ngdoc index 2d1f92eb..2d1f92eb 100644 --- a/docs/guide.di.ngdoc +++ b/docs/content/guide/guide.di.ngdoc diff --git a/docs/guide.ngdoc b/docs/content/guide/index.ngdoc index 2798210d..2798210d 100644 --- a/docs/guide.ngdoc +++ b/docs/content/guide/index.ngdoc diff --git a/docs/guide.overview.ngdoc b/docs/content/guide/overview.ngdoc index 61c58435..61c58435 100644 --- a/docs/guide.overview.ngdoc +++ b/docs/content/guide/overview.ngdoc diff --git a/docs/guide.template.ngdoc b/docs/content/guide/template.ngdoc index ae9bba92..ae9bba92 100644 --- a/docs/guide.template.ngdoc +++ b/docs/content/guide/template.ngdoc diff --git a/docs/guide.testing.ngdoc b/docs/content/guide/testing.ngdoc index bb3a1441..bb3a1441 100644 --- a/docs/guide.testing.ngdoc +++ b/docs/content/guide/testing.ngdoc diff --git a/docs/contribute.ngdoc b/docs/content/intro/contribute.ngdoc index 43d17283..43d17283 100644 --- a/docs/contribute.ngdoc +++ b/docs/content/intro/contribute.ngdoc diff --git a/docs/downloading.ngdoc b/docs/content/intro/downloading.ngdoc index a02b3367..a02b3367 100644 --- a/docs/downloading.ngdoc +++ b/docs/content/intro/downloading.ngdoc diff --git a/docs/faq.ngdoc b/docs/content/intro/faq.ngdoc index dd06d961..dd06d961 100644 --- a/docs/faq.ngdoc +++ b/docs/content/intro/faq.ngdoc diff --git a/docs/started.ngdoc b/docs/content/intro/started.ngdoc index a505b471..a505b471 100644 --- a/docs/started.ngdoc +++ b/docs/content/intro/started.ngdoc diff --git a/docs/testimonials.ngdoc b/docs/content/intro/testimonials.ngdoc index 2e333f4b..2e333f4b 100644 --- a/docs/testimonials.ngdoc +++ b/docs/content/intro/testimonials.ngdoc diff --git a/docs/tutorial.ngdoc b/docs/content/tutorial/index.ngdoc index b430b248..b430b248 100644 --- a/docs/tutorial.ngdoc +++ b/docs/content/tutorial/index.ngdoc diff --git a/docs/tutorial.step_00.ngdoc b/docs/content/tutorial/step_00.ngdoc index dbe38285..e506fcaf 100755 --- a/docs/tutorial.step_00.ngdoc +++ b/docs/content/tutorial/step_00.ngdoc @@ -1,4 +1,3 @@ -
  @workInProgress
  @ngdoc overview
  @name Tutorial: Step 0
 @@ -16,7 +15,7 @@  The following sample code is our starting point.  It is a static HTML page that displays next to
  nothing, but it has everything we need to proceed. You can think of this bit of code as our
 -prototype template, consisting of basic HTML tags with a pair of angular specific attributes. 
 +prototype template, consisting of basic HTML tags with a pair of angular specific attributes.
  __`app/index.html`:__
  <pre>
 diff --git a/docs/tutorial.step_01.ngdoc b/docs/content/tutorial/step_01.ngdoc index d96eaeb3..e22adc20 100755 --- a/docs/tutorial.step_01.ngdoc +++ b/docs/content/tutorial/step_01.ngdoc @@ -1,20 +1,20 @@ -@workInProgress
 +@workInProgress
  @ngdoc overview
  @name Tutorial: Step 1
  @description
  <table id="tutorial_nav">
    <tr>
 -    <td id="previous_step">{@link tutorial Previous}</td>
 +   <td id="previous_step">{@link tutorial.step_00 Previous}</td>
      <td id="step_result">{@link http://angular.github.com/angular-phonecat/step-1/app Example}</td>
      <td id="tut_home">{@link tutorial Tutorial Home}</td>
      <td id="code_diff">
  {@link https://github.com/angular/angular-phonecat/compare/step-0...step-1 Code Diff}</td>
 -    <td id="next_step">{@link tutorial.step_00 Next}</td>
 +    <td id="next_step">{@link tutorial.step_02 Next}</td>
    </tr>
  </table>
  Now that we have the basic ingredients in place, let's add some basic information about two cell
 -phones to our app.  
 +phones to our app.
  Note: We will usually include only the new code that we added for each step.  In this and
  subsequent examples, we will leave out code from the previous step that hasn't changed, for
 @@ -23,7 +23,7 @@ example:          ...
          <html xmlns:ng="http://angularjs.org">
          ...
 -        
 +
  Let's add the following code to `index.html`:
  __`app/index.html`:__
 @@ -53,18 +53,18 @@ __`app/index.html`:__  ## Discussion:
 -* It's a static web page! We displayed info about two phones! Yay. 
 +* It's a static web page! We displayed info about two phones! Yay.
  * For those of you playing along at home on your own web servers, did you switch to Step 1 and
 -refresh your browsers?  
 +refresh your browsers?
 -    * __{@link tutorial Using Git:}__ 
 +    * __{@link tutorial Using Git:}__
          From your `angular-phonecat` directory, run this command:
                  git checkout step-1
 -    * __{@link tutorial Using Snapshots:}__ 
 +    * __{@link tutorial Using Snapshots:}__
          From `[install directory]/sandbox`, run this command:
 @@ -78,11 +78,11 @@ into a dynamic web app.  <table id="tutorial_nav">
    <tr>
 -    <td id="previous_step">{@link tutorial Previous}</td>
 +   <td id="previous_step">{@link tutorial.step_00 Previous}</td>
      <td id="step_result">{@link http://angular.github.com/angular-phonecat/step-1/app Example}</td>
      <td id="tut_home">{@link tutorial Tutorial Home}</td>
      <td id="code_diff">
  {@link https://github.com/angular/angular-phonecat/compare/step-0...step-1 Code Diff}</td>
 -    <td id="next_step">{@link tutorial.step_00 Next}</td>
 +    <td id="next_step">{@link tutorial.step_02 Next}</td>
    </tr>
  </table>
 diff --git a/docs/tutorial.step_02.ngdoc b/docs/content/tutorial/step_02.ngdoc index 62becdba..50fbd240 100755 --- a/docs/tutorial.step_02.ngdoc +++ b/docs/content/tutorial/step_02.ngdoc @@ -1,15 +1,15 @@ -@workInProgress
 +@workInProgress
  @ngdoc overview
  @name Tutorial: Step 2
  @description
  <table id="tutorial_nav">
   <tr>
 -   <td id="previous_step">{@link tutorial.step_00 Previous}</td>
 +   <td id="previous_step">{@link tutorial.step_01 Previous}</td>
     <td id="step_result">{@link  http://angular.github.com/angular-phonecat/step-2/app Example}</td>
     <td id="tut_home">{@link tutorial Tutorial Home}</td>
  <td id="code_diff">{@link https://github.com/angular/angular-phonecat/compare/step-1...step-2 Code
  Diff}</td>
 -   <td id="next_step">{@link tutorial.step_00 Next}</td>
 +   <td id="next_step">{@link tutorial.step_03 Next}</td>
   </tr>
  </table>
 @@ -41,7 +41,7 @@ __`app/index.html`:__  </pre>
  Our data __Model__ (a short list of phones in object literal notation) is instantiated within our
 -__Controller__ function (`PhoneListCtrl`): 
 +__Controller__ function (`PhoneListCtrl`):
  __`app/js/controllers.js`:__
  <pre>
 @@ -84,7 +84,7 @@ enclosed in curly braces: `{{phone.name}}` and `{{phone.snippet}}`:      * The `ng:repeat="phone in phones"` statement in the `<li>` tag is an angular repeater.  It
      tells angular to create a `<li>` element for each phone in the phones list, using the first
 -    `<li>` tag as the template. 
 +    `<li>` tag as the template.
      * The curly braces around `phone.name` and `phone.snippet` are an example of {@link
      angular.markup angular markup}. The curly braces are shorthand for the angular directive
 @@ -97,11 +97,11 @@ enclosed in curly braces: `{{phone.name}}` and `{{phone.snippet}}`:  * __Controller:__  At this point, it doesn't appear as if our controller is doing very much
  controlling, but it is playing a crucial role: providing context for our data model so we can
  establish data-binding between the model and the view.  Note in the following how we connected the
 -dots between our presentation, data, and logic components: 
 +dots between our presentation, data, and logic components:
      * The name of our controller function (in the JavaScript file `controllers.js`) matches the
      {@link angular.directive.ng:controller ng:controller} directive in the `<body>` tag
 -    (`PhoneListCtrl`). 
 +    (`PhoneListCtrl`).
      * We instantiated our data within the scope of our controller function, and our template
      binding points are located within the block bounded by the `<body
      ng:controller="PhoneListCtrl>` tag.
 @@ -127,11 +127,11 @@ angular.  The test verifies that we have 3 records in the phones array.  <table id="tutorial_nav">
   <tr>
 -   <td id="previous_step">{@link tutorial.step_00 Previous}</td>
 +   <td id="previous_step">{@link tutorial.step_01 Previous}</td>
     <td id="step_result">{@link  http://angular.github.com/angular-phonecat/step-2/app Example}</td>
     <td id="tut_home">{@link tutorial Tutorial Home}</td>
  <td id="code_diff">{@link https://github.com/angular/angular-phonecat/compare/step-1...step-2 Code
  Diff}</td>
 -   <td id="next_step">{@link tutorial.step_00 Next}</td>
 +   <td id="next_step">{@link tutorial.step_03 Next}</td>
   </tr>
  </table>
 diff --git a/docs/tutorial.step_03.ngdoc b/docs/content/tutorial/step_03.ngdoc index 4fcccf4e..4333636d 100755 --- a/docs/tutorial.step_03.ngdoc +++ b/docs/content/tutorial/step_03.ngdoc @@ -1,23 +1,23 @@ -@workInProgress
 +@workInProgress
  @ngdoc overview
  @name Tutorial: Step 3
  @description
  <table id="tutorial_nav">
  <tr>
 -  <td id="previous_step">{@link tutorial.step_00 Previous}</td>
 +  <td id="previous_step">{@link tutorial.step_02 Previous}</td>
    <td id="step_result">{@link  http://angular.github.com/angular-phonecat/step-3/app Example}</td>
    <td id="tut_home">{@link tutorial Tutorial Home}</td>
    <td id="code_diff">{@link
    https://github.com/angular/angular-phonecat/commit/a03815f8fb00217f5f9c1d3ef83282f79818e706 Code
    Diff}</td>
 -  <td id="next_step">{@link tutorial.step_00 Next}</td>
 +  <td id="next_step">{@link tutorial.step_04 Next}</td>
  </tr>
  </table>
  We did a lot of work in laying the foundation of our app in the last step, so now we'll do
  something simple, and add full text search.  We will also write an end-to-end test, because a good
  end-to-end test is a good friend. It stays with your app, keeps an eye on it, and quickly detects
 -regressions. 
 +regressions.
  __`app/index.html`:__
  <pre>
 @@ -72,7 +72,7 @@ following:     keeps the two in sync.
  In this example, the data that you type into the input box (named __`query`__) is immediately
 -available as a filter input in the list repeater (`phone in phones.$filter(`__`query`__`)`). 
 +available as a filter input in the list repeater (`phone in phones.$filter(`__`query`__`)`).
  Whenever the data model changes and this change causes the input to the repeater to change, the
  repeater will efficiently update the DOM to reflect the current state of the model.
 @@ -97,12 +97,12 @@ your browser. This end-to-end test shows the following:  <table id="tutorial_nav">
  <tr>
 -  <td id="previous_step">{@link tutorial.step_00 Previous}</td>
 +  <td id="previous_step">{@link tutorial.step_02 Previous}</td>
    <td id="step_result">{@link  http://angular.github.com/angular-phonecat/step-3/app Example}</td>
    <td id="tut_home">{@link tutorial Tutorial Home}</td>
    <td id="code_diff">{@link
    https://github.com/angular/angular-phonecat/commit/a03815f8fb00217f5f9c1d3ef83282f79818e706 Code
    Diff}</td>
 -  <td id="next_step">{@link tutorial.step_00 Next}</td>
 +  <td id="next_step">{@link tutorial.step_04 Next}</td>
  </tr>
  </table>
 diff --git a/docs/tutorial.step_04.ngdoc b/docs/content/tutorial/step_04.ngdoc index 559055b6..0589ba75 100755 --- a/docs/tutorial.step_04.ngdoc +++ b/docs/content/tutorial/step_04.ngdoc @@ -1,15 +1,15 @@ -@workInProgress
 +@workInProgress
  @ngdoc overview
  @name Tutorial: Step 4
  @description
  <table id="tutorial_nav">
  <tr>
 -<td id="previous_step">{@link tutorial.step_00 Previous}</td>
 +<td id="previous_step">{@link tutorial.step_03 Previous}</td>
  <td id="step_result">{@link  http://angular.github.com/angular-phonecat/step-4/app Example}</td>
  <td id="tut_home">{@link tutorial Tutorial Home}</td>
  <td id="code_diff">{@link https://github.com/angular/angular-phonecat/compare/step-3...step-4 Code
  Diff}</td>
 -<td id="next_step">{@link tutorial.step_00 Next}</td>
 +<td id="next_step">{@link tutorial.step_05 Next}</td>
  </tr>
  </table>
 @@ -151,11 +151,11 @@ initializes the data model.  <table id="tutorial_nav">
  <tr>
 -<td id="previous_step">{@link tutorial.step_00 Previous}</td>
 +<td id="previous_step">{@link tutorial.step_03 Previous}</td>
  <td id="step_result">{@link  http://angular.github.com/angular-phonecat/step-4/app Example}</td>
  <td id="tut_home">{@link tutorial Tutorial Home}</td>
  <td id="code_diff">{@link https://github.com/angular/angular-phonecat/compare/step-3...step-4 Code
  Diff}</td>
 -<td id="next_step">{@link tutorial.step_00 Next}</td>
 +<td id="next_step">{@link tutorial.step_05 Next}</td>
  </tr>
  </table>
 diff --git a/docs/tutorial.step_05.ngdoc b/docs/content/tutorial/step_05.ngdoc index 63ebd64f..8ec0fca4 100755 --- a/docs/tutorial.step_05.ngdoc +++ b/docs/content/tutorial/step_05.ngdoc @@ -1,15 +1,15 @@ -@workInProgress
 +@workInProgress
  @ngdoc overview
  @name Tutorial: Step 5
  @description
  <table id="tutorial_nav">
  <tr>
 - <td id="previous_step">{@link tutorial.step_00 Previous}</td>
 + <td id="previous_step">{@link tutorial.step_04 Previous}</td>
   <td id="step_result">{@link  http://angular.github.com/angular-phonecat/step-5/app Example}</td>
   <td id="tut_home">{@link tutorial Tutorial Home}</td>
  <td id="code_diff">{@link https://github.com/angular/angular-phonecat/compare/step-4...step-5 Code
  Diff}</td>
 - <td id="next_step">{@link tutorial.step_00 Next}</td>
 + <td id="next_step">{@link tutorial.step_06 Next}</td>
  </tr>
  </table>
 @@ -21,7 +21,7 @@ angular.service.$xhr $xhr} service to make this easy.  The addition of the `$xhr` service to our app gives us the opportunity to talk about {@link
  guide.di Dependency Injection} (DI).  The use of DI is another cornerstone of the angular
  philosophy. DI helps make your web apps well structured, loosely coupled, and ultimately easier to
 -test.  
 +test.
  __`app/js/controllers.js:`__
  <pre>
 @@ -137,11 +137,11 @@ reason, we need to:  <table id="tutorial_nav">
  <tr>
 - <td id="previous_step">{@link tutorial.step_00 Previous}</td>
 + <td id="previous_step">{@link tutorial.step_04 Previous}</td>
   <td id="step_result">{@link  http://angular.github.com/angular-phonecat/step-5/app Example}</td>
   <td id="tut_home">{@link tutorial Tutorial Home}</td>
   <td id="code_diff">{@link https://github.com/angular/angular-phonecat/compare/step-4...step-5
   Code Diff}</td>
 - <td id="next_step">{@link tutorial.step_00 Next}</td>
 + <td id="next_step">{@link tutorial.step_06 Next}</td>
  </tr>
  </table>
 diff --git a/docs/tutorial.step_06.ngdoc b/docs/content/tutorial/step_06.ngdoc index 9d6a548e..afe809a6 100755 --- a/docs/tutorial.step_06.ngdoc +++ b/docs/content/tutorial/step_06.ngdoc @@ -1,15 +1,15 @@ -@workInProgress
 +@workInProgress
  @ngdoc overview
  @name Tutorial: Step 6
  @description
  <table id="tutorial_nav">
  <tr>
 -<td id="previous_step">{@link tutorial.step_00 Previous}</td>
 +<td id="previous_step">{@link tutorial.step_05 Previous}</td>
  <td id="step_result">{@link  http://angular.github.com/angular-phonecat/step-6/app Example}</td>
  <td id="tut_home">{@link tutorial Tutorial Home}</td>
  <td id="code_diff">{@link https://github.com/angular/angular-phonecat/compare/step-5...step-6 Code
  Diff}</td>
 -<td id="next_step">{@link tutorial.step_00 Next}</td>
 +<td id="next_step">{@link tutorial.step_07 Next}</td>
  </tr>
  </table>
 @@ -64,14 +64,14 @@ __`app/phones/phones.json`__ (sample snippet):  <pre>
   [
    {
 -   "age": 4, 
 +   "age": 4,
     ...
 -   "carrier": "T-Mobile", 
 -   "id": "motorola-defy-with-motoblur", 
 -   "imageUrl": "http://google.com/phone/image/small/640001", 
 -   "name": "Motorola DEFY\u2122 with MOTOBLUR\u2122", 
 +   "carrier": "T-Mobile",
 +   "id": "motorola-defy-with-motoblur",
 +   "imageUrl": "http://google.com/phone/image/small/640001",
 +   "name": "Motorola DEFY\u2122 with MOTOBLUR\u2122",
     "snippet": "Are you ready for everything life throws your way?"
 -  }, 
 +  },
    …
   ]
  </pre>
 @@ -93,7 +93,7 @@ __`test/e2e/scenarios.js`__:  {@link angular.markup double-curly brace markup} in the href attribute values. These represent
  attribute bindings, and work the same way as the bindings we saw in previous steps.
 -* Note also the use of the {@link angular.directive.ng:src ng:src} directive in the `<img>` tag. 
 +* Note also the use of the {@link angular.directive.ng:src ng:src} directive in the `<img>` tag.
  That directive prevents the browser from treating the angular `{{ exppression }}` markup
  literally, as it would do if we tried to use markup in a regular `src` attribute.  Use `ng:src` to
  keep the browser from eagerly making an extra http request to an invalid location.
 @@ -103,11 +103,11 @@ views we will implement in the upcoming steps.  <table id="tutorial_nav">
  <tr>
 -<td id="previous_step">{@link tutorial.step_00 Previous}</td>
 +<td id="previous_step">{@link tutorial.step_05 Previous}</td>
  <td id="step_result">{@link  http://angular.github.com/angular-phonecat/step-6/app Example}</td>
  <td id="tut_home">{@link tutorial Tutorial Home}</td>
  <td id="code_diff">{@link https://github.com/angular/angular-phonecat/compare/step-5...step-6 Code
  Diff}</td>
 -<td id="next_step">{@link tutorial.step_00 Next}</td>
 +<td id="next_step">{@link tutorial.step_07 Next}</td>
  </tr>
  </table>
 diff --git a/docs/tutorial.step_07.ngdoc b/docs/content/tutorial/step_07.ngdoc index 3c715a79..802130c5 100755 --- a/docs/tutorial.step_07.ngdoc +++ b/docs/content/tutorial/step_07.ngdoc @@ -1,23 +1,23 @@ -@workInProgress
 +@workInProgress
  @ngdoc overview
  @name Tutorial: Step 7
  @description
  <table id="tutorial_nav">
  <tr>
 -<td id="previous_step">{@link tutorial.step_00 Previous}</td>
 +<td id="previous_step">{@link tutorial.step_06 Previous}</td>
  <td id="step_result">{@link  http://angular.github.com/angular-phonecat/step-7/app Live Demo
  }</td>
  <td id="tut_home">{@link tutorial Tutorial Home}</td>
  <td id="code_diff">{@link https://github.com/angular/angular-phonecat/compare/step-6...step-7 Code
  Diff}</td>
 -<td id="next_step">{@link tutorial.step_00 Next}</td>
 +<td id="next_step">{@link tutorial.step_08 Next}</td>
  </tr>
  </table>
  Our app is slowly growing and becoming more complex. Up until now, the app provided our users with
  just one view (the list of all phones), and all of our template code was located in the
  `index.html` file.  The next step in building our app is the addition of a view that will show
 -detailed information about each of the devices in our list.  
 +detailed information about each of the devices in our list.
  To add the detailed view, we could expand the `index.html` file to contain template code for both
  views, but that would get messy very quickly. Instead, we are going to turn the `index.html`
 @@ -142,13 +142,13 @@ two new View templates:  * __The Controller(s).__ We now have a new root controller (`PhoneCatCtrl`) and two
  sub-controllers (`PhoneListCtrl` and `PhoneDetailCtrl`). These inherit the model properties and
 -behavior from the root controller. 
 +behavior from the root controller.
      * __`$route.`__ The root controller's job now is to set up the `$route` configuration:
          * When the fragment part of the URL in the browser ends in "/phones", `$route` service
          grabs the `phone-list.html` template, compiles it, and links it with a new scope that is
 -        controlled by our `PhoneListCtrl` controller. 
 +        controlled by our `PhoneListCtrl` controller.
          * When the URL ends in "/phones/:phoneId", `$route` compiles and links the
          `phone-detail.html` template as it did with `phone-list.html`. But note the use of the
 @@ -170,12 +170,12 @@ behavior from the root controller.  <table id="tutorial_nav">
  <tr>
 -<td id="previous_step">{@link tutorial.step_00 Previous}</td>
 +<td id="previous_step">{@link tutorial.step_06 Previous}</td>
  <td id="step_result">{@link  http://angular.github.com/angular-phonecat/step-7/app Live Demo
  }</td>
  <td id="tut_home">{@link tutorial Tutorial Home}</td>
  <td id="code_diff">{@link https://github.com/angular/angular-phonecat/compare/step-6...step-7 Code
  Diff}</td>
 -<td id="next_step">{@link tutorial.step_00 Next}</td>
 +<td id="next_step">{@link tutorial.step_08 Next}</td>
  </tr>
  </table>
 diff --git a/docs/tutorial.step_08.ngdoc b/docs/content/tutorial/step_08.ngdoc index bd220f5a..65ce6883 100755 --- a/docs/tutorial.step_08.ngdoc +++ b/docs/content/tutorial/step_08.ngdoc @@ -1,16 +1,16 @@ -@workInProgress
 +@workInProgress
  @ngdoc overview
  @name Tutorial: Step 8
  @description
  <table id="tutorial_nav">
  <tr>
 -<td id="previous_step">{@link tutorial.step_00 Previous}</td>
 +<td id="previous_step">{@link tutorial.step_07 Previous}</td>
  <td id="step_result">{@link  http://angular.github.com/angular-phonecat/step-8/app Live Demo
  }</td>
  <td id="tut_home">{@link tutorial Tutorial Home}</td>
  <td id="code_diff">{@link https://github.com/angular/angular-phonecat/compare/step-7...step-8 Code
  Diff}</td>
 -<td id="next_step">{@link tutorial.step_00 Next}</td>
 +<td id="next_step">{@link tutorial.step_09 Next}</td>
  </tr>
  </table>
 @@ -69,20 +69,20 @@ __`app/phones/nexus-s.json`:__ (sample snippet)  <pre>
  {
    "additionalFeatures": "Contour Display, Near Field Communications (NFC), Three-axis gyroscope,
 -  Anti-fingerprint display coating, Internet Calling support (VoIP/SIP)", 
 +  Anti-fingerprint display coating, Internet Calling support (VoIP/SIP)",
    "android": {
 -      "os": "Android 2.3", 
 +      "os": "Android 2.3",
        "ui": "Android"
 -  }, 
 +  },
    ...
    "images": [
 -      "img/phones/nexus-s.0.jpg", 
 -      "img/phones/nexus-s.1.jpg", 
 -      "img/phones/nexus-s.2.jpg", 
 +      "img/phones/nexus-s.0.jpg",
 +      "img/phones/nexus-s.1.jpg",
 +      "img/phones/nexus-s.2.jpg",
        "img/phones/nexus-s.3.jpg"
 -  ], 
 +  ],
    "storage": {
 -      "flash": "16384MB", 
 +      "flash": "16384MB",
        "ram": "512MB"
    }
  }
 @@ -137,12 +137,12 @@ spirit to the one we wrote for the `PhoneListCtrl` controller.  <table id="tutorial_nav">
  <tr>
 -<td id="previous_step">{@link tutorial.step_00 Previous}</td>
 +<td id="previous_step">{@link tutorial.step_07 Previous}</td>
  <td id="step_result">{@link  http://angular.github.com/angular-phonecat/step-8/app Live Demo
  }</td>
  <td id="tut_home">{@link tutorial Tutorial Home}</td>
  <td id="code_diff">{@link https://github.com/angular/angular-phonecat/compare/step-7...step-8 Code
  Diff}</td>
 -<td id="next_step">{@link tutorial.step_00 Next}</td>
 +<td id="next_step">{@link tutorial.step_09 Next}</td>
  </tr>
  </table>
 diff --git a/docs/tutorial.step_09.ngdoc b/docs/content/tutorial/step_09.ngdoc index 9d952514..2d6ed925 100755 --- a/docs/tutorial.step_09.ngdoc +++ b/docs/content/tutorial/step_09.ngdoc @@ -1,23 +1,23 @@ -@workInProgress
 +@workInProgress
  @ngdoc overview
  @name Tutorial: Step 9
  @description
  <table id="tutorial_nav">
  <tr>
 -<td id="previous_step">{@link tutorial.step_00 Previous}</td>
 +<td id="previous_step">{@link tutorial.step_08 Previous}</td>
  <td id="step_result">{@link  http://angular.github.com/angular-phonecat/step-9/app Live Demo
  }</td>
  <td id="tut_home">{@link tutorial Tutorial Home}</td>
  <td id="code_diff">{@link https://github.com/angular/angular-phonecat/compare/step-8...step-9 Code
  Diff}</td>
 -<td id="next_step">{@link tutorial.step_00 Next}</td>
 +<td id="next_step">{@link tutorial.step_10 Next}</td>
  </tr>
  </table>
  In this step, we have determined that the built-in angular display filters ({@link
  angular.filter.number number}, {@link angular.filter.currency currency}, {@link
  angular.filter.date date}, etc.) don't handle what we want to do, so we get to create our own
 -custom {@link angular.filter filter}.  
 +custom {@link angular.filter filter}.
  In the previous step, the details page displayed either "true" or "false" to indicate whether
  certain phone features were present or not.  Our custom "checkmark" filter replaces those text
 @@ -25,7 +25,7 @@ strings with glyphs: ✓ for "true", and ✘ for "false".  Our filter code lives in `app/js/filters.js`:
 -__`app/index.html`:__ 
 +__`app/index.html`:__
  <pre>
  ...
   <script src="lib/angular/angular.js" ng:autobind></script>
 @@ -37,7 +37,7 @@ __`app/index.html`:__  In the phone details template, we employ our filter for angular expressions whose values are
  "true" or "false"; `{{ [phone_feature] | checkmark }}`:
 -__`app/partials/phone-detail.html`:__ 
 +__`app/partials/phone-detail.html`:__
  <pre>
  <img ng:src="{{phone.images[0].large}}" class="phone"/>
  <h1>{{phone.name}}</h1>
 @@ -86,23 +86,23 @@ describe('checkmark filter', function() {  * This example shows how easy it is to roll your own filters for displaying data.  As explained in
  the "Writing your own Filters" section of the {@link angular.filter angular.filter} page, you
 -simply register your custom filter function on to the `angular.filter` function. 
 +simply register your custom filter function on to the `angular.filter` function.
  * In this example, our filter name is "checkmark"; our input is either "true" or "false", and we
  return one of two unicode characters we have chosen to represent true or false (`\u2713` and
 -`\u2718`).  
 +`\u2718`).
  * We created a new unit test to verify that our custom filter converts boolean values to unicode
  characters.
  <table id="tutorial_nav">
  <tr>
 -<td id="previous_step">{@link tutorial.step_00 Previous}</td>
 +<td id="previous_step">{@link tutorial.step_08 Previous}</td>
  <td id="step_result">{@link  http://angular.github.com/angular-phonecat/step-9/app Live Demo
  }</td>
  <td id="tut_home">{@link tutorial Tutorial Home}</td>
  <td id="code_diff">{@link https://github.com/angular/angular-phonecat/compare/step-8...step-9 Code
  Diff}</td>
 -<td id="next_step">{@link tutorial.step_00 Next}</td>
 +<td id="next_step">{@link tutorial.step_10 Next}</td>
  </tr>
  </table>
 diff --git a/docs/tutorial.step_10.ngdoc b/docs/content/tutorial/step_10.ngdoc index 130b4023..130b4023 100644 --- a/docs/tutorial.step_10.ngdoc +++ b/docs/content/tutorial/step_10.ngdoc diff --git a/docs/tutorial.step_11.ngdoc b/docs/content/tutorial/step_11.ngdoc index 34ba7b02..e383f406 100644 --- a/docs/tutorial.step_11.ngdoc +++ b/docs/content/tutorial/step_11.ngdoc @@ -1,4 +1,4 @@ -@workInProgress
 +@workInProgress
  @ngdoc overview
  @name Tutorial: Step 11
  @description
 @@ -15,11 +15,11 @@ Code Diff}</td>  </table>
  And so we arrive at the last step of this tutorial. Here we define a custom service that
 -represents a {@link http://en.wikipedia.org/wiki/Representational_State_Transfer RESTful} client. 
 +represents a {@link http://en.wikipedia.org/wiki/Representational_State_Transfer RESTful} client.
  Using this client we can make xhr requests for data in an easier way, without having to deal with
  the lower-level {@link angular.service.$xhr $xhr} APIs, HTTP methods and URLs.
 -__`app/index.html`.__ 
 +__`app/index.html`.__
  <pre>
  ...
    <script src="js/services.js"></script>
 diff --git a/docs/service.template b/docs/service.template deleted file mode 100644 index 639990ed..00000000 --- a/docs/service.template +++ /dev/null @@ -1,57 +0,0 @@ -<h1><tt>{{name}}</tt></h1> - -{{#workInProgress}} -<fieldset class="workInProgress"> -  <legend>Work In Progress</legend> -  This page is currently being revised. It might be incomplete or contain inaccuracies. -  {{{workInProgress.description}}} -</fieldset> -{{/workInProgress}} - -{{#deprecated}} -<fieldset class="deprecated"> -  <legend>Deprecated API</legend> -  {{deprecated}} -</fieldset> -{{/deprecated}} - -<h2>Description</h2> -{{{description}}} - -<h2>Dependencies</h2> -<ul> -  {{#requires}} -  <li><tt>{{name}}</tt></li> -  {{/requires}} -</ul> - -{{#method.length}} -<h2>Methods</h2> -<ul> -  {{#method}} -  <li><tt>{{shortName}}()</tt>: {{{description}}}</li> -  {{/method}} -</ul> -{{/method.length}} - -{{#property.length}} -<h2>Properties</h2> -<ul> -  {{#property}} -  <li><tt>{{name}}:{{#type}}{{type}}{{/type}}</tt>{{#description}}: {{{description}}}{{/description}}</li> -  {{/property}} -</ul> -{{/property.length}} - -{{#example}} -<h2>Example</h2> -{{{exampleDescription}}} -<doc:example> -  <doc:source> -{{/example}} -    {{{example}}} -{{#example}} -  </doc:source> -  {{#scenario}}<doc:scenario>{{{scenario}}}</doc:scenario>{{/scenario}} -</doc:example> -{{/example}} diff --git a/docs/src/gen-docs.js b/docs/src/gen-docs.js index 464916b1..9edfaceb 100644 --- a/docs/src/gen-docs.js +++ b/docs/src/gen-docs.js @@ -20,7 +20,7 @@ var work = callback.chain(function(){  var writes = callback.chain(function(){    ngdoc.merge(docs);    docs.forEach(function(doc){ -    writer.output(doc.id + '.html', doc.html(), writes.waitFor()); +    writer.output(doc.section + '/' + doc.id + '.html', doc.html(), writes.waitFor());    });    var metadata = ngdoc.metadata(docs);    writer.output('docs-keywords.js', ['NG_PAGES=', JSON.stringify(metadata).replace(/{/g, '\n{'), ';'], writes.waitFor()); diff --git a/docs/src/ngdoc.js b/docs/src/ngdoc.js index 57202809..869fe4c5 100644 --- a/docs/src/ngdoc.js +++ b/docs/src/ngdoc.js @@ -36,7 +36,6 @@ Doc.METADATA_IGNORE = (function(){  })(); -  Doc.prototype = {    keywords: function keywords(){      var keywords = {}; @@ -57,6 +56,38 @@ Doc.prototype = {      return words.join(' ');    }, + +  /* +   * This function is here to act as a huristic based translator from the old style urls to +   * the new style which use sections. +   */ +  sectionHuristic: function (url){ +    // if we are new styl URL with section/id then just return; +    if (url.match(/\//)) return url; +    var match = url.match(/(\w+)(\.(.*))?/); +    var section = match[1]; +    var id = match[3] || 'index'; +    switch(section) { +      case 'angular': +        section = 'api'; +        id = 'angular.' + id; +        break; +      case 'api': +      case 'cookbook': +      case 'guide': +      case 'intro': +      case 'tutorial': +        break; +      default: +        id = section + '.' + id; +        section = 'intro'; +    } +    var newUrl = section + '/' + (id || 'index'); +    console.log('WARNING:', 'found old style url', url, 'at', this.file, this.line, +        'converting to', newUrl); +    return newUrl; +  }, +    markdown: function (text) {      var self = this;      var IS_URL = /^(https?:\/\/|ftps?:\/\/|mailto:|\.|\/)/; @@ -70,7 +101,7 @@ Doc.prototype = {      parts.forEach(function(text, i){        if (text.match(/^<pre>/)) {          text = text.replace(/^<pre>([\s\S]*)<\/pre>/mi, function(_, content){ -          var clazz = 'brush: js;' +          var clazz = 'brush: js;';            if (content.match(/\<\w/)) {              // we are HTML              clazz += ' html-script: true;'; @@ -93,7 +124,8 @@ Doc.prototype = {          text = text.replace(/<angular\/>/gm, '<tt><angular/></tt>');          text = text.replace(/{@link\s+([^\s}]+)\s*([^}]*?)\s*}/g,            function(_all, url, title){ -            return '<a href="' + (url.match(IS_URL) ? '' : '#!') + url + '">' +            var isFullUrl = url.match(IS_URL); +            return '<a href="' + (isFullUrl ? '' + url : '#!' + self.sectionHuristic(url)) + '">'                + (url.match(IS_ANGULAR) ? '<code>' : '')                + (title || url).replace(/\n/g, ' ')                + (url.match(IS_ANGULAR) ? '</code>' : '') @@ -525,6 +557,7 @@ function metadata(docs){      var depth = path.length - 1;      var shortName = path.pop();      words.push({ +      section: doc.section,        id: doc.id,        name: doc.name,        depth: depth, @@ -538,7 +571,7 @@ function metadata(docs){  }  var KEYWORD_PRIORITY = { -  '.started': 1, +  '.index': 1,    '.guide': 2,    '.guide.overview': 1,    '.angular': 7, @@ -562,7 +595,7 @@ function keywordSort(a, b){        mangled.push(KEYWORD_PRIORITY[partialName] || 5);        mangled.push(name);      }); -    return mangled.join('.'); +    return doc.section + '/' + mangled.join('.');    }    var nameA = mangleName(a);    var nameB = mangleName(b); diff --git a/docs/src/reader.js b/docs/src/reader.js index 300b17f0..f20bc06e 100644 --- a/docs/src/reader.js +++ b/docs/src/reader.js @@ -9,15 +9,13 @@ var fs       = require('fs'),  var NEW_LINE = /\n\r?/;  function collect(callback){ -/*     findJsFiles('src', callback.waitMany(function(file) { -     //console.log('reading', file, '...'); +     console.log('reading', file, '...');       findNgDocInJsFile(file, callback.waitMany(function(doc, line) { -       callback(doc, file, line); +       callback('@section api\n' + doc, file, line);      }));    })); -*/ -  findNgDocInDir('docs/', callback.waitMany(callback)); +  findNgDocInDir('docs/content', callback.waitMany(callback));    callback.done();  } @@ -42,11 +40,18 @@ function findNgDocInDir(directory, docNotify) {    fs.readdir(directory, docNotify.waitFor(function(err, files){      if (err) return this.error(err);      files.forEach(function(file){ -      //console.log('reading', directory + file, '...'); -      if (!file.match(/tutorial.*\.ngdoc$/)) return; -      fs.readFile(directory + file, docNotify.waitFor(function(err, content){ +      fs.stat(directory + '/' + file, docNotify.waitFor(function(err, stats){          if (err) return this.error(err); -        docNotify(content.toString(), directory + file, 1); +        if (stats.isFile()) { +          console.log('reading', directory + '/' + file, '...'); +          fs.readFile(directory + '/' + file, docNotify.waitFor(function(err, content){ +            if (err) return this.error(err); +            var section = '@section ' + directory.split('/').pop() + '\n'; +            docNotify(section + content.toString(), directory + '/' +file, 1); +          })); +        } else if(stats.isDirectory()) { +          findNgDocInDir(directory + '/' + file, docNotify.waitFor(docNotify)); +        }        }));      });      docNotify.done(); diff --git a/docs/src/templates/docs.css b/docs/src/templates/docs.css index f5b9275b..4f47367d 100644 --- a/docs/src/templates/docs.css +++ b/docs/src/templates/docs.css @@ -18,6 +18,24 @@ a {    height: 3.5em;  } +#header .navigation { +  position: absolute; +  text-align: center; +  top: 0; +  right: 0; +  left: 0; +  margin: 0; +  padding: 0; +} +#header .navigation > li { +  display: inline; +  padding: 0 .5em; +} + +#header .navigation > li.selected { +  font-weight: bold; +} +  #sidebar,  #main {    position: absolute; @@ -191,12 +209,8 @@ a {    margin-top: 0;  } -#sidebar ul li.level-1.level-angular { +#sidebar ul li.monospace{    font-family: monospace; -  font-weight: normal; -  font-size: 1em; -  margin-top: 0; -  margin-bottom: 0;  }  #sidebar ul li.level-1 { @@ -208,17 +222,14 @@ a {  #sidebar ul li.level-2 {    margin-left: 2em; -  font-family: monospace;  }  #sidebar ul li.level-3 {    margin-left: 3em; -  font-family: monospace;  }  #sidebar ul li.level-4 {    margin-left: 4em; -  font-family: monospace;  } diff --git a/docs/src/templates/docs.js b/docs/src/templates/docs.js index 9483496e..47bb87a6 100644 --- a/docs/src/templates/docs.js +++ b/docs/src/templates/docs.js @@ -1,8 +1,8 @@  var HAS_HASH = /#/;  DocsController.$inject = ['$location', '$browser', '$window'];  function DocsController($location, $browser, $window) { -  this.pages = NG_PAGES;    window.$root = this.$root; +  var self = this;    this.$location = $location;    if (!HAS_HASH.test($location.href)) { @@ -11,28 +11,36 @@ function DocsController($location, $browser, $window) {    this.$watch('$location.hashPath', function(hashPath) {      if (hashPath.match(/^!/)) { -      this.partialId = hashPath.substring(1); -      this.partialTitle = (angular.Array.filter(NG_PAGES, {id:this.partialId})[0]||{}).name; +      var parts = hashPath.substring(1).split('/'); +      self.sectionId = parts[0]; +      self.partialId = parts[1] || 'index'; +      self.pages = angular.Array.filter(NG_PAGES, {section:self.sectionId}); +      self.partialTitle = (angular.Array.filter(self.pages, function(doc){return doc.id == self.partialId;})[0]||{}).name;      }    });    this.getUrl = function(page){ -    return '#!' + page.id; +    return '#!' + page.section + '/' + page.id;    };    this.getCurrentPartial = function(){ -    return './' + this.partialId + '.html'; +    return './' + this.sectionId + '/' + this.partialId + '.html';    };    this.getClass = function(page) {      var depth = page.depth,          cssClass = 'level-' + depth + (page.name == this.partialId ? ' selected' : ''); -    if (depth == 1 && page.type !== 'overview') cssClass += ' level-angular'; +    if (page.section == 'api') +      cssClass += ' monospace';      return cssClass;    }; +  this.selectedSection = function(section) { +    return section == self.sectionId ? 'selected' : null; +  }; +    this.afterPartialLoaded = function() {      SyntaxHighlighter.highlight();    }; diff --git a/docs/src/templates/index.html b/docs/src/templates/index.html index 63e8d871..1c3dd3a6 100644 --- a/docs/src/templates/index.html +++ b/docs/src/templates/index.html @@ -4,23 +4,36 @@        ng:controller="DocsController">  <head>    <title ng:bind-template="<angular/>: {{partialTitle}}"><angular/></title> -    <meta name="fragment" content="!"> -    <link rel="stylesheet" href="doc_widgets.css" type="text/css" />    <link rel="stylesheet" href="docs.css" type="text/css"/>    <link rel="stylesheet" href="syntaxhighlighter/shCore.css" type="text/css"/>    <link rel="stylesheet" href="syntaxhighlighter/shThemeDefault.css" type="text/css"/> - -  <script src="jquery.min.js"></script> -  <script src="syntaxhighlighter/shCore.js"></script> -  <script src="syntaxhighlighter/shBrushJScript.js"></script> -  <script src="syntaxhighlighter/shBrushXml.js"></script> - -  <script src="../angular.min.js" ng:autobind></script> -  <script src="docs.js"></script> -  <script src="doc_widgets.js"></script> -  <script src="docs-keywords.js"></script> +  <script> +    /*! +     * $script.js v1.3 +     * https://github.com/ded/script.js +     * Copyright: @ded & @fat - Dustin Diaz, Jacob Thornton 2011 +     * Follow our software http://twitter.com/dedfat +     * License: MIT +     */ +    !function(a,b,c){function w(a,c){var e=b.createElement("script"),f=0;e.onload=e[r]=function(){e[p]&&!!h.test(e[p])||f||(e.onload=e[r]=null,f=1,c())},e.async=1,e.src=a,d.parentNode.insertBefore(e,d)}function t(a,b){s(a,function(a){return!b(a)})}var d=b.getElementsByTagName("script")[0],e={},f={},g={},h=/^i|c/,i={},k="string",l=!1,m,n="push",o="DOMContentLoaded",p="readyState",q="addEventListener",r="onreadystatechange",s=function(a,b){for(m=0,j=a.length;m<j;++m)if(!b(a[m]))return 0;return 1};!b[p]&&b[q]&&(b[q](o,function u(){b.removeEventListener(o,u,l),b[p]="complete"},l),b[p]="loading");var v=function(a,b,d){function o(){if(!--l){e[k]=1,j&&j();for(var a in g)s(a.split("|"),m)&&!t(g[a],m)&&(g[a]=[])}}function m(a){return a.call?a():e[a]}a=a[n]?a:[a];var h=b&&b.call,j=h?b:d,k=h?a.join(""):b,l=a.length;c(function(){t(a,function(a){i[a]?(k&&(f[k]=1),o()):(i[a]=1,k&&(f[k]=1),w(v.path?v.path+a+".js":a,o))})},0);return v};v.get=w,v.ready=function(a,b,c){a=a[n]?a:[a];var d=[];!t(a,function(a){e[a]||d[n](a)})&&s(a,function(a){return e[a]})?b():!function(a){g[a]=g[a]||[],g[a][n](b),c&&c(d)}(a.join("|"));return v};var x=a.$script;v.noConflict=function(){a.$script=x;return this},typeof module!="undefined"&&module.exports?module.exports=v:a.$script=v}(this,document,setTimeout) +    $script([ +      'jquery.min.js', +      'syntaxhighlighter/shCore.js'], function(){ +      $script([ +        'syntaxhighlighter/shBrushJScript.js', +        'syntaxhighlighter/shBrushXml.js', +        '../angular.min.js'], function(){ +        $script([ +          'docs.js', +          'doc_widgets.js', +          'docs-keywords.js'], function(){ +             angular.compile(document)(); +        }); +      }); +    }); +  </script>  </head>  <body style="display:none;" ng:show="true">    <div id="header"> @@ -28,6 +41,13 @@        <span class="main-title">{{partialTitle}}</span>        <a href="#" tabindex="0"><span class="angular"><angular/></span> Docs</a>      </h1> +    <ul class="navigation"> +      <li ng:class="selectedSection('intro')"><a href="#!intro">Introduction</a></li> +      <li ng:class="selectedSection('tutorial')"><a href="#!tutoria">Tutorial</a></li> +      <li ng:class="selectedSection('guide')"><a href="#!guide">Developer Guide</a></li> +      <li ng:class="selectedSection('api')"><a href="#!api">API Reference</a></li> +      <li ng:class="selectedSection('cookbook')"><a href="#!cookbook">Cookbook</a></li> +    </ul>    </div>    <div id="sidebar">      <input type="text" name="search" id="search-box" placeholder="search the docs" diff --git a/docs/src/writer.js b/docs/src/writer.js index cf54e1a3..061b9f9f 100644 --- a/docs/src/writer.js +++ b/docs/src/writer.js @@ -10,12 +10,20 @@ function output(docs, content, callback){    callback();  } +function parent(file) { +  var parts = file.split('/'); +  parts.pop(); +  return parts.join('/'); +} +  exports.output = function(file, content, callback){ -  //console.log('writing', OUTPUT_DIR + file, '...'); -  fs.writeFile( -      OUTPUT_DIR + file, -      exports.toString(content), -      callback); +  console.log('write', file); +  exports.makeDir(parent(OUTPUT_DIR + file), callback.waitFor(function(){ +    fs.writeFile( +        OUTPUT_DIR + file, +        exports.toString(content), +        callback); +  }));  }; @@ -39,7 +47,8 @@ exports.toString = function toString(obj){  exports.makeDir = function (path, callback) {    var parts = path.split(/\//);    path = '.'; -  (function next(){ +  (function next(error){ +    if (error && error.code != 'EEXIST') return callback.error(error);      if (parts.length) {        path += '/' + parts.shift();        fs.mkdir(path, 0777, next); | 
