PageRenderTime 53ms CodeModel.GetById 50ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/docs/ref/contrib/webdesign.txt

https://code.google.com/p/mango-py/
Plain Text | 56 lines | 42 code | 14 blank | 0 comment | 0 complexity | 0e1119eb758146685cf2ed0262aa2865 MD5 | raw file
 1========================
 2django.contrib.webdesign
 3========================
 4
 5.. module:: django.contrib.webdesign
 6   :synopsis: Helpers and utilities targeted primarily at Web *designers*
 7              rather than Web *developers*.
 8
 9The ``django.contrib.webdesign`` package, part of the
10:doc:`"django.contrib" add-ons </ref/contrib/index>`, provides various Django
11helpers that are particularly useful to Web *designers* (as opposed to
12developers).
13
14At present, the package contains only a single template tag. If you have ideas
15for Web-designer-friendly functionality in Django, please
16:doc:`suggest them </internals/contributing>`.
17
18Template tags
19=============
20
21To use these template tags, add ``'django.contrib.webdesign'`` to your
22:setting:`INSTALLED_APPS` setting. Once you've done that, use
23``{% load webdesign %}`` in a template to give your template access to the tags.
24
25
26lorem
27=====
28
29Displays random "lorem ipsum" Latin text. This is useful for providing sample
30data in templates.
31
32Usage::
33
34    {% lorem [count] [method] [random] %}
35
36The ``{% lorem %}`` tag can be used with zero, one, two or three arguments.
37The arguments are:
38
39    ===========  =============================================================
40    Argument     Description
41    ===========  =============================================================
42    ``count``    A number (or variable) containing the number of paragraphs or
43                 words to generate (default is 1).
44    ``method``   Either ``w`` for words, ``p`` for HTML paragraphs or ``b``
45                 for plain-text paragraph blocks (default is ``b``).
46    ``random``   The word ``random``, which if given, does not use the common
47                 paragraph ("Lorem ipsum dolor sit amet...") when generating
48                 text.
49    ===========  =============================================================
50
51Examples:
52
53    * ``{% lorem %}`` will output the common "lorem ipsum" paragraph.
54    * ``{% lorem 3 p %}`` will output the common "lorem ipsum" paragraph
55      and two random paragraphs each wrapped in HTML ``<p>`` tags.
56    * ``{% lorem 2 w random %}`` will output two random Latin words.