Skip to content

Commit ab8c185

Browse files
committed
add index to docs
1 parent 3b24cc0 commit ab8c185

File tree

4 files changed

+21
-3
lines changed

4 files changed

+21
-3
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ This plugin provides an extensible API to manage feature detection. It also impl
4848
See [docs/has.md](./docs/has.md) and [samples/has.html](./samples/has.html) for documentation and sample.
4949

5050
## i18n
51-
This plugin provides provides an API to handle string translation.
51+
This plugin provides an API to handle string translation.
5252

5353
See [docs/i18n.md](./docs/i18n.md) and [samples/i18n.html](./samples/i18n.html) for documentation and sample.
5454

docs/has.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ Note: This plugin does NOT include any feature tests.
1818
[Use as module](#use-as-module)
1919
[Use as plugin](#use-as-plugin)
2020

21+
<a name="features"></a>
2122
## Features
2223

2324
* __lazy evaluation__: Tests are only evaluated when they are required by the application.
@@ -26,6 +27,7 @@ Note: This plugin does NOT include any feature tests.
2627
flag.
2728
* __requirejs plugin__: Use ternary operator to conditionally load modules.
2829

30+
<a name="adding-tests"></a>
2931
## Adding tests
3032

3133
Since the plugin itself does not include any tests, the first thing to do is add one.
@@ -73,6 +75,7 @@ require.config({
7375
});
7476
```
7577

78+
<a name="use-as-module"></a>
7679
## Use as module
7780
To access the tests, the plugin exports a main function taking a test name as argument and returning the test result.
7881

@@ -85,6 +88,7 @@ define(["requirejs-dplugins/has"], function (has) {
8588
});
8689
```
8790

91+
<a name="use-as-plugin"></a>
8892
## Use as plugin
8993
Ternary operator can be used to conditionally load modules. It uses the following syntax:
9094

docs/i18n.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ title: requirejs-dplugins/i18n
1414
[Using an i18n bundle](#using-an-i18n-bundle)
1515
[Building i18n bundles](#building-i18n-bundles)
1616

17+
<a name="differences-with-requirejs-i18n-plugin"></a>
1718
## Differences with RequireJS i18n plugin
1819

1920
If an application is not built, this plugin will behave exactly like RequireJS i18n plugin.
@@ -24,7 +25,7 @@ While RequireJS i18n plugin adds bundles of a specified locale to the layer,
2425
plugin will then load the appropriate nls layer depending on the user locale.
2526

2627

27-
28+
<a name="creating-an-i18n-bundle"></a>
2829
## Creating an i18n bundle
2930

3031
Assume a `my` package, containing a `lamp` module. This module provides a string representing the color of the lamp.
@@ -133,7 +134,7 @@ require.config({
133134
they are found. For instance, when processing a `fr-fr-paris` bundle, the plugin looks into:
134135
`fr-fr-paris` > `fr-fr` > `fr` > `root`.
135136

136-
137+
<a name="using-an-i18n-bundle"></a>
137138
## Using an i18n bundle
138139

139140
Once the `nls` bundle is setup, the plugin can be used to load the bundle. There are two different ways to load a bundle:
@@ -151,6 +152,7 @@ define(["requirejs-plugins/i18n!./nls/colors"], function(colors) {
151152
```
152153

153154

155+
<a name="building-i18n-bundles"></a>
154156
## Building i18n bundles
155157

156158
This plugin is NOT compatible with r.js. The build tool recommended for an application using `requirejs-dplugins` is

docs/index.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
layout: doc
3+
---
4+
Requirejs-dplugins provides a set of AMD plugins compatible with requirejs.
5+
6+
## Plugins
7+
8+
* [css](css.md) - load and wait for a css file.
9+
* [has](has.md) - provides conditional module loading and feature detection.
10+
* [i18n](i18n.md) - provides an API to handle string translation.
11+
* [jquery](jquery.md) - loads the jquery modules if they are not loaded already.
12+
* [maybe](maybe.md) - requires modules that may or may not exist.

0 commit comments

Comments
 (0)