Permalink
Browse files

Fixed formatting of code examples; removed any last remnants of view …

…templates.
  • Loading branch information...
Joe Catera
Joe Catera committed Oct 1, 2012
1 parent b5ece1a commit de93f81a18f25004691fa224680c5f1036f29170
Showing with 748 additions and 458 deletions.
  1. +2 −2 docs/dev_guide/api_overview/mojito_action_context.rst
  2. +19 −10 docs/dev_guide/code_exs/adding_assets.rst
  3. +9 −7 docs/dev_guide/code_exs/app_config.rst
  4. +101 −62 docs/dev_guide/code_exs/binding_events.rst
  5. +54 −26 docs/dev_guide/code_exs/calling_yql.rst
  6. +2 −1 docs/dev_guide/code_exs/config.rst
  7. +23 −15 docs/dev_guide/code_exs/cookies.rst
  8. +0 −1 docs/dev_guide/code_exs/dynamic_assets.rst
  9. +24 −17 docs/dev_guide/code_exs/framed_assets.rst
  10. +34 −17 docs/dev_guide/code_exs/generating_urls.rst
  11. +30 −16 docs/dev_guide/code_exs/global_assets.rst
  12. +24 −14 docs/dev_guide/code_exs/htmlframe_view.rst
  13. +47 −23 docs/dev_guide/code_exs/i18n_apps.rst
  14. +11 −4 docs/dev_guide/code_exs/index.rst
  15. +75 −37 docs/dev_guide/code_exs/intermojit_communication.rst
  16. +29 −15 docs/dev_guide/code_exs/multiple_mojits.rst
  17. +2 −2 docs/dev_guide/code_exs/other.rst
  18. +46 −25 docs/dev_guide/code_exs/query_params.rst
  19. +34 −18 docs/dev_guide/code_exs/route_config.rst
  20. +19 −10 docs/dev_guide/code_exs/scroll_views.rst
  21. +27 −13 docs/dev_guide/code_exs/simple_logging.rst
  22. +5 −7 docs/dev_guide/code_exs/simple_view_template.rst
  23. +3 −2 docs/dev_guide/code_exs/view_engines.rst
  24. +2 −1 docs/dev_guide/code_exs/views.rst
  25. +4 −4 docs/dev_guide/code_exs/views_multiple_devices.rst
  26. +28 −15 docs/dev_guide/code_exs/yui_modules.rst
  27. +11 −11 docs/dev_guide/faq/index.rst
  28. +2 −2 docs/dev_guide/intro/mojito_apps.rst
  29. +2 −2 docs/dev_guide/intro/mojito_binders.rst
  30. +3 −3 docs/dev_guide/intro/mojito_mojits.rst
  31. +21 −21 docs/dev_guide/intro/mojito_mvc.rst
  32. +2 −2 docs/dev_guide/reference/glossary.rst
  33. +2 −2 docs/dev_guide/reference/mojito_troubleshooting.rst
  34. +2 −2 docs/dev_guide/topics/mojito_assets.rst
  35. +7 −7 docs/dev_guide/topics/mojito_composite_mojits.rst
  36. +3 −3 docs/dev_guide/topics/mojito_data.rst
  37. +11 −11 docs/dev_guide/topics/mojito_extensions.rst
  38. +2 −2 docs/dev_guide/topics/mojito_framework_mojits.rst
  39. +4 −4 docs/dev_guide/topics/mojito_resource_store.rst
  40. +22 −22 docs/dev_guide/topics/mojito_run_dyn_defined_mojits.rst
