Skip to content

Commit cd2287e

Browse files
committed
docs(api): fix markdown listing issues
1 parent 9e11195 commit cd2287e

File tree

3 files changed

+22
-21
lines changed

3 files changed

+22
-21
lines changed

src/content/api/compilation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ compilation.plugin('optimize-tree', function(chunks, modules) {
6060
});
6161
```
6262

63-
#### `optimize-modules(modules: Module[])`
63+
### `optimize-modules(modules: Module[])`
6464

6565
Optimize the modules.
6666

src/content/api/plugins.md

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -56,16 +56,19 @@ plugins: [
5656

5757
There are two types of plugin interfaces.
5858

59-
* Timing based
60-
* sync (default): As seen above. Use return.
61-
* async: Last parameter is a callback. Signature: function(err, result)
62-
* parallel: The handlers are invoked parallel (async).
63-
64-
* Return value
65-
* not bailing (default): No return value.
66-
* bailing: The handlers are invoked in order until one handler returns something.
67-
* parallel bailing: The handlers are invoked in parallel (async). The first returned value (by order) is significant.
68-
* waterfall: Each handler gets the result value of the last handler as an argument.
59+
__Timing Based:__
60+
61+
- sync (default): As seen above. Use return.
62+
- async: Last parameter is a callback. Signature: function(err, result)
63+
- parallel: The handlers are invoked parallel (async).
64+
65+
__Return Value:__
66+
67+
- not bailing (default): No return value.
68+
- bailing: The handlers are invoked in order until one handler returns something.
69+
- parallel bailing: The handlers are invoked in parallel (async). The first returned value (by order) is significant.
70+
- waterfall: Each handler gets the result value of the last handler as an argument.
71+
6972

7073
## Tapable & Tapable instances
7174

src/content/api/tapable.md

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,17 @@ contributors:
1212

1313
`Tapable` has four groups of member functions:
1414

15-
- `plugin(name:string, handler:function)` - This allows a custom plugin to register into a **Tapable instance**'s event.
16-
This acts as the same as `on()` of `EventEmitter`, for registering a handler/listener to do something when the signal/event happens.
17-
- `apply(…pluginInstances: (AnyPlugin|function)[])` - `AnyPlugin` should be a class (or, rarely, an object) that has an `apply` method, or just a function with some registration code inside. This method is just to **apply** plugins' definition, so that the real event listeners can be registered into the _Tapable_ instance's registry.
18-
- `applyPlugins*(name:string, …)` - The _Tapable_ instance can apply all the plugins under a particular hash using these functions.
19-
These group of method act like `emit()` of `EventEmitter`, to control the event emission meticulously with various strategy for various use cases.
20-
- `mixin(pt: Object)` - a simple method to extend `Tapable`'s prototype as a mixin rather than inheritance.
15+
- `plugin(name:string, handler:function)`: This allows a custom plugin to register into a **Tapable instance**'s event. This acts as the same as `on()` of `EventEmitter`, for registering a handler/listener to do something when the signal/event happens.
16+
- `apply(…pluginInstances: (AnyPlugin|function)[])`: `AnyPlugin` should be a class (or, rarely, an object) that has an `apply` method, or just a function with some registration code inside. This method is just to **apply** plugins' definition, so that the real event listeners can be registered into the _Tapable_ instance's registry.
17+
- `applyPlugins*(name:string, …)`: The _Tapable_ instance can apply all the plugins under a particular hash using these functions. These group of method act like `emit()` of `EventEmitter`, to control the event emission meticulously with various strategy for various use cases.
18+
- `mixin(pt: Object)`: a simple method to extend `Tapable`'s prototype as a mixin rather than inheritance.
2119

2220
The different `applyPlugins*` methods cover the following use cases:
2321

24-
- Plugins can run serially
25-
- Plugins can run in parallel
26-
- Plugins can run one after the other but taking input from the previous plugin (waterfall)
27-
- Plugins can run asynchronously
22+
- Plugins can run serially.
23+
- Plugins can run in parallel.
24+
- Plugins can run one after the other but taking input from the previous plugin (waterfall).
25+
- Plugins can run asynchronously.
2826
- Quit running plugins on bail: that is, once one plugin returns non-`undefined`, jump out of the run flow and return _the return of that plugin_. This sounds like `once()` of `EventEmitter` but is totally different.
2927

3028

0 commit comments

Comments
 (0)