Skip to content

Commit ce13451

Browse files
author
Derick Bailey
committed
more documentation cleanup
1 parent e492093 commit ce13451

16 files changed

+110
-108
lines changed

docs/marionette.application.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## Marionette.Application
1+
# Marionette.Application
22

33
The `Backbone.Marionette.Application` object is the hub of your composite
44
application. It organizes, initializes and coordinate the various pieces of your
@@ -13,7 +13,7 @@ it to add your own functionality.
1313
MyApp = new Backbone.Marionette.Application();
1414
```
1515

16-
### Adding Initializers
16+
## Adding Initializers
1717

1818
Your application needs to do useful things, like displaying content in your
1919
regions, starting up your routers, and more. To accomplish these tasks and
@@ -47,7 +47,7 @@ add them to the app object. If you add them before the app is
4747
started, they will run when the `start` method is called. If you
4848
add them after the app is started, they will run immediately.
4949

50-
### Application Event
50+
## Application Event
5151

5252
The `Application` object raises a few events during its lifecycle. These events
5353
can be used to do additional processing of your application. For example, you
@@ -76,7 +76,7 @@ MyApp.bind("initialize:after", function(options){
7676
The `options` parameter is passed through the `start` method of the application
7777
object (see below).
7878

79-
### Starting An Application
79+
## Starting An Application
8080

8181
Once you have your application configured, you can kick everything off by
8282
calling: `MyApp.start(options)`.
@@ -95,7 +95,7 @@ var options = {
9595
MyApp.start(options);
9696
```
9797

98-
### app.vent: Event Aggregator
98+
## app.vent: Event Aggregator
9999

100100
Every application instance comes with an instance of `Marionette.EventAggregator`
101101
called `app.vent`.

docs/marionette.application.module.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## Marionette.Application.module
1+
# Marionette.Application.module
22

33
Marionette allows you to define a module within your application,
44
including sub-modules hanging from that module. This is useful for creating
@@ -8,7 +8,7 @@ files.
88
Marionette's module allow you to have unlimited sub-modules hanging off
99
your application, and serve as an event aggregator in themselves.
1010

11-
### Basic Usage
11+
## Basic Usage
1212

1313
A module is defined directly from an Application object as the specified
1414
name:
@@ -27,7 +27,7 @@ If you specify the same module name more than once, the
2727
first instance of the module will be retained and a new
2828
instance will not be created.
2929

30-
### Defining Sub-Modules With . Notation
30+
## Defining Sub-Modules With . Notation
3131

3232
Sub-modules or child modules can be defined as a hierarchy of modules and
3333
sub-modules all at once:
@@ -45,7 +45,7 @@ parent modules do not need to exist. They will be created
4545
for you if they don't exist. If they do exist, though, the
4646
existing module will be used instead of creating a new one.
4747

48-
### Module Definitions
48+
## Module Definitions
4949

5050
You can specify a callback function to provide a definition
5151
for the module. Module definitions are invoked immediately
@@ -92,7 +92,7 @@ console.log(MyApp.MyModule.someData); //=> public data
9292
MyApp.MyModule.someFunction(); //=> public data
9393
```
9494

95-
### The Module's `this` Argument
95+
## The Module's `this` Argument
9696

9797
The module's `this` argument is set to the module itself.
9898

@@ -102,7 +102,7 @@ MyApp.module("Foo", function(Foo){
102102
});
103103
```
104104

105-
### Custom Arguments
105+
## Custom Arguments
106106

