root / pycommunity / pycommunity / doc / tutorial.txt

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

rupy slides, starting up

Line 
1========
2tutorial
3========
4
5`tutorial` provides a task to create html recipes out of
6reST files.
7
8`TutorialTask` knows how to process a recipe folder, rendering each recipe
9it founds::
10
11    >>> from tutorial import TutorialTask
12    >>> class Conf(object):
13    ...     targets = {'tutorial1': 'tests/www'}
14    ...     recipes = {}
15    ...     tutorials = {'tutorials': 'tests/svn/project/tutorials'}
16    ...     templates = {'tutorial': 'tests/templates/tutorial.pt',
17    ...                  'tutoriallist': 'tests/templates/tutoriallist.pt'}
18    ...     glossary = 'tests/svn/project/doc/glossary.txt'
19    ...
20    >>> task = TutorialTask()
21    >>> task._run(Conf())
22
23Let's see the result, and check if it links to recipe1::
24
25    >>> res = open('tests/www/tutorials/how_to_use.html').read()
26    >>> "<a title='glossary_recipe' alt='glossary_recipe'" in res
27    True
28    >>> "<a title='main_readme_recipe' alt='main_readme_recipe'" in res
29    True
30
Note: See TracBrowser for help on using the browser.