root / pycommunity / pycommunity / doc / index.txt

Revision 78:b5dabe9762d1, 1.0 kB (checked in by Tarek Ziad?? <tarek@…>, 15 months ago)

rupy slides, starting up

Line 
1=====
2index
3=====
4
5`IndexView` provides a class that generates the index, using
6a cheetah template::
7
8    >>> from index import IndexView
9    >>> options = {'projectname': 'PyCommunity',
10    ...            'index': 'tests/svn/project/doc/README.txt'}
11    >>> view = IndexView('tests/templates/index.pt', options)
12    >>> print view()
13    <html>
14    ...
15    <title>PyCommunity documentation center</title>       
16    ...
17    </html>
18
19`IndexTask` provides a task that can be used in the generator::
20
21    >>> from index import IndexTask
22    >>> class Conf(object):
23    ...     targets = {'target1': 'tests/www'}
24    ...     templates = {'index': 'tests/templates/index.pt',
25    ...                  'css': 'tests/templates/pycommunity.css',
26    ...                  'js': 'tests/templates/pycommunity.js'}
27    ...     media = 'tests/templates/media'
28    ...     options = {'projectname': 'PyCommunity',
29    ...                'index': 'tests/svn/project/doc/README.txt'}
30    ...
31    >>> task = IndexTask()
32    >>> task._run(Conf())
33
Note: See TracBrowser for help on using the browser.