root / PyCon07 / material / pycommunity_undocumented / README.txt

Revision 46:4ed970b6ecf7, 4.6 kB (checked in by Tarek Ziad?? <tarek@…>, 21 months ago)

added basic readme

Line 
1===========
2PyCommunity
3===========
4
5`PyCommunity` is a script that generates a static html website by browsing
6a subversion repository, looking for reSTructuredText documents.
7
8The idea is to provide a way to automate a project website update everytime
9developers change the documents founded throughout the subversion tree.
10
11Subversion Layout
12=================
13
14To work, `PyCommunity` browses :
15
16- a list of packages and extract their documents.
17
18- a directory that holds recipes, to build a cookbook
19
20- a directory that holds tutorials
21
22- a file that contains a glossary
23
24- a file, that is the main README
25
26- a file that is used as the content of the package list page
27
28A typical layout would be::
29
30    project
31      |
32      |
33      |-- src
34      |    |
35      |    |-- package1
36      |           |
37      |           |
38      |         module1.py     
39      |         
40      |-- doc
41      |    |
42      |    |--- packages.txt
43      |    |
44      |    |--  README.txt
45      |    | 
46      |    |--- glossary.txt
47      |    |
48      |    |--- recipes
49      |    |       |
50      |    |       |-- recipe1.txt
51      |    |       
52      |    |--- tutorials
53      |    |      |
54      |    |      |-- tutorial1.txt
55
56The glossary file
57-----------------
58
59The glossary file contains all project common words. The idea
60is to collect all words and unify terms, in order to avoid
61speaking about the same thing, using two different words.
62
63The glossary is a text file. Each line is composed of a word
64a `:` character, and a short definition::
65
66    glossary: A file that contains definitions
67    doctest: A document with runnable examples
68
69The recipe folder
70-----------------
71
72The recipe folder contains reSTructuredText files. They can
73use an extended tag to mark words that are in the glossary::
74
75    My super restfile
76    -----------------
77
78    is about {{doctest}}
79
80This allows PyCommunity to generate links and hints in the tutorials
81when it founds such tags.
82
83The filename without it suffix, is the id of the recipe.
84
85
86The Tutorial folder
87-------------------
88
89The tutorial folder contains reSTructuredText files. They can
90use an extended tag to mark words that are in the glossary, like
91recipes.
92
93It can also link to a recipe, by using a recipe prefix and a tag
94like glossary::
95
96    look at {{recipe:recipe_1}} for details
97
98`PyCommunity` will replace it with the recipe title and a link to the
99recipe.   
100 
101The filename without it suffix, is the id of the tutorial.
102
103The code packages
104-----------------
105
106`PyCommunity` lists all packages, and scans each one of them, to look
107for all files with the `.txt` extension. `README.txt` is mandatory.
108The files can also use glossary, recipe and tutorial tags::
109
110    look at {{tutorial:tutorial_1}} for details
111
112Website Layout
113==============
114
115`PyCommunity` generates a web structure that looks like this::
116
117    index.html == main README
118    glossary.html       
119    packages
120        index.html (packages list + package.txt content)
121        package1
122            index.html (==README.txt)
123            epydoc (epydoc)
124            module1.html
125    tutorials.html (tutorials list)
126    tutorials
127        tutorial1.html
128    cookbook.html (recipe lists)
129    cookbook
130        recipe1.html
131       
132Configuration
133=============
134
135`PyCommunity` uses `pycommunity.conf` file to know where to get
136its data. Each type of document described in the previous section
137can be located in several places. Target is the folder
138where the website will be generated.
139
140Example::
141
142    [packages]
143    Package1 = /home/repository/project/src/package1
144    Package2 = /home/repository/project/src/package2
145   
146    [templates]
147    index=templates/index.pt
148    tutorial=templates/tutorial.pt
149    recipe=templates/recipe.pt
150    glossary=templates/glossary.pt
151    recipelist=templates/recipelist.pt
152    tutoriallist=templates/tutoriallist.pt
153    packageindex=templates/packageindex.pt
154    packagedoc=templates/packagedoc.pt
155    packagestats=templates/packagestats.pt
156    packagesindex=templates/packagesindex.pt
157    css=templates/pycommunity.css
158
159    [options]
160    projectname=PyCommunity
161    media=templates/media
162    glossary=/home/repository/project/doc/glossary.txt
163    index=/home/repository/project/doc/README.txt
164    packages=/home/repository/project/doc/packages.txt
165
166    [recipes]
167    recipes = /home/repository/project/doc/recipes
168    more_recipes = /home/repository/project/doc/recipes2
169 
170    [tutorials]
171    tutos = /home/repository/project/doc/tutorials
172
173    [target]
174    target1=/home/www
175 
176Usage
177=====
178
179`PyCommunity` is launched directly, with an optional parameter
180that points to the configuration file. It tries to find it in the
181current directory if none is provided. A log file is aslo filled,
182describing all tasks ran by the tool.
183 
Note: See TracBrowser for help on using the browser.