Skip to content

Loading…

[docs] Cleaned up documentation (made copy edits) based on reviews. #833

Merged
merged 2 commits into from

1 participant

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 4, 2012
  1. @zhouyaoji

    Made copy edits.

    zhouyaoji committed
  2. @zhouyaoji
View
52 docs/dev_guide/intro/mojito_configuring.rst
@@ -550,7 +550,7 @@ In the example ``application.json`` below, the mojit instance ``father`` of type
Child Mojit With Children
#########################
-A parent mojit can have a single child that has its own children. The parent mojit
+A parent mojit can have a child that has its own children. The parent mojit
specifies a child with the ``child`` object, which in turn lists children in the
``children`` object. For the child to execute its children,it would use the ``Composite``
addon. See `Composite Mojits <../topics/mojito_composite_mojits.html#composite-mojits>`_
@@ -587,6 +587,48 @@ child ``son``, which has the children ``grandson`` and ``granddaughter``.
}
]
+The child mojits can also have their own children, but beware that
+having so many child mojits may cause memory issues. In our updated
+example ``application.json`` below, the ``grandaughter`` mojit now has
+its own children mojits:
+
+.. code-block:: javascript
+
+ [
+ {
+ "settings": [ "master" ],
+ "specs": {
+ "grandfather": {
+ "type": "GrandparentMojit",
+ "config": {
+ "child": {
+ "son": {
+ "type": "ChildMojit",
+ "children": {
+ "grandson": {
+ "type": "GrandchildMojit"
+ },
+ "grandaughter": {
+ "type": "GrandchildMojit",
+ "children": {
+ "girl_doll": {
+ "type": "GirlDollMojit"
+ },
+ "boy_doll": {
+ "type": "BoyDollMojit"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ ]
+
+
.. _deploy_app:
@@ -836,7 +878,7 @@ the ``index`` function in the controller of the ``Foo`` mojit.
.. _configure_mj-routing:
-routing
+Routing
=======
In Mojito, routing is the mapping of URLs to specific mojit actions. This section
@@ -1067,7 +1109,7 @@ Using Parameterized Paths to Call a Mojit Action
Your routing configuration can also use parameterized paths to call mojit
actions. In the ``routes.json`` below, the ``path`` property uses parameters
to capture a part of the matched URL and then uses that captured part to
-replace ``{{mojit-action}}`` in the value for the ``call``property. Any
+replace ``{{mojit-action}}`` in the value for the ``call`` property. Any
value can be used for the parameter as long as it is prepended with a
colon (e.g., ``:foo``). After the parameter has been replaced by a value
given in the path, the call to the action should have the following syntax:
@@ -1109,7 +1151,7 @@ The following URLs call the ``index`` and ``myAction`` functions in the controll
Using Regular Expressions to Match Routing Paths
------------------------------------------------
-You can use the ``regex`` property of the ``routing`` object to define a key-value
+You can use the ``regex`` property of a routing object to define a key-value
pair that defines a path parameter and a regular expression. The key is prepended
with a colon when represented as a path parameter. For example, the key ``name``
would be represented as ``:name`` as a path parameter: ``"path": "/:name"``.
@@ -1184,7 +1226,7 @@ Accessing Configurations from Mojits
The model and binder can access mojit configurations from the ``init``
function. The controller and model are passed ``configuration`` objects. The controller
-can access configuration the ``actionContext`` object and the ``Config`` addon.
+can access configuration with the ``Config`` addon.
The ``init`` function in the binder, instead of a configuration object, is passed the
``mojitProxy`` object, which enables you to access configurations.
View
2 docs/dev_guide/intro/mojito_mvc.rst
@@ -39,7 +39,7 @@ Models are found in the ``models`` directory of each mojit. For the application
Naming Convention
-----------------
-The name of the model files depend on the affinity, which is the location
+The name of the model file depend on the affinity, which is the location
where a resource is available. Thus, the name of the model file is
``{model_name}.{affinity}.js``, where ``{affinity}`` can be ``common``,
``server``, or ``client``.
View
6 docs/dev_guide/topics/mojito_extensions.rst
@@ -33,7 +33,7 @@ Addons allows you to do the following:
Creating New Addons
-------------------
-An addon is simply a JavaScript files that contains a YUI module. You can create
+An addon is simply a JavaScript file that contains a YUI module. You can create
addons at the application and mojit level. Application-level addons are
available to all mojits in the application, whereas, mojit-level addons are
only available to its mojit.
@@ -287,7 +287,7 @@ Libraries
Mojito allows you to use YUI libraries, external libraries, or customized
libraries. To use any library in Mojito, you need to specify the module in
-either the ``requires`` array in the controller for YUI libraries or using
+either the ``requires`` array in the controller for YUI libraries or by using
the ``require`` method for Node.js modules.
.. _extending_libraries-yui:
@@ -356,7 +356,7 @@ instance.
log: function(user_name){
Y.log(user_name + "'s UID is " + '['+this.uid+']');
}
- }
+ };
Y.namespace('mojito').UID = create_id;
});
View
14 docs/dev_guide/topics/mojito_logging.rst
@@ -21,9 +21,9 @@ Mojito has the following six log levels:
- ``error``
- ``none``
-All of them should be familiar except the last, which are framework-level messages that
-indicate that an important framework event is occurring (one that users might want to
-track).
+All of them should be familiar except ``mojito``, which is the logging level for
+capturing framework-level messages that indicate that an important framework event is
+occurring (one that users might want to track).
Setting a log level of ``warn`` will filter out all ``debug`` and ``info`` messages, while
``warn``, ``error``, and ``mojito`` log messages will be processed. To see all
@@ -38,8 +38,8 @@ The server and client log settings have the following default values:
- ``debug: true`` - turns logging on so that messages are displayed in the console.
- ``logLevel: "debug"`` - log level filter.
-- ``logLevelOrder: ['debug', 'mojito', 'info', 'warn', 'error', 'none']`` - the order of
- that log levels are evaluated.
+- ``logLevelOrder: ['debug', 'mojito', 'info', 'warn', 'error', 'none']`` - the order in
+ which the log levels are evaluated.
@@ -195,9 +195,9 @@ through ``NAME``, which in this case contains the value ``DemoBinderIndex``.
Customizing the Log Level Order
-------------------------------
-You can reorder and create log levels with ``logLevelOrder`` property of the
+You can reorder and create log levels with the ``logLevelOrder`` property of the
``yui.config`` object. In the example ``yui.config`` object below,
-the order of the log levels are switched for ``warn`` and ``info`` and
+the order of the log levels is switched for ``warn`` and ``info`` and
the new log level ``danger`` is created.
.. code-block:: javascript
Something went wrong with that request. Please try again.