| 1 | Exercise 1 |
|---|
| 2 | ========== |
|---|
| 3 | |
|---|
| 4 | Duration |
|---|
| 5 | :::::::: |
|---|
| 6 | |
|---|
| 7 | 10 mn |
|---|
| 8 | |
|---|
| 9 | Goals |
|---|
| 10 | ::::: |
|---|
| 11 | |
|---|
| 12 | - Mastering the basic reST syntax: |
|---|
| 13 | |
|---|
| 14 | - structuration |
|---|
| 15 | |
|---|
| 16 | - examples |
|---|
| 17 | |
|---|
| 18 | - font effects |
|---|
| 19 | |
|---|
| 20 | - Using `docutils` |
|---|
| 21 | |
|---|
| 22 | Outline |
|---|
| 23 | ::::::: |
|---|
| 24 | |
|---|
| 25 | Let's create a first reST file. The goal is to create a file that renders |
|---|
| 26 | like the provided HTML example: **Monty Python**. You can use `docutils` |
|---|
| 27 | to render your file and compare it. |
|---|
| 28 | |
|---|
| 29 | Prerequisites |
|---|
| 30 | ::::::::::::: |
|---|
| 31 | |
|---|
| 32 | - `docutils` is installed |
|---|
| 33 | |
|---|
| 34 | Exercise 2 |
|---|
| 35 | ========== |
|---|
| 36 | |
|---|
| 37 | Duration |
|---|
| 38 | :::::::: |
|---|
| 39 | |
|---|
| 40 | 10 mn |
|---|
| 41 | |
|---|
| 42 | Goals |
|---|
| 43 | ::::: |
|---|
| 44 | |
|---|
| 45 | - mastering advanced reST syntax (the useful things) |
|---|
| 46 | |
|---|
| 47 | Outline |
|---|
| 48 | ::::::: |
|---|
| 49 | |
|---|
| 50 | Take 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 | |
|---|
| 59 | So it looks like the provided example **Monty Python 2** |
|---|
| 60 | |
|---|
| 61 | Prerequisites |
|---|
| 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 | |
|---|
| 66 | Exercise 3 |
|---|
| 67 | ========== |
|---|
| 68 | |
|---|
| 69 | Duration |
|---|
| 70 | :::::::: |
|---|
| 71 | |
|---|
| 72 | 10 mn |
|---|
| 73 | |
|---|
| 74 | |
|---|
| 75 | Goals |
|---|
| 76 | ::::: |
|---|
| 77 | |
|---|
| 78 | - mastering useful technical writing techniques |
|---|
| 79 | |
|---|
| 80 | Outline |
|---|
| 81 | ::::::: |
|---|
| 82 | |
|---|
| 83 | Take the provided file, and do: |
|---|
| 84 | |
|---|
| 85 | - a structuration (toc, summary, references) |
|---|
| 86 | - a google-ification of all titles |
|---|
| 87 | |
|---|
| 88 | Prerequisites |
|---|
| 89 | ::::::::::::: |
|---|
| 90 | |
|---|
| 91 | - Grab the file here: burgundy_before.txt |
|---|
| 92 | |
|---|
| 93 | Exercise 4 (experimental) |
|---|
| 94 | ========================= |
|---|
| 95 | |
|---|
| 96 | Duration |
|---|
| 97 | :::::::: |
|---|
| 98 | |
|---|
| 99 | 20 mn |
|---|
| 100 | |
|---|
| 101 | |
|---|
| 102 | Goals |
|---|
| 103 | ::::: |
|---|
| 104 | |
|---|
| 105 | - practicing pair-documenting |
|---|
| 106 | |
|---|
| 107 | Outline |
|---|
| 108 | ::::::: |
|---|
| 109 | |
|---|
| 110 | This exercise is done in 3 parts. |
|---|
| 111 | |
|---|
| 112 | Make binomials with two roles, a technician and a writer. |
|---|
| 113 | |
|---|
| 114 | Part 1 |
|---|
| 115 | ------ |
|---|
| 116 | |
|---|
| 117 | The technician writes a small text about a topic she knows really well |
|---|
| 118 | for about 5 mn. She doesn't bather at all about the style and uses |
|---|
| 119 | his technical domain vocabulary to be the more accurate she can. |
|---|
| 120 | |
|---|
| 121 | Part 2 |
|---|
| 122 | ------ |
|---|
| 123 | |
|---|
| 124 | The writer then takes the lead and try to enhance the document. She |
|---|
| 125 | interviews the technician while she works, and creates a glossary if needed. |
|---|
| 126 | |
|---|
| 127 | Part 3 |
|---|
| 128 | ------ |
|---|
| 129 | |
|---|
| 130 | Binomials moves around the room, to another desk, and review together |
|---|
| 131 | another binomial text, without their help. |
|---|
| 132 | |
|---|
| 133 | Prerequisites |
|---|
| 134 | ::::::::::::: |
|---|
| 135 | |
|---|
| 136 | - binomials ;) |
|---|
| 137 | |
|---|
| 138 | Exercise 5 |
|---|
| 139 | ========== |
|---|
| 140 | |
|---|
| 141 | Goals |
|---|
| 142 | ::::: |
|---|
| 143 | |
|---|
| 144 | - Learn how to document a Python module |
|---|
| 145 | |
|---|
| 146 | Outline |
|---|
| 147 | ::::::: |
|---|
| 148 | |
|---|
| 149 | Take the provided package, and document the modules that seem |
|---|
| 150 | important to you. Put all text files in a `doc` folder. |
|---|
| 151 | |
|---|
| 152 | Prerequisites |
|---|
| 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 | |
|---|
| 159 | Exercise 6 |
|---|
| 160 | ========== |
|---|
| 161 | |
|---|
| 162 | Goals |
|---|
| 163 | ::::: |
|---|
| 164 | |
|---|
| 165 | - Learn how to document a Python package |
|---|
| 166 | |
|---|
| 167 | Outline |
|---|
| 168 | ::::::: |
|---|
| 169 | |
|---|
| 170 | Take the provided package, and create the mandatory files. You |
|---|
| 171 | may use Cheesecake to test it. |
|---|
| 172 | |
|---|
| 173 | Prerequisites |
|---|
| 174 | ::::::::::::: |
|---|
| 175 | |
|---|
| 176 | - Get the package tarball in `material` |
|---|
| 177 | |
|---|
| 178 | Exercise 7 |
|---|
| 179 | ========== |
|---|
| 180 | |
|---|
| 181 | Goals |
|---|
| 182 | ::::: |
|---|
| 183 | |
|---|
| 184 | - Learn how to doctest |
|---|
| 185 | |
|---|
| 186 | Outline |
|---|
| 187 | ::::::: |
|---|
| 188 | |
|---|
| 189 | Take the previous package, and add unit tests for all class. Decide |
|---|
| 190 | what goes into the doctest and what goes into the unittest. |
|---|
| 191 | |
|---|
| 192 | Prerequisites |
|---|
| 193 | ::::::::::::: |
|---|
| 194 | |
|---|
| 195 | - Get the test framework here: xxx (test_docs.py and test_module.py) |
|---|
| 196 | |
|---|
| 197 | Exercise 8 |
|---|
| 198 | ========== |
|---|
| 199 | |
|---|
| 200 | Goals |
|---|
| 201 | ::::: |
|---|
| 202 | |
|---|
| 203 | - Learn how to design through doctest |
|---|
| 204 | |
|---|
| 205 | Outline |
|---|
| 206 | ::::::: |
|---|
| 207 | |
|---|
| 208 | Create a Python package that implements a class. This class |
|---|
| 209 | takes a text file name when it's instantiated, and provide a few |
|---|
| 210 | methods 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 | |
|---|
| 220 | This class is created through its doctest, using TDD principles |
|---|
| 221 | (the test is written before the code). Pay attention to the naming |
|---|
| 222 | work and API design. |
|---|
| 223 | |
|---|
| 224 | Prerequisites |
|---|
| 225 | ::::::::::::: |
|---|
| 226 | |
|---|
| 227 | - You know how to code in Python |
|---|
| 228 | |
|---|
| 229 | - Grab `test_docs.py` to run your tests |
|---|
| 230 | |
|---|
| 231 | Exercise 9 |
|---|
| 232 | ========== |
|---|
| 233 | |
|---|
| 234 | Goals |
|---|
| 235 | ::::: |
|---|
| 236 | |
|---|
| 237 | - Learn how to write a tutorial |
|---|
| 238 | |
|---|
| 239 | Outline |
|---|
| 240 | ::::::: |
|---|
| 241 | |
|---|
| 242 | Write a tutorial for the given feature, don't forget to apply the seven |
|---|
| 243 | rules. Do not insert any example of code, instead, just insert a simple |
|---|
| 244 | sentence that explains what the example does. |
|---|
| 245 | |
|---|
| 246 | Use this template: |
|---|
| 247 | |
|---|
| 248 | - title |
|---|
| 249 | - abstract (two sentences max) |
|---|
| 250 | - toc (when # sections > 1) |
|---|
| 251 | - body |
|---|
| 252 | |
|---|
| 253 | Feature:: |
|---|
| 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 | |
|---|
| 269 | Prerequisites |
|---|
| 270 | ::::::::::::: |
|---|
| 271 | |
|---|
| 272 | N/A |
|---|
| 273 | |
|---|
| 274 | Exercise 10 |
|---|
| 275 | =========== |
|---|
| 276 | |
|---|
| 277 | Goals |
|---|
| 278 | ::::: |
|---|
| 279 | |
|---|
| 280 | - Learn how to write a few recipes |
|---|
| 281 | |
|---|
| 282 | Outline |
|---|
| 283 | ::::::: |
|---|
| 284 | |
|---|
| 285 | Write the recipe "How to use ConfigParser" |
|---|
| 286 | |
|---|
| 287 | Prerequisites |
|---|
| 288 | ::::::::::::: |
|---|
| 289 | |
|---|
| 290 | - exercise 9 |
|---|
| 291 | |
|---|
| 292 | Exercise 11 |
|---|
| 293 | =========== |
|---|
| 294 | |
|---|
| 295 | Goals |
|---|
| 296 | ::::: |
|---|
| 297 | |
|---|
| 298 | - Generate documentation using PyCommunity. |
|---|
| 299 | |
|---|
| 300 | Outline |
|---|
| 301 | ::::::: |
|---|
| 302 | |
|---|
| 303 | Take the provided PyCommunity tarball (documented), and generate the |
|---|
| 304 | documentation over the tests, by calling `pycommunity`. Change the tutorials, |
|---|
| 305 | recipes, etc, to see how the generated website is changed. |
|---|
| 306 | |
|---|
| 307 | Prerequisites |
|---|
| 308 | ::::::::::::: |
|---|
| 309 | |
|---|
| 310 | N/A |
|---|