| Line | |
|---|
| 1 | ======== |
|---|
| 2 | resttask |
|---|
| 3 | ======== |
|---|
| 4 | |
|---|
| 5 | Provides base class for tasks that deals with rest files. |
|---|
| 6 | |
|---|
| 7 | `TaksView` provides a generic viewer, that knows how to render rest files, |
|---|
| 8 | given a Cheetah template and a reST file:: |
|---|
| 9 | |
|---|
| 10 | >>> from resttask import TaskView |
|---|
| 11 | >>> view = TaskView('tests/templates/recipe.pt', |
|---|
| 12 | ... 'tests/svn/project/recipes/glossary_recipe.txt', |
|---|
| 13 | ... 'tests/svn/project/doc/glossary.txt', |
|---|
| 14 | ... ['tests/svn/project/doc/tutorials'], []) |
|---|
| 15 | ... |
|---|
| 16 | >>> title, content = view() |
|---|
| 17 | >>> title |
|---|
| 18 | 'How to make a glossary' |
|---|
| 19 | |
|---|
| 20 | The content is also scanned, to replace glossary entries:: |
|---|
| 21 | |
|---|
| 22 | >>> print content |
|---|
| 23 | <html> |
|---|
| 24 | ... |
|---|
| 25 | <acronym title='a documentation generator'>PyCommunity</a> |
|---|
| 26 | ... |
|---|
| 27 | </html> |
|---|