Skip to content

Commit

Permalink
[#847] Fix Sphinx errors in helpers.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Sean Hammond committed Nov 21, 2013
1 parent a8a13b2 commit 4266fdc
Showing 1 changed file with 19 additions and 16 deletions.
35 changes: 19 additions & 16 deletions ckan/lib/helpers.py
Expand Up @@ -392,10 +392,10 @@ def _create_link_text(text, **kwargs):

def nav_link(text, *args, **kwargs):
'''
params
class_: pass extra class(s) to add to the <a> tag
icon: name of ckan icon to use within the link
condition: if False then no link is returned
:param class_: pass extra class(es) to add to the ``<a>`` tag
:param icon: name of ckan icon to use within the link
:param condition: if ``False`` then no link is returned
'''
if len(args) > 1:
raise Exception('Too many unnamed parameters supplied')
Expand Down Expand Up @@ -459,35 +459,37 @@ def build_nav_main(*args):


def build_nav_icon(menu_item, title, **kw):
''' build a navigation item used for example in user/read_base.html
'''Build a navigation item used for example in ``user/read_base.html``.
outputs <li><a href="..."><i class="icon.."></i> title</a></li>
Outputs ``<li><a href="..."><i class="icon.."></i> title</a></li>``.
:param menu_item: the name of the defined menu item defined in
config/routing as the named route of the same name
config/routing as the named route of the same name
:type menu_item: string
:param title: text used for the link
:type title: string
:param **kw: additional keywords needed for creating url eg id=...
:param kw: additional keywords needed for creating url eg ``id=...``
:rtype: HTML literal
'''
return _make_menu_item(menu_item, title, **kw)


def build_nav(menu_item, title, **kw):
''' build a navigation item used for example breadcrumbs
'''Build a navigation item used for example breadcrumbs.
outputs <li><a href="..."></i> title</a></li>
Outputs ``<li><a href="..."></i> title</a></li>``.
:param menu_item: the name of the defined menu item defined in
config/routing as the named route of the same name
config/routing as the named route of the same name
:type menu_item: string
:param title: text used for the link
:type title: string
:param **kw: additional keywords needed for creating url eg id=...
:param kw: additional keywords needed for creating url eg ``id=...``
:rtype: HTML literal
'''
return _make_menu_item(menu_item, title, icon=None, **kw)

Expand Down Expand Up @@ -1208,9 +1210,9 @@ def add_url_param(alternative_url=None, controller=None, action=None,
'''
Adds extra parameters to existing ones
controller action & extras (dict) are used to create the base url
via url_for(controller=controller, action=action, **extras)
controller & action default to the current ones
controller action & extras (dict) are used to create the base url via
:py:func:`~ckan.lib.helpers.url_for` controller & action default to the
current ones
This can be overriden providing an alternative_url, which will be used
instead.
Expand Down Expand Up @@ -1238,11 +1240,12 @@ def remove_url_param(key, value=None, replace=None, controller=None,
provided (or the only one provided if key is a string).
controller action & extras (dict) are used to create the base url
via url_for(controller=controller, action=action, **extras)
via :py:func:`~ckan.lib.helpers.url_for`
controller & action default to the current ones
This can be overriden providing an alternative_url, which will be used
instead.
'''
if isinstance(key, basestring):
keys = [key]
Expand Down

0 comments on commit 4266fdc

Please sign in to comment.