Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 8727302

Browse files
committed
docs(*): fix heading levels and general clean-up
- docs pages should only have one h1 - docs pages shouldn't skip a h* in the hierarchy - manual table of contents are no longer necesary - references to the doc-module-components directive are obsolete
1 parent ddd78bd commit 8727302

File tree

22 files changed

+41
-107
lines changed

22 files changed

+41
-107
lines changed

docs/config/templates/ngdoc/api/filter.template.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
{% extends "api/api.template.html" %}
33

44
{% block additional %}
5-
<h2>Usage</h2>
5+
<h2 id="usage">Usage</h2>
66
<h3>In HTML Template Binding</h3>
77
{% if doc.usage %}
88
{$ doc.usage | code $}

docs/content/guide/directive.ngdoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -977,7 +977,7 @@ controllers using `require`.
977977
Otherwise use `link`.
978978
</div>
979979

980-
### Summary
980+
## Summary
981981

982982
Here we've seen the main use cases for directives. Each of these samples acts as a good starting
983983
point for creating your own directives.

docs/content/guide/migration.ngdoc

+3-19
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,6 @@ which drives many of these changes.
1515
* Several new features, especially animations, would not be possible without a few changes.
1616
* Finally, some outstanding bugs were best fixed by changing an existing API.
1717

18-
19-
20-
## Contents
21-
22-
<ul class="nav nav-list">
23-
<li>{@link guide/migration#migrating-from-1-5-to-1-6 Migrating from 1.5 to 1.6}</li>
24-
<li>{@link guide/migration#migrating-from-1-4-to-1-5 Migrating from 1.4 to 1.5}</li>
25-
<li>{@link guide/migration#migrating-from-1-3-to-1-4 Migrating from 1.3 to 1.4}</li>
26-
<li>{@link guide/migration#migrating-from-1-2-to-1-3 Migrating from 1.2 to 1.3}</li>
27-
<li>{@link guide/migration#migrating-from-1-0-to-1-2 Migrating from 1.0 to 1.2}</li>
28-
</ul>
29-
30-
31-
32-
33-
3418
## Migrating from 1.5 to 1.6
3519

3620
AngularJS 1.6 fixes numerous bugs and adds new features, both in core and in external modules.
@@ -1405,7 +1389,7 @@ always assumed to be of type 'string', so passing non-string values never worked
14051389
The main difference is that now it will fail faster and with a more informative error message.
14061390

14071391

1408-
## ngTouch (`ngClick`)
1392+
### ngTouch (`ngClick`)
14091393

14101394
Due to [0dfc1dfe](https://github.com/angular/angular.js/commit/0dfc1dfebf26af7f951f301c4e3848ac46f05d7f),
14111395
the `ngClick` override directive from the `ngTouch` module is **deprecated and disabled by default**.
@@ -1567,7 +1551,7 @@ class based animations (animations triggered via ngClass) in order to ensure tha
15671551

15681552

15691553

1570-
### Forms (`ngMessages`, `ngOptions`, `select`, `ngPattern` and `pattern`)
1554+
### Forms (`ngMessages`, `ngOptions`, `select`, `ngPattern` and `pattern`, `form`)
15711555

15721556
#### ngMessages
15731557
The ngMessages module has also been subject to an internal refactor to allow it to be more flexible
@@ -1749,7 +1733,7 @@ the built-in pattern validator:
17491733
```
17501734

17511735

1752-
### form
1736+
#### form
17531737

17541738
Due to [94533e57](https://github.com/angular/angular.js/commit/94533e570673e6b2eb92073955541fa289aabe02),
17551739
the `name` attribute of `form` elements can now only contain characters that can be evaluated as part

docs/content/misc/contribute.ngdoc

-8
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,6 @@ explains the basic mechanics of using `git`, `node`, `yarn`, `grunt`, and `bower
1010
See the [contributing guidelines](https://github.com/angular/angular.js/blob/master/CONTRIBUTING.md)
1111
for how to contribute your own code to AngularJS.
1212

13-
14-
1. {@link misc/contribute#installing-dependencies Installing Dependencies}
15-
2. {@link misc/contribute#forking-angularjs-on-github Forking AngularJS on Github}
16-
3. {@link misc/contribute#building-angularjs Building AngularJS}
17-
4. {@link misc/contribute#running-a-local-development-web-server Running a Local Development Web Server}
18-
5. {@link misc/contribute#running-the-unit-test-suite Running the Unit Test Suite}
19-
6. {@link misc/contribute#running-the-end-to-end-test-suite Running the End-to-end Test Suite}
20-
2113
## Installing Dependencies
2214

2315
Before you can build AngularJS, you must install and configure the following dependencies on your

docs/content/misc/started.ngdoc

+4-4
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ becoming an AngularJS expert.
1616
starter app with a directory layout, test harness, and scripts to begin building your application.
1717

1818

19-
# Further Steps
19+
## Further Steps
2020

21-
## Watch Videos
21+
### Watch Videos
2222

2323
If you haven’t had a chance to watch the videos from the homepage, please check out:
2424

@@ -29,13 +29,13 @@ If you haven’t had a chance to watch the videos from the homepage, please chec
2929
And visit our [YouTube channel](http://www.youtube.com/user/angularjs) for more AngularJS video presentations and
3030
tutorials.
3131

32-
## Subscribe
32+
### Subscribe
3333

3434
* Subscribe to the [mailing list](http://groups.google.com/forum/?fromgroups#!forum/angular). Ask questions here!
3535
* Follow us on [Twitter](https://twitter.com/intent/follow?original_referer=http%3A%2F%2Fangularjs.org%2F&region=follow_link&screen_name=angular&source=followbutton&variant=2.0)
3636
* Add us to your circles on [Google+](https://plus.google.com/110323587230527980117/posts)
3737

38-
## Read more
38+
### Read more
3939

4040
The AngularJS documentation includes the {@link guide/index Developer Guide} covering concepts and the
4141
{@link ./api API Reference} for syntax and usage.

src/Angular.js

-2
Original file line numberDiff line numberDiff line change
@@ -112,13 +112,11 @@
112112
* @installation
113113
* @description
114114
*
115-
* # ng (core module)
116115
* The ng module is loaded by default when an AngularJS application is started. The module itself
117116
* contains the essential components for an AngularJS application to function. The table below
118117
* lists a high level breakdown of each of the services/factories, filters, directives and testing
119118
* components available within this core module.
120119
*
121-
* <div doc-module-components="ng"></div>
122120
*/
123121

124122
var REGEX_STRING_REGEXP = /^\/(.+)\/([a-z]*)$/;

src/auto/injector.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ function annotate(fn, strictDi, name) {
147147
* })).toBe($injector);
148148
* ```
149149
*
150-
* # Injection Function Annotation
150+
* ## Injection Function Annotation
151151
*
152152
* JavaScript does not have annotations, and annotations are needed for dependency injection. The
153153
* following are all valid ways of annotating function with injection arguments and are equivalent.
@@ -165,18 +165,18 @@ function annotate(fn, strictDi, name) {
165165
* $injector.invoke(['serviceA', function(serviceA){}]);
166166
* ```
167167
*
168-
* ## Inference
168+
* ### Inference
169169
*
170170
* In JavaScript calling `toString()` on a function returns the function definition. The definition
171171
* can then be parsed and the function arguments can be extracted. This method of discovering
172172
* annotations is disallowed when the injector is in strict mode.
173173
* *NOTE:* This does not work with minification, and obfuscation tools since these tools change the
174174
* argument names.
175175
*
176-
* ## `$inject` Annotation
176+
* ### `$inject` Annotation
177177
* By adding an `$inject` property onto a function the injection parameters can be specified.
178178
*
179-
* ## Inline
179+
* ### Inline
180180
* As an array of injection names, where the last item in the array is the function to call.
181181
*/
182182

@@ -264,7 +264,7 @@ function annotate(fn, strictDi, name) {
264264
* function is invoked. There are three ways in which the function can be annotated with the needed
265265
* dependencies.
266266
*
267-
* # Argument names
267+
* ## Argument names
268268
*
269269
* The simplest form is to extract the dependencies from the arguments of the function. This is done
270270
* by converting the function into a string using `toString()` method and extracting the argument
@@ -284,7 +284,7 @@ function annotate(fn, strictDi, name) {
284284
* This method does not work with code minification / obfuscation. For this reason the following
285285
* annotation strategies are supported.
286286
*
287-
* # The `$inject` property
287+
* ## The `$inject` property
288288
*
289289
* If a function has an `$inject` property and its value is an array of strings, then the strings
290290
* represent names of services to be injected into the function.
@@ -300,7 +300,7 @@ function annotate(fn, strictDi, name) {
300300
* expect(injector.annotate(MyController)).toEqual(['$scope', '$route']);
301301
* ```
302302
*
303-
* # The array notation
303+
* ## The array notation
304304
*
305305
* It is often desirable to inline Injected functions and that's when setting the `$inject` property
306306
* is very inconvenient. In these situations using the array notation to specify the dependencies in

src/ng/compile.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,7 @@
531531
* $sce#getTrustedResourceUrl $sce.getTrustedResourceUrl}.
532532
*
533533
*
534-
* #### `replace` ([*DEPRECATED*!]
534+
* #### `replace` (*DEPRECATED*)
535535
*
536536
* `replace` will be removed in next major release - i.e. v2.0).
537537
*

src/ng/q.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* $q can be used in two fashions --- one which is more similar to Kris Kowal's Q or jQuery's Deferred
1616
* implementations, and the other which resembles ES6 (ES2015) promises to some degree.
1717
*
18-
* # $q constructor
18+
* ## $q constructor
1919
*
2020
* The streamlined ES6 style promise is essentially just using $q as a constructor which takes a `resolver`
2121
* function as the first argument. This is similar to the native Promise implementation from ES6,
@@ -103,7 +103,7 @@
103103
* For more on this please see the [Q documentation](https://github.com/kriskowal/q) especially the
104104
* section on serial or parallel joining of promises.
105105
*
106-
* # The Deferred API
106+
* ## The Deferred API
107107
*
108108
* A new instance of deferred is constructed by calling `$q.defer()`.
109109
*
@@ -125,7 +125,7 @@
125125
* - promise – `{Promise}` – promise object associated with this deferred.
126126
*
127127
*
128-
* # The Promise API
128+
* ## The Promise API
129129
*
130130
* A new promise instance is created when a deferred instance is created and can be retrieved by
131131
* calling `deferred.promise`.
@@ -157,7 +157,7 @@
157157
* specification](https://github.com/kriskowal/q/wiki/API-Reference#promisefinallycallback) for
158158
* more information.
159159
*
160-
* # Chaining promises
160+
* ## Chaining promises
161161
*
162162
* Because calling the `then` method of a promise returns a new derived promise, it is easily
163163
* possible to create a chain of promises:
@@ -177,7 +177,7 @@
177177
* $http's response interceptors.
178178
*
179179
*
180-
* # Differences between Kris Kowal's Q and $q
180+
* ## Differences between Kris Kowal's Q and $q
181181
*
182182
* There are two main differences:
183183
*
@@ -187,7 +187,7 @@
187187
* - Q has many more features than $q, but that comes at a cost of bytes. $q is tiny, but contains
188188
* all the important functionality needed for common async tasks.
189189
*
190-
* # Testing
190+
* ## Testing
191191
*
192192
* ```js
193193
* it('should simulate promise', inject(function($q, $rootScope) {

src/ng/rootScope.js

+6-7
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ function $RootScopeProvider() {
143143
* an in-depth introduction and usage examples.
144144
*
145145
*
146-
* # Inheritance
146+
* ## Inheritance
147147
* A scope can inherit from a parent scope, as in this example:
148148
* ```js
149149
var parent = $rootScope;
@@ -318,7 +318,7 @@ function $RootScopeProvider() {
318318
*
319319
*
320320
*
321-
* # Example
321+
* #### Example
322322
* ```js
323323
// let's assume that scope was dependency injected as the $rootScope
324324
var scope = $rootScope;
@@ -541,7 +541,7 @@ function $RootScopeProvider() {
541541
* adding, removing, and moving items belonging to an object or array.
542542
*
543543
*
544-
* # Example
544+
* #### Example
545545
* ```js
546546
$scope.names = ['igor', 'matias', 'misko', 'james'];
547547
$scope.dataCount = 4;
@@ -743,7 +743,7 @@ function $RootScopeProvider() {
743743
*
744744
* In unit tests, you may need to call `$digest()` to simulate the scope life cycle.
745745
*
746-
* # Example
746+
* #### Example
747747
* ```js
748748
var scope = ...;
749749
scope.name = 'misko';
@@ -972,7 +972,7 @@ function $RootScopeProvider() {
972972
* the expression are propagated (uncaught). This is useful when evaluating AngularJS
973973
* expressions.
974974
*
975-
* # Example
975+
* #### Example
976976
* ```js
977977
var scope = ng.$rootScope.Scope();
978978
scope.a = 1;
@@ -1054,9 +1054,8 @@ function $RootScopeProvider() {
10541054
* cycle of {@link ng.$exceptionHandler exception handling},
10551055
* {@link ng.$rootScope.Scope#$digest executing watches}.
10561056
*
1057-
* ## Life cycle
1057+
* **Life cycle: Pseudo-Code of `$apply()`**
10581058
*
1059-
* # Pseudo-Code of `$apply()`
10601059
* ```js
10611060
function $apply(expr) {
10621061
try {

src/ng/sce.js

+9-9
Original file line numberDiff line numberDiff line change
@@ -463,13 +463,13 @@ function $SceDelegateProvider() {
463463
*
464464
* `$sce` is a service that provides Strict Contextual Escaping services to AngularJS.
465465
*
466-
* # Strict Contextual Escaping
466+
* ## Strict Contextual Escaping
467467
*
468468
* Strict Contextual Escaping (SCE) is a mode in which AngularJS constrains bindings to only render
469469
* trusted values. Its goal is to assist in writing code in a way that (a) is secure by default, and
470470
* (b) makes auditing for security vulnerabilities such as XSS, clickjacking, etc. a lot easier.
471471
*
472-
* ## Overview
472+
* ### Overview
473473
*
474474
* To systematically block XSS security bugs, AngularJS treats all values as untrusted by default in
475475
* HTML or sensitive URL bindings. When binding untrusted values, AngularJS will automatically
@@ -485,7 +485,7 @@ function $SceDelegateProvider() {
485485
*
486486
* As of version 1.2, AngularJS ships with SCE enabled by default.
487487
*
488-
* ## In practice
488+
* ### In practice
489489
*
490490
* Here's an example of a binding in a privileged context:
491491
*
@@ -522,7 +522,7 @@ function $SceDelegateProvider() {
522522
* (and shorthand methods such as {@link ng.$sce#trustAsHtml $sce.trustAsHtml}, etc.) to
523523
* build the trusted versions of your values.
524524
*
525-
* ## How does it work?
525+
* ### How does it work?
526526
*
527527
* In privileged contexts, directives and code will bind to the result of {@link ng.$sce#getTrusted
528528
* $sce.getTrusted(context, value)} rather than to the value directly. Think of this function as
@@ -546,7 +546,7 @@ function $SceDelegateProvider() {
546546
* }];
547547
* ```
548548
*
549-
* ## Impact on loading templates
549+
* ### Impact on loading templates
550550
*
551551
* This applies both to the {@link ng.directive:ngInclude `ng-include`} directive as well as
552552
* `templateUrl`'s specified by {@link guide/directive directives}.
@@ -566,7 +566,7 @@ function $SceDelegateProvider() {
566566
* won't work on all browsers. Also, loading templates from `file://` URL does not work on some
567567
* browsers.
568568
*
569-
* ## This feels like too much overhead
569+
* ### This feels like too much overhead
570570
*
571571
* It's important to remember that SCE only applies to interpolation expressions.
572572
*
@@ -590,7 +590,7 @@ function $SceDelegateProvider() {
590590
* security onto an application later.
591591
*
592592
* <a name="contexts"></a>
593-
* ## What trusted context types are supported?
593+
* ### What trusted context types are supported?
594594
*
595595
* | Context | Notes |
596596
* |---------------------|----------------|
@@ -606,7 +606,7 @@ function $SceDelegateProvider() {
606606
* in AngularJS currently, so their corresponding `$sce.trustAs` functions aren't useful yet. This
607607
* might evolve.
608608
*
609-
* ## Format of items in {@link ng.$sceDelegateProvider#resourceUrlWhitelist resourceUrlWhitelist}/{@link ng.$sceDelegateProvider#resourceUrlBlacklist Blacklist} <a name="resourceUrlPatternItem"></a>
609+
* ### Format of items in {@link ng.$sceDelegateProvider#resourceUrlWhitelist resourceUrlWhitelist}/{@link ng.$sceDelegateProvider#resourceUrlBlacklist Blacklist} <a name="resourceUrlPatternItem"></a>
610610
*
611611
* Each element in these arrays must be one of the following:
612612
*
@@ -653,7 +653,7 @@ function $SceDelegateProvider() {
653653
*
654654
* Refer {@link ng.$sceDelegateProvider $sceDelegateProvider} for an example.
655655
*
656-
* ## Show me an example using SCE.
656+
* ### Show me an example using SCE.
657657
*
658658
* <example module="mySceApp" deps="angular-sanitize.js" name="sce-service">
659659
* <file name="index.html">

src/ngAnimate/module.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@
88
* The `ngAnimate` module provides support for CSS-based animations (keyframes and transitions) as well as JavaScript-based animations via
99
* callback hooks. Animations are not enabled by default, however, by including `ngAnimate` the animation hooks are enabled for an AngularJS app.
1010
*
11-
* <div doc-module-components="ngAnimate"></div>
12-
*
13-
* # Usage
11+
* ## Usage
1412
* Simply put, there are two ways to make use of animations when ngAnimate is used: by using **CSS** and **JavaScript**. The former works purely based
1513
* using CSS (by using matching CSS selectors/styles) and the latter triggers animations that are registered via `module.animation()`. For
1614
* both CSS and JS animations the sole requirement is to have a matching `CSS class` that exists both in the registered animation and within

0 commit comments

Comments
 (0)