root / PyCon07 / exercises.txt

Revision 60:c074fc456b2a, 5.0 kB (checked in by Tarek Ziad?? <tarek@…>, 23 months ago)

more

Line 
1Exercise 1
2==========
3
4Duration
5::::::::
6
710 mn
8
9Goals
10:::::
11
12- Mastering the basic reST syntax:
13
14    - structuration
15   
16    - examples
17
18    - font effects
19
20- Using `docutils` 
21
22Outline
23:::::::
24
25Let's create a first reST file. The goal is to create a file that renders
26like the provided HTML example: **Monty Python**. You can use `docutils`
27to render your file and compare it.
28
29Prerequisites
30:::::::::::::
31
32- `docutils` is installed
33
34Exercise 2
35==========
36
37Duration
38::::::::
39
4010 mn
41
42Goals
43:::::
44
45- mastering advanced reST syntax (the useful things)
46
47Outline
48:::::::
49
50Take back the rest file from exercise 1, and add:
51
52- a table of content
53- an external link
54- a figure (image+legend)
55- an anchor
56- a footnote
57- metadata in fields (author, contact)
58
59So it looks like the provided example **Monty Python 2**
60
61Prerequisites
62:::::::::::::
63
64- Grab the picture here: http://upload.wikimedia.org/wikipedia/en/thumb/c/cb/Flyingcircus_2.jpg/300px-Flyingcircus_2.jpg or on the provided example.
65
66Exercise 3
67==========
68
69Duration
70::::::::
71
7210 mn
73
74
75Goals
76:::::
77
78- mastering useful technical writing techniques
79
80Outline
81:::::::
82
83Take the provided file, and do:
84
85- a structuration (toc, summary, references)
86- a google-ification of all titles
87
88Prerequisites
89:::::::::::::
90
91- Grab the file here: burgundy_before.txt
92
93Exercise 4 (experimental)
94=========================
95
96Duration
97::::::::
98
9920 mn
100
101
102Goals
103:::::
104
105- practicing pair-documenting
106
107Outline
108:::::::
109
110This exercise is done in 3 parts.
111
112Make binomials with two roles, a technician and a writer.
113
114Part 1
115------
116
117The technician writes a small text about a topic she knows really well
118for about 5 mn. She doesn't bather at all about the style and uses
119his technical domain vocabulary to be the more accurate she can.
120
121Part 2
122------
123
124The writer then takes the lead and try to enhance the document. She
125interviews the technician while she works, and creates a glossary if needed.
126
127Part 3
128------
129
130Binomials moves around the room, to another desk, and review together
131another binomial text, without their help.
132
133Prerequisites
134:::::::::::::
135
136- binomials ;)
137
138Exercise 5
139==========
140
141Goals
142:::::
143
144- Learn how to document a Python module
145
146Outline
147:::::::
148
149Take the provided package, and document the modules that seem
150important to you. Put all text files in a `doc` folder.
151
152Prerequisites
153:::::::::::::
154
155- Get the package tarball in `material`
156- Get the text file that explains how pycommunity works, and
157  the one that lists its main modules.
158
159Exercise 6
160==========
161
162Goals
163:::::
164
165- Learn how to document a Python package
166
167Outline
168:::::::
169
170Take the provided package, and create the mandatory files. You
171may use Cheesecake to test it.
172
173Prerequisites
174:::::::::::::
175
176- Get the package tarball in `material`
177
178Exercise 7
179==========
180
181Goals
182:::::
183
184- Learn how to doctest
185
186Outline
187:::::::
188
189Take the previous package, and add unit tests for all class. Decide
190what goes into the doctest and what goes into the unittest.
191
192Prerequisites
193:::::::::::::
194
195- Get the test framework here: xxx (test_docs.py and test_module.py)
196
197Exercise 8
198==========
199
200Goals
201:::::
202
203- Learn how to design through doctest
204
205Outline
206:::::::
207
208Create a Python package that implements a class. This class
209takes a text file name when it's instantiated, and provide a few 
210methods to:
211
212- get the len of the text
213
214- print the text
215
216- print the first line and the last line
217
218- returns the position of a given word or sentence
219
220This class is created through its doctest, using TDD principles
221(the test is written before the code). Pay attention to the naming
222work and API design.
223
224Prerequisites
225:::::::::::::
226
227- You know how to code in Python
228
229- Grab `test_docs.py` to run your tests
230
231Exercise 9
232==========
233
234Goals
235:::::
236
237- Learn how to write a tutorial
238
239Outline
240:::::::
241
242Write a tutorial for the given feature, don't forget to apply the seven
243rules. Do not insert any example of code, instead, just insert a simple
244sentence that explains what the example does.
245
246Use this template:
247
248- title
249- abstract (two sentences max)
250- toc (when # sections > 1)
251- body
252
253Feature::
254
255    To simplify the exercise, our bundle is the Python Library.
256
257    Let's write a tutorial on how to extract a list of web pages and create
258    a local copy. The list of pages are configured in a **ini** file, and
259    there's a list of words that we want to make more visible, with a **bold**
260    tag.
261
262    The modules* used are:
263        - *ConfigParser* to read the conf file
264        - *urllib2*, to grab the web pages
265        - *re*, to bold some words.
266
267    * we do not make a difference here between a module and a package
268
269Prerequisites
270:::::::::::::
271
272N/A
273
274Exercise 10
275===========
276
277Goals
278:::::
279
280- Learn how to write a few recipes
281
282Outline
283:::::::
284
285Write the recipe "How to use ConfigParser"
286
287Prerequisites
288:::::::::::::
289
290- exercise 9
291
292Exercise 11
293===========
294
295Goals
296:::::
297
298- Generate documentation using PyCommunity.
299
300Outline
301:::::::
302
303Take the provided PyCommunity tarball (documented), and generate the
304documentation over the tests, by calling `pycommunity`. Change the tutorials,
305recipes, etc, to see how the generated website is changed.
306
307Prerequisites
308:::::::::::::
309
310N/A
Note: See TracBrowser for help on using the browser.