Skip to content

Commit

Permalink
Mostly a bunch of s/which/that/
Browse files Browse the repository at this point in the history
  • Loading branch information
tilgovi committed Apr 25, 2015
1 parent 972d597 commit 33b9bb3
Show file tree
Hide file tree
Showing 19 changed files with 114 additions and 131 deletions.
4 changes: 2 additions & 2 deletions doc/api/app.rst
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ annotator package

.. function:: annotator.App.extend(object)

Create a new object which inherits from the App class.
Create a new object that inherits from the App class.

For example, here we create a ``CustomApp`` which will include the
For example, here we create a ``CustomApp`` that will include the
hypothetical ``mymodules.foo.bar`` module depending on the options object
passed into the constructor::
Expand Down
2 changes: 1 addition & 1 deletion doc/api/notification.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ annotator.notifier package
`notification.SUCCESS`, or `notification.ERROR`)

:returns:
An object with a `close` method which can be used to close the banner.
An object with a `close` method that can be used to close the banner.


49 changes: 17 additions & 32 deletions doc/api/registry.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,39 +7,24 @@ annotator.registry package

`Registry` is an application registry. It serves as a place to register and
find shared components in a running :class:`annotator.App`.

You won't usually create your own `Registry` -- one will be created for you
by the :class:`~annotator.App`. If you are writing an Annotator module, there
are, broadly, two main scenarios in which you will need to interact with the
registry.

1. If you are writing a module which overrides some default component, such
as the "storage" component, you will use the registry in your module's
`configure` function to register your component::

function myStorage () {
return {
configure: function (registry) {
registry.registerUtility(this, 'storage');
},
...
};
}

2. If your module needs to interact with some of the core components of the
`App`, then you will find these exposed on the `Registry` instance. For
example, if your module needs to send a notification when the application
starts, you can use the "notifier" component which is exposed as the
``notify()`` function on the registry::

function myModule () {
return {
start: function (registry) {
registry.notify("Hello, world!");
},
...
};
}
by the :class:`~annotator.App`. If you are writing an Annotator module, you
can use the registry to provide or override a component of the Annotator
application.

For example, if you are writing a module that overrides the "storage"
component, you will use the registry in your module's `configure` function to
register your component::
function myStorage () {
return {
configure: function (registry) {
registry.registerUtility(this, 'storage');
},
...
};
}


.. function:: annotator.registry.Registry.prototype.registerUtility(component, iface)
Expand Down

0 comments on commit 33b9bb3

Please sign in to comment.