Permalink
Browse files

Docs improvements (highlighting, typos, ...)

  • Loading branch information...
1 parent cc10be1 commit 051d9905149528d5f304fa6f33b4736d8dbc1c47 Jonas Obrist committed Dec 30, 2010
Showing with 38 additions and 21 deletions.
  1. +3 −1 docs/i18n.rst
  2. +29 −18 docs/navigation.rst
  3. +6 −2 docs/tutorial.rst
View
@@ -27,7 +27,9 @@ The ``language_chooser`` template tag will display a language chooser for the
current page. You can modify the template in ``menu/language_chooser.html`` or
provide your own template if necessary.
-Example::
+Example:
+
+.. code-block:: html+django
{% load menu_tags %}
{% language_chooser "myapp/language_chooser.html" %}
View
@@ -2,28 +2,38 @@
Navigation
##########
-There are four template tags for use in the templates that are connected to the menu:
-``show_menu``, ``show_menu_below_id``, ``show_sub_menu``, and ``show_breadcrumb``.
+.. highlight:: html+django
+
+There are four template tags for use in the templates that are connected to the
+menu:
+
+* ``show_menu``
+* ``show_menu_below_id``
+* ``show_sub_menu``
+* ``show_breadcrumb``
*********
show_menu
*********
-``{& show_menu %}`` renders the navigation of the current page.
+``{% show_menu %}`` renders the navigation of the current page.
You can overwrite the appearance and the HTML if you add a ``cms/menu.html``
template to your project or edit the one provided with django-cms.
``show_menu`` takes four optional parameters: ``start_level``, ``end_level``,
``extra_inactive``, and ``extra_active``.
-The first two parameters, ``start_level`` (default=0) and ``end_level`` (default=100) specify from what level to which level
-should the navigation be rendered.
-If you have a home as a root node and don't want to display home you can render the navigation only after level 1.
+The first two parameters, ``start_level`` (default=0) and ``end_level``
+(default=100) specify from what level to which level should the navigation be
+rendered.
+If you have a home as a root node and don't want to display home you can render
+the navigation only after level 1.
-The third parameter, ``extra_inactive`` (default=0), specifies how many levels of navigation should be displayed
-if a node is not a direct ancestor or descendant of the current active node.
+The third parameter, ``extra_inactive`` (default=0), specifies how many levels
+of navigation should be displayed if a node is not a direct ancestor or
+descendant of the current active node.
-Finally, the fourth parameter, ``extra_active`` (default=100), specifies how many levels of
-descendants of the currently active node should be displayed.
+Finally, the fourth parameter, ``extra_active`` (default=100), specifies how
+many levels of descendants of the currently active node should be displayed.
Some Examples
=============
@@ -63,8 +73,8 @@ show_sub_menu
*************
Display the sub menu of the current page (as a nested list).
-Takes one argument that specifies how many levels deep should the submenu be displayed.
-The template can be found at ``cms/sub_menu.html``::
+Takes one argument that specifies how many levels deep should the submenu be
+displayed. The template can be found at ``cms/sub_menu.html``::
<ul>
{% show_sub_menu 1 %}
@@ -90,8 +100,8 @@ Or with a custom template and only display level 2 or higher::
{% show_breadcrumb 2 "myapp/breadcrumb.html" %}
-If the current URL is not handled by the CMS or you are working in a navigation extender,
-you may need to provide your own breadcrumb via the template.
+If the current URL is not handled by the CMS or you are working in a navigation
+extender, you may need to provide your own breadcrumb via the template.
This is mostly needed for pages like login, logout and third-party apps.
@@ -160,15 +170,16 @@ Soft Roots
**********
"Soft roots" are pages that start a new navigation.
-If you are in a child of a soft root node you can only see the path to the soft root.
-This feature is useful if you have big navigation trees with a lot of pages and don't
-want to overwhelm the user.
+If you are in a child of a soft root node you can only see the path to the soft
+root. This feature is useful if you have big navigation trees with a lot of
+pages and don't want to overwhelm the user.
To enable it put the following in your ``settings.py`` file::
CMS_SOFTROOT = True
-Now you can mark a page as "soft root" in the 'Advanced' tab of the page's settings in the admin interface.
+Now you can mark a page as "soft root" in the 'Advanced' tab of the page's
+settings in the admin interface.
******************************
Modifying & Extending the menu
View
@@ -239,7 +239,9 @@ setting::
...
)
-Here is a simple example for a base template called ``base.html``::
+Here is a simple example for a base template called ``base.html``:
+
+.. code-block:: html+django
{% load cms_tags %}
<html>
@@ -249,7 +251,9 @@ Here is a simple example for a base template called ``base.html``::
</body>
</html>
-Now we can use this base template in our ``template_1.html`` template::
+Now we can use this base template in our ``template_1.html`` template:
+
+.. code-block:: html+django
{% extends "base.html" %}
{% load cms_tags %}

0 comments on commit 051d990

Please sign in to comment.