107107
You can provide any number of custom arguments to your module, after the
108108
module definition function. This will allow you to import 3rd party
@@ -119,7 +119,7 @@ MyApp.module("MyModule", function(MyModule, MyApp, Backbone, Marionette, $, _, L
119119
}, LibraryNumber1, LibraryNumber2, LibraryNumberEtc);
120120
```
121121

122-
### Splitting A Module Definition Apart
122+
## Splitting A Module Definition Apart
123123

124124
Sometimes a module gets to be too long for a single file. In
125125
this case, you can split a module definition across multiple

docs/marionette.approuter.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
## Marionette.AppRouter
1+
# Marionette.AppRouter
22

33
Reduce the boilerplate code of handling route events and then calling a single method on another object.
44
Have your routers configured to call the method on your object, directly.
55

6-
### Configure Routes
6+
## Configure Routes
77

88
Configure an AppRouter with `appRoutes`. The route definition is passed on to Backbone's standard routing
99
handlers. This means that you define routes like you normally would. Instead of providing a callback
@@ -20,7 +20,7 @@ MyRouter = Backbone.Marionette.AppRouter.extend({
2020

2121
You can also add standard routes to an AppRouter, with methods on the router.
2222

23-
### Specify A Controller
23+
## Specify A Controller
2424

2525
App routers can only use one `controller` object. You can either specify this
2626
directly in the router definition:

docs/marionette.async.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## Marionette.Async
1+
# Marionette.Async
22

33
Add async / deferred rendering and template loading to Backbone.Marionette
44

@@ -12,7 +12,7 @@ Development: [backbone.marionette.async.js](https://raw.github.com/derickbailey/
1212

1313
Production: [backbone.marionette.async.min.js](https://raw.github.com/derickbailey/backbone.marionette/master/lib/backbone.marionette.async.min.js)
1414

15-
### AMD/RequireJS Support
15+
## AMD/RequireJS Support
1616

1717
Note that there is no AMD/RequireJS build for Marionette.Async.
1818
AMD/RequireJS are asynchronous by definition: **A**synchronous

docs/marionette.bindto.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
## Marionette.BindTo
1+
# Marionette.BindTo
22

33
The `BindTo` object provides event binding management and facilitates simple
44
event binding and unbinding for any object that extends from `Backbone.Events`.
55

6-
### Bind Events
6+
## Bind Events
77

88
```js
99
var binder = _.extend({}, Backbone.Marionette.BindTo);
@@ -23,7 +23,7 @@ method for the event will be executed:
2323
binder.bindTo(model, "change:foo", someCallback, someContext);
2424
```
2525

26-
### Unbind A Single Event
26+
## Unbind A Single Event
2727

2828
When you call `bindTo`, it returns a "binding" object that can be
2929
used to unbind from a single event with the `unbindFrom` method:
@@ -38,7 +38,7 @@ binder.unbindFrom(binding);
3838
This will unbind the event that was configured with the binding
3939
object, and remove it from the BindTo bindings.
4040

41-
### Unbind All Events
41+
## Unbind All Events
4242

4343
You can call `unbindAll` to unbind all events that were bound with the
4444
`bindTo` method:

docs/marionette.callbacks.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## Marionette.Callbacks
1+
# Marionette.Callbacks
22

33
The `Callbacks` object assists in managing a collection of callback
44
methods, and executing them, in an async-safe manner.
@@ -14,7 +14,7 @@ The `run` method executes all current callbacks in, using the
1414
specified context for each of the callbacks, and supplying the
1515
provided options to the callbacks.
1616

17-
### Basic Usage
17+
## Basic Usage
1818

1919
```js
2020
var callbacks = new Backbone.Marionette.Callbacks();
@@ -31,7 +31,7 @@ with options!". The executing context for each of the callback
3131
methods has been set to the `someContext` object, which is an optional
3232
parameter that can be any valid JavaScript object.
3333

34-
### Specify Context Per-Callback
34+
## Specify Context Per-Callback
3535

3636
You can optionally specify the context that you want each callback to be
3737
executed with, when adding a callback:
@@ -53,7 +53,7 @@ callbacks.run({value: "options"}, someContext);
5353
This will run the specified callback with the `myContext` object set as
5454
`this` in the callback, instead of `someContext`.
5555

56-
### Advanced / Async Use
56+
## Advanced / Async Use
5757

5858
The `Callbacks` executes each callback in an async-friendly
5959
manner, and can be used to facilitate async callbacks.

docs/marionette.collectionview.md

+21-21
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
## Marionette.CollectionView
1+
# Marionette.CollectionView
22

33
The `CollectionView` will loop through all of the models in the
44
specified collection, render each of them using a specified `itemView`,
55
then append the results of the item view's `el` to the collection view's
66
`el`.
77

8-
### CollectionView's `itemView`
8+
## CollectionView's `itemView`
99