@@ -9,7 +9,7 @@ you create an instance of the ``ActionContext`` class, which we will call ``ac``
client context. See the `ActionContext Class <../../api/classes/ActionContext.html>`_ for the methods available from ``ac``.
One of the most common methods used from an instance of the ``ActionContext`` class is ``done``, which lets you pass data from the controller to a view. In the example ``controller.server.js`` below,
-the ``done`` method sends the ``data`` object to the ``index`` view template.
+the ``done`` method sends the ``data`` object to the ``index`` template.
.. code-block:: javascript
@@ -36,7 +36,7 @@ the ``done`` method sends the ``data`` object to the ``index`` view template.
* provides access to the Mojito API.
*/
index: function(ac) {
- var data = { "data":"data passed to the index view template" };
+ var data = { "data":"data passed to the index template" };
ac.done(data);
}
};
@@ -19,8 +19,9 @@ The following topics will be covered:
Implementation Notes
====================
-Each application has an ``assets`` directory for placing global CSS files that can be accessed by all of your mojits. Each mojit has its own ``assets`` directory for local CSS files
-that are only accessible by the mojit.
+Each application has an ``assets`` directory for placing global CSS files that can be accessed by
+all of your mojits. Each mojit has its own ``assets`` directory for local CSS files that are only
+accessible by the mojit.
The global assets are located in the ``{app_dir}/assets`` directory as shown here:
@@ -35,7 +36,8 @@ The global assets are located in the ``{app_dir}/assets`` directory as shown her
|-- routes.json
|-- server.js
-In the ``simple`` mojit below, you see the local ``assets`` directory for CSS files only available to the ``simple`` mojit:
+In the ``simple`` mojit below, you see the local ``assets`` directory for CSS files only available
+to the ``simple`` mojit:
::
@@ -50,7 +52,8 @@ In the ``simple`` mojit below, you see the local ``assets`` directory for CSS fi
|-- tests/
`-- views/
-This code example only uses local CSS, so the ``simple.css`` file is placed in the ``assets`` directory under the ``simple`` mojit.
+This code example only uses local CSS, so the ``simple.css`` file is placed in the ``assets``
+directory under the ``simple`` mojit.
.. code-block:: css
@@ -64,15 +67,18 @@ This code example only uses local CSS, so the ``simple.css`` file is placed in t
}
.toolbar li { display:inline; }
-The CSS files in the mojit ``assets`` directory can be accessed in the template using the following path syntax:
+The CSS files in the mojit ``assets`` directory can be accessed in the template using the following
+path syntax:
``/static/{mojit}/assets/{css_file}.css``
-This code example uses the ``simple`` mojit and the ``simple.css`` asset. To access ``simple.css``, you would use the following path:
+This code example uses the ``simple`` mojit and the ``simple.css`` asset. To access ``simple.css``,
+you would use the following path:
``/static/simple/assets/simple.css``
-The ``index.hb.html`` template below includes ``simple.css`` from the ``assets`` directory using the path above.
+The ``index.hb.html`` template below includes ``simple.css`` from the ``assets`` directory using the
+path above.
.. code-block:: html
@@ -101,12 +107,15 @@ The ``index.hb.html`` template below includes ``simple.css`` from the ``assets``
</body>
</html>
-To access the global assets for the application, you use a similar syntax, replacing the mojit name with the application name. Thus, if the application name is ``simple_assets`` and ``simple.css``
+To access the global assets for the application, you use a similar syntax, replacing the mojit name
+with the application name. Thus, if the application name is ``simple_assets`` and ``simple.css``
is in ``simple_assets/assets/``, you would access ``simple.css`` with the following path:
``/static/simple_assets/assets/simple.css``
-.. note:: For the purpose of simplifying this code example, the ``setColor`` function was hardcoded into the template. In your Mojito applications, you should avoid mixing the business and presentation logic of your application by hardcoding JavaScript into your template.
+.. note:: For the purpose of simplifying this code example, the ``setColor`` function was hardcoded
+ into the template. In your Mojito applications, you should avoid mixing the business and
+ presentation logic of your application by hardcoding JavaScript into your template.
Setting Up this Example
=======================
@@ -253,7 +262,7 @@ Source Code
===========
- `Mojit Assets <http://github.com/yahoo/mojito/tree/master/examples/developer-guide/simple_assets/mojits/simple/assets/>`_
-- `Index View Template <http://github.com/yahoo/mojito/tree/master/examples/developer-guide/simple_assets/mojits/simple/views/index.hb.html>`_
+- `Index Template <http://github.com/yahoo/mojito/tree/master/examples/developer-guide/simple_assets/mojits/simple/views/index.hb.html>`_
- `Simple Assets Application <http://github.com/yahoo/mojito/tree/master/examples/developer-guide/simple_assets/>`_
@@ -14,7 +14,8 @@ This example shows how to configure a mojit and the routing for your application
Implementation Notes
====================
-The ``application.json`` file is used to specify the mojits that your application can use. The example ``application.json`` below specifies that the application use the mojit ``SimpleMojit``.
+The ``application.json`` file is used to specify the mojits that your application can use. The
+example ``application.json`` below specifies that the application use the mojit ``SimpleMojit``.
.. code-block:: javascript
@@ -29,7 +30,9 @@ The ``application.json`` file is used to specify the mojits that your applicatio
}
]
-The routing configuration for Mojito applications is contained in ``routes.json``. In this example ``routes.json``, the Mojito server is told to call the ``index`` method in the controller when an HTTP GET is called on the root path.
+The routing configuration for Mojito applications is contained in ``routes.json``. In this example
+``routes.json``, the Mojito server is told to call the ``index`` method in the controller when an
+HTTP GET is called on the root path.
.. code-block:: javascript
@@ -44,7 +47,8 @@ The routing configuration for Mojito applications is contained in ``routes.json`
}
]
-The ``index`` method is a canned method in the controller when you create a mojit. To learn how to create templates that get data from the controller,
+The ``index`` method is a canned method in the controller when you create a mojit. To learn how to
+create templates that get data from the controller,
see `Creating a Simple View with Handlebars <simple_view_template.html>`_.
Setting Up this Example
@@ -55,13 +59,12 @@ To set up and run ``simple_config``:
#. Create your application.
``$ mojito create app simple_config``
-
#. Change to the application directory.
#. Create your mojit.
``$ mojito create mojit SimpleMojit``
-
-#. To specify that your application use ``SimpleMojit``, replace the code in ``application.json`` with the following:
+#. To specify that your application use ``SimpleMojit``, replace the code in ``application.json``
+ with the following:
.. code-block:: javascript
@@ -94,7 +97,6 @@ To set up and run ``simple_config``:
#. From the application directory, run the server.
``$ mojito start``
-
#. To view your application, go to the URL:
http://localhost:8666
Oops, something went wrong.

0 comments on commit de93f81

Please sign in to comment.