| Line | |
|---|
| 1 | ======== |
|---|
| 2 | tutorial |
|---|
| 3 | ======== |
|---|
| 4 | |
|---|
| 5 | `tutorial` provides a task to create html recipes out of |
|---|
| 6 | reST files. |
|---|
| 7 | |
|---|
| 8 | `TutorialTask` knows how to process a recipe folder, rendering each recipe |
|---|
| 9 | it 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 | |
|---|
| 23 | Let'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 | |
|---|