1010
Specify an `itemView` in your collection view definition. This must be
1111
a Backbone view object definition (not instance). It can be any
@@ -33,7 +33,7 @@ new MyCollectionView({
3333
If you do not specify an `itemView`, an exception will be thrown
3434
stating that you must specify an `itemView`.
3535

36-
### CollectionView's `itemViewOptions`
36+
## CollectionView's `itemViewOptions`
3737

3838
There may be scenarios where you need to pass data from your parent
3939
collection view in to each of the itemView instances. To do this, provide
@@ -62,7 +62,7 @@ calculate the values to return at runtime. The function must return an
6262
object, and the attributes of the object will be copied to the itemView
6363
instance' options.
6464

65-
### CollectionView's `emptyView`
65+
## CollectionView's `emptyView`
6666

6767
When a collection has no items, and you need to render a view other than
6868
the list of itemViews, you can specify an `emptyView` attribute on your
@@ -83,14 +83,14 @@ Backbone.Marionette.CollectionView.extend({
8383
This will render the `emptyView` and display the message that needs to
8484
be displayed when there are no items.
8585

86-
### Callback Methods
86+
## Callback Methods
8787

8888
There are several callback methods that can be provided on a
8989
`CollectionView`. If they are found, they will be called by the
9090
view's base methods. These callback methods are intended to be
9191
handled within the view definition directly.
9292

93-
#### beforeRender callback
93+
### beforeRender callback
9494

9595
A `beforeRender` callback will be called just prior to rendering
9696
the collection view.
@@ -103,7 +103,7 @@ Backbone.Marionette.CollectionView.extend({
103103
});
104104
```
105105

106-
#### onRender callback
106+
### onRender callback
107107

108108
After the view has been rendered, a `onRender` method will be called.
109109
You can implement this in your view to provide custom code for dealing
@@ -117,7 +117,7 @@ Backbone.Marionette.CollectionView.extend({
117117
});
118118
```
119119

120-
#### onItemAdded callback
120+
### onItemAdded callback
121121

122122
This callback function allows you to know when an item / item view
123123
instance has been added to the collection view. It provides access to
@@ -131,7 +131,7 @@ Backbone.Marionette.CollectionView.extend({
131131
});
132132
```
133133

134-
#### beforeClose callback
134+
### beforeClose callback
135135

136136
This method is called just before closing the view.
137137

@@ -143,7 +143,7 @@ Backbone.Marionette.CollectionView.extend({
143143
});
144144
```
145145

146-
#### onClose callback
146+
### onClose callback
147147

148148
This method is called just after closing the view.
149149

@@ -155,13 +155,13 @@ Backbone.Marionette.CollectionView.extend({
155155
});
156156
```
157157

158-
### CollectionView Events
158+
## CollectionView Events
159159

160160
There are several events that will be triggered during the life
161161
of a collection view. These are intended to be handled from code
162162
external to the view.
163163

164-
#### "collection:before:render" event
164+
### "collection:before:render" event
165165

166166
Triggers just prior to the view being rendered
167167

@@ -177,7 +177,7 @@ myView.on("collection:before:render", function(){
177177
myView.render();
178178
```
179179

180-
#### "render" / "collection:rendered" event
180+
### "render" / "collection:rendered" event
181181

182182
A "collection:rendered" event will also be fired. This allows you to
183183
add more than one callback to execute after the view is rendered,
@@ -200,7 +200,7 @@ myView.on("collection:rendered", function(){
200200
myView.render();
201201
```
202202

203-
#### "collection:before:close" event
203+
### "collection:before:close" event
204204

205205
Triggered just before closing the view.
206206

@@ -216,7 +216,7 @@ myView.on("collection:before:close", function(){
216216
myView.close();
217217
```
218218

219-
#### "collection:closed" event
219+
### "collection:closed" event
220220

221221
Triggered just after closing the view.
222222

@@ -232,7 +232,7 @@ myView.on("collection:closed", function(){
232232
myView.close();
233233
```
234234

235-
#### "itemview:\*" event bubbling from child views
235+
### "itemview:\*" event bubbling from child views
236236

237237
When an item view within a collection view triggers an
238238
event, that event will bubble up through the parent
@@ -275,7 +275,7 @@ Normally, you would have your item view listening to DOM
275275
events or model change events, and then triggering an event
276276
of it's own based on that.
277277

278-
### CollectionView render
278+
## CollectionView render
279279

280280
The `render` method of the collection view is responsible for
281281
rendering the entire collection. It loops through each of the
@@ -290,7 +290,7 @@ new MyCollectionView().render().done(function(){
290290
});
291291
```
292292

293-
### CollectionView: Automatic Rendering
293+
## CollectionView: Automatic Rendering
294294

295295
The collection view binds to the "add", "remove" and "reset" events of the
296296
collection that is specified.
@@ -304,13 +304,13 @@ one model in to the collection of item views.
304304
When a model is removed from a collection (or destroyed / deleted), the collection
305305
view will close and remove that model's item view.
306306

307-
### CollectionView: Re-render Collection
307+
## CollectionView: Re-render Collection
308308

309309
If you need to re-render the entire collection, you can call the
310310
`view.render` method. This method takes care of closing all of
311311
the child views that may have previously been opened.
312312

313-
### CollectionView's appendHtml
313+
## CollectionView's appendHtml
314314

315315
By default the collection view will call jQuery's `.append` to
316316
move the HTML contents from the item view instance in to the collection
@@ -332,7 +332,7 @@ The first parameter is the instance of the collection view that
332332
will receive the HTML from the second parameter, the current item
333333
view instance.
334334

335-
### CollectionView close
335+
## CollectionView close
336336

337337
CollectionView implements a `close` method, which is called by the
338338
region managers automatically. As part of the implementation, the

0 commit comments

Comments
 (0)