Changeset 78:b5dabe9762d1
- Timestamp:
- 04/12/07 17:38:04 (17 months ago)
- Files:
-
- 34 added
- 12 modified
-
PyCon07/slides.txt (modified) (24 diffs)
-
RuPy/media/classical_cycle.jpg (added)
-
RuPy/media/classical_cycle.odg (added)
-
RuPy/media/ddd_cycle.jpg (added)
-
RuPy/media/ddd_cycle.odg (added)
-
RuPy/media/glasses.png (added)
-
RuPy/media/important.png (added)
-
RuPy/media/love.png (added)
-
RuPy/media/magnum.jpg (added)
-
RuPy/media/sad.png (added)
-
RuPy/media/sleeping.jpg (added)
-
RuPy/media/smile.png (added)
-
RuPy/media/wink.png (added)
-
RuPy/media/winner.png (added)
-
RuPy/slides.html (added)
-
RuPy/slides.txt (added)
-
RuPy/t_and_d__dd.txt (added)
-
RuPy/test_slides.py (added)
-
RuPy/ui/.svn/README.txt (added)
-
RuPy/ui/.svn/dir-wcprops (added)
-
RuPy/ui/.svn/empty-file (added)
-
RuPy/ui/.svn/entries (added)
-
RuPy/ui/.svn/format (added)
-
RuPy/ui/default/afpy.png (added)
-
RuPy/ui/default/blank.gif (added)
-
RuPy/ui/default/framing.css (added)
-
RuPy/ui/default/gray-python-half-head.png (added)
-
RuPy/ui/default/iepngfix.htc (added)
-
RuPy/ui/default/opera.css (added)
-
RuPy/ui/default/outline.css (added)
-
RuPy/ui/default/pretty.css (added)
-
RuPy/ui/default/print.css (added)
-
RuPy/ui/default/s5-core.css (added)
-
RuPy/ui/default/slides.css (added)
-
RuPy/ui/default/slides.js (added)
-
pycommunity/pycommunity/doc/configuration.txt (modified) (3 diffs)
-
pycommunity/pycommunity/doc/index.txt (modified) (2 diffs)
-
pycommunity/pycommunity/doc/package.txt (modified) (1 diff)
-
pycommunity/pycommunity/doc/recipe.txt (modified) (1 diff)
-
pycommunity/pycommunity/doc/resttask.txt (modified) (1 diff)
-
pycommunity/pycommunity/doc/sitebuilder.txt (modified) (1 diff)
-
pycommunity/pycommunity/doc/tutorial.txt (modified) (1 diff)
-
pycommunity/pycommunity/package.py (modified) (2 diffs)
-
pycommunity/pycommunity/resttask.py (modified) (2 diffs)
-
pycommunity/pycommunity/utils.py (modified) (2 diffs)
-
pycommunity/setup.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
PyCon07/slides.txt
r76 r78 22 22 - Creator of AFPY (french speaking PUG) 23 23 24 - CTO at Emencia, for a Python e-commerce framework 24 - CTO at Emencia, for a Python e-commerce framework 25 25 26 26 … … 30 30 - Understand the place of documentation in software projects 31 31 32 - Learn a few patterns to document your project 32 - Learn a few patterns to document your project 33 33 34 34 - Practice them ! … … 38 38 39 39 - Each part comes with: 40 40 41 41 - a few slides 42 42 - exercises *you* do. … … 53 53 - LUNCH - Yeeahhaa 54 54 55 A few definitions 55 A few definitions 56 56 ================= 57 57 58 58 What kind of documentation are we talking about ? 59 59 60 A few definitions 60 A few definitions 61 61 ================= 62 62 63 63 Technical documentation that helps to understand how a codebase 64 works and how it can be used. 64 works and how it can be used. 65 65 66 66 This can be: … … 71 71 - a recipe 72 72 73 A few definitions 73 A few definitions 74 74 ================= 75 75 76 76 What is the use and who is the target ? 77 77 78 A few definitions 78 A few definitions 79 79 ================= 80 80 81 81 - Project developers, to... 82 82 … … 99 99 - Writing techniques ans tips: the seven laws 100 100 - Team writing 101 101 102 102 Mastering reSTructuredText 103 103 ========================== … … 170 170 =================== 171 171 172 Focus on your target when you write a document (RÃŒping, 2003). 172 Focus on your target when you write a document (RÃŒping, 2003). 173 173 174 174 Assume their background knowledge to restrict the scope of the documentation. … … 179 179 =================== 180 180 181 A document is about a clear focus. 182 183 A precise title for each section and the document itself, and a summary 181 A document is about a clear focus. 182 183 A precise title for each section and the document itself, and a summary 184 184 can help. 185 185 186 |important| If you cannot easily name the document or one of its section, 186 |important| If you cannot easily name the document or one of its section, 187 187 there's a problem 188 188 … … 197 197 >>> foo = graph.calculateSquare(1, 1, 1, 1) 198 198 >>> bar = graph.renderSquare(foo) 199 200 Better:: 199 200 Better:: 201 201 202 202 >>> from package import graph … … 208 208 209 209 A working software is more important than the best documentation in the world 210 (Ambler, 2002). 210 (Ambler, 2002). 211 211 212 212 *Quality over Quantity* is the best rule. 213 213 214 |important| Spending too much time to find something in the documentation is 214 |important| Spending too much time to find something in the documentation is 215 215 a bad sign. 216 216 217 |important| Think documents like code. Always limit the size of its sections, 217 |important| Think documents like code. Always limit the size of its sections, 218 218 examples, etc. 219 219 … … 229 229 - a toc when there are more than one section 230 230 - references 231 - glossary 231 - glossary 232 232 - tables and diagrams 233 233 … … 249 249 |important| The best pair is made with the end-user 250 250 251 |important| Each document should have a champion, though. 251 |important| Each document should have a champion, though. 252 252 253 253 Team writing … … 260 260 - cooking recipe 261 261 - how to play a board or card game 262 - how to fish shrimps 263 262 - how to fish shrimps 263 264 264 265 265 Writing a document … … 292 292 :height: 350 293 293 :width: 250 294 294 295 295 Developer that write documentation (=winner) 296 296 … … 317 317 The code is documented with: 318 318 319 - inline comments 319 - inline comments 320 320 - functions, classes and modules docstrings 321 321 … … 346 346 - The text file describes what the module does 347 347 348 - example: utils.txt and utils.py 349 350 - Let's practice: exercise #5 |glasses| 348 - example: utils.txt and utils.py 349 350 - Let's practice: exercise #5 |glasses| 351 351 352 352 … … 360 360 - **CHANGELOG**: Lists of changes for each version of the package 361 361 - **INSTALL.txt**: how to install the package 362 - **TODO.txt**: Lists all things to do (sometimes replaced with a 362 - **TODO.txt**: Lists all things to do (sometimes replaced with a 363 363 link to a tracker or a website in README.txt) 364 364 … … 464 464 465 465 - There's 3 level of documentation: 466 466 467 467 - inline comments 468 468 - docstrings 469 469 - separated docstrings 470 470 - Packages comes with mandatory documentation 471 - We can do TDD with doctests, and deal with doc. like code 471 - We can do TDD with doctests, and deal with doc. like code 472 472 473 473 Pause … … 532 532 533 533 - title & abstract (two sentences max) 534 - prerequest: level needed, other documents to read 534 - prerequest: level needed, other documents to read 535 535 - toc (when # sections > 1) 536 536 - body … … 551 551 - A recipe answer to one question, that should be its title. 552 552 553 - Each question is linked to the sentences founded in tutorials. 553 - Each question is linked to the sentences founded in tutorials. 554 554 555 555 - A recipe is short (2 screens) … … 561 561 562 562 - How to code a RSS view ? 563 - How to extract the content of a web page ? 563 - How to extract the content of a web page ? 564 564 565 565 Recipes … … 569 569 570 570 - title & abstract (two sentences max) 571 - prerequest: level needed, other documents to read 571 - prerequest: level needed, other documents to read 572 572 - toc (when # sections > 1) 573 573 - body … … 587 587 - ..avoid using two terms for the same definition 588 588 - ..removes approximacies in documents: 589 not sure on how to explain a concept with simple words ? 589 not sure on how to explain a concept with simple words ? 590 590 look in the glossary |wink| 591 591 … … 639 639 - It is enjoyed by most developers 640 640 641 - It increases both writing and programming skills 641 - It increases both writing and programming skills 642 642 643 643 The end -
pycommunity/pycommunity/doc/configuration.txt
r68 r78 7 7 8 8 >>> from configuration import Configuration 9 >>> config = Configuration(' pycommunity.conf')9 >>> config = Configuration('tests/pycommunity.conf') 10 10 11 11 packages, recipes, and tutorials folders can be read with … … 19 19 [('tuts', 'tests/svn/project/tutorials')] 20 20 >>> config.glossary 21 ' tests/svn/project/doc/glossary.txt'21 '/etc/pycommunity/glossary.txt' 22 22 >>> packages = config.packages.items() 23 23 >>> packages.sort() … … 29 29 >>> templates.sort() 30 30 >>> templates 31 [('css', 'te mplates/pycommunity.css'),32 ('glossary', 'te mplates/glossary.pt'),33 ('index', 'te mplates/index.pt'),34 ('js', 'te mplates/pycommunity.js'),35 ('packagedoc', 'te mplates/packagedoc.pt'),36 ('packageindex', 'te mplates/packageindex.pt'),37 ('packagesindex', 'te mplates/packagesindex.pt'),38 ('packagestats', 'te mplates/packagestats.pt'),39 ('recipe', 'te mplates/recipe.pt'),40 ('recipelist', 'te mplates/recipelist.pt'),41 ('tutorial', 'te mplates/tutorial.pt'),42 ('tutoriallist', 'te mplates/tutoriallist.pt')]31 [('css', 'tests/templates/pycommunity.css'), 32 ('glossary', 'tests/templates/glossary.pt'), 33 ('index', 'tests/templates/index.pt'), 34 ('js', 'tests/templates/pycommunity.js'), 35 ('packagedoc', 'tests/templates/packagedoc.pt'), 36 ('packageindex', 'tests/templates/packageindex.pt'), 37 ('packagesindex', 'tests/templates/packagesindex.pt'), 38 ('packagestats', 'tests/templates/packagestats.pt'), 39 ('recipe', 'tests/templates/recipe.pt'), 40 ('recipelist', 'tests/templates/recipelist.pt'), 41 ('tutorial', 'tests/templates/tutorial.pt'), 42 ('tutoriallist', 'tests/templates/tutoriallist.pt')] 43 43 >>> config.media 44 'te mplates/media'44 'tests/templates/media' 45 45 >>> 'projectname' in config.options 46 46 True -
pycommunity/pycommunity/doc/index.txt
r68 r78 9 9 >>> options = {'projectname': 'PyCommunity', 10 10 ... 'index': 'tests/svn/project/doc/README.txt'} 11 >>> view = IndexView('te mplates/index.pt', options)11 >>> view = IndexView('tests/templates/index.pt', options) 12 12 >>> print view() 13 13 <html> … … 22 22 >>> class Conf(object): 23 23 ... targets = {'target1': 'tests/www'} 24 ... templates = {'index': 'te mplates/index.pt',25 ... 'css': 'te mplates/pycommunity.css',26 ... 'js': 'te mplates/pycommunity.js'}27 ... media = 'te mplates/media'24 ... templates = {'index': 'tests/templates/index.pt', 25 ... 'css': 'tests/templates/pycommunity.css', 26 ... 'js': 'tests/templates/pycommunity.js'} 27 ... media = 'tests/templates/media' 28 28 ... options = {'projectname': 'PyCommunity', 29 29 ... 'index': 'tests/svn/project/doc/README.txt'} -
pycommunity/pycommunity/doc/package.txt
r68 r78 19 19 ... targets = {'target1': 'tests/www'} 20 20 ... glossary = 'tests/svn/project/doc/glossary.txt' 21 ... tutorials = {'recipes': 'tests/svn/project/tutorials'} 22 ... recipes = {'recipes': 'tests/svn/project/recipes'} 21 23 ... packages = {'package1': 'tests/svn/project/src/package1', 22 24 ... 'package2': 'tests/svn/project/src/package2' } 23 25 ... options = {'projectname': 'PyCommunity', 24 26 ... 'packages': 'tests/svn/project/doc/packages.txt'} 25 ... templates = {'packageindex': 'te mplates/packageindex.pt',26 ... 'packagesindex': 'te mplates/packagesindex.pt',27 ... 'packagestats': 'te mplates/packagestats.pt',28 ... 'packagedoc': 'te mplates/packagedoc.pt'}27 ... templates = {'packageindex': 'tests/templates/packageindex.pt', 28 ... 'packagesindex': 'tests/templates/packagesindex.pt', 29 ... 'packagestats': 'tests/templates/packagestats.pt', 30 ... 'packagedoc': 'tests/templates/packagedoc.pt'} 29 31 ... 30 32 -
pycommunity/pycommunity/doc/recipe.txt
r68 r78 12 12 >>> class Conf(object): 13 13 ... targets = {'target1': 'tests/www'} 14 ... recipes = {'recipes': 'tests/svn/project/recipes'} 15 ... templates = {'recipe': 'templates/recipe.pt', 16 ... 'recipelist': 'templates/recipelist.pt'} 14 ... tutorials = {'recipes': 'tests/svn/project/tutorials'} 15 ... recipes = {'recipes': 'tests/svn/project/recipes'} 16 ... templates = {'recipe': 'tests/templates/recipe.pt', 17 ... 'recipelist': 'tests/templates/recipelist.pt'} 17 18 ... glossary = 'tests/svn/project/doc/glossary.txt' 18 19 ... -
pycommunity/pycommunity/doc/resttask.txt
r68 r78 9 9 10 10 >>> from resttask import TaskView 11 >>> view = TaskView('te mplates/recipe.pt',11 >>> view = TaskView('tests/templates/recipe.pt', 12 12 ... 'tests/svn/project/recipes/glossary_recipe.txt', 13 ... 'tests/svn/project/doc/glossary.txt') 13 ... 'tests/svn/project/doc/glossary.txt', 14 ... ['tests/svn/project/doc/tutorials'], []) 14 15 ... 15 16 >>> title, content = view() -
pycommunity/pycommunity/doc/sitebuilder.txt
r68 r78 7 7 8 8 >>> from sitebuilder import buildSite 9 >>> buildSite( )9 >>> buildSite('tests/pycommunity.conf') 10 10 11 11 Checking the structure:: -
pycommunity/pycommunity/doc/tutorial.txt
r68 r78 12 12 >>> class Conf(object): 13 13 ... targets = {'tutorial1': 'tests/www'} 14 ... recipes = {} 14 15 ... tutorials = {'tutorials': 'tests/svn/project/tutorials'} 15 ... templates = {'tutorial': 'te mplates/tutorial.pt',16 ... 'tutoriallist': 'te mplates/tutoriallist.pt'}16 ... templates = {'tutorial': 'tests/templates/tutorial.pt', 17 ... 'tutoriallist': 'tests/templates/tutoriallist.pt'} 17 18 ... glossary = 'tests/svn/project/doc/glossary.txt' 18 19 ... -
pycommunity/pycommunity/package.py
r68 r78 158 158 self._glossary_file = configuration.glossary 159 159 self._options = configuration.options 160 self._tutorials = configuration.tutorials 161 self._recipes = configuration.recipes 160 162 161 163 for target in targets: … … 199 201 template = self._rest_template 200 202 glossary = self._glossary_file 203 tutorials = self._tutorials 204 recipes = self._recipes 201 205 202 206 for file_ in files: 203 view = TaskView(template, file_, glossary )207 view = TaskView(template, file_, glossary, tutorials, recipes) 204 208 filename = os.path.join(folder, self._getHTMLName(file_)) 205 209 self._writeFile(filename, view()[1]) -
pycommunity/pycommunity/resttask.py
r68 r78 31 31 class TaskView(object): 32 32 """generates a base view""" 33 def __init__(self, templatefile, restfile, glossaryfile): 33 def __init__(self, templatefile, restfile, glossaryfile, tutorial_folders, 34 recipe_folders): 34 35 title, content = rest2Web(restfile) 35 content = linkChecker(content, glossaryfile) 36 content = linkChecker(content, glossaryfile, tutorial_folders, 37 recipe_folders) 36 38 self.title = title 37 39 self._template = Template(open(templatefile).read(), … … 98 100 # generating the view 99 101 view = TaskView(self._getTemplateFile(configuration), 100 restfile, configuration.glossary) 102 restfile, configuration.glossary, 103 configuration.tutorials, 104 configuration.recipes) 101 105 title, result = view() 102 106 titles.append(title) -
pycommunity/pycommunity/utils.py
r68 r78 89 89 return None 90 90 91 def _grabContent(type, name ):91 def _grabContent(type, name, tutorial_folders, recipe_folders): 92 92 """gets a recipe or a turotial content""" 93 93 return """<b>Soon</b>""" 94 94 95 def linkChecker(content, glossaryfile ):95 def linkChecker(content, glossaryfile, tutorial_folders, recipe_folders): 96 96 """changes links on the fly""" 97 97 glossary = GlossaryReader(glossaryfile) … … 112 112 if 'recipe' in match.group(): 113 113 link = '../recipes/%s.html' % name 114 content = _grabContent('recipes', name) 114 content = _grabContent('recipes', name, tutorial_folders, 115 recipe_folders) 115 116 else: 116 117 link = '../tutorials/%s.html' % name 117 content = _grabContent('tutorials', name) 118 content = _grabContent('tutorials', name, tutorial_folders, 119 recipe_folders) 118 120 119 121 url = re_docs[1] -
pycommunity/setup.py
r77 r78 67 67 maintainer_email="tarek@ziade.org", 68 68 url = url, 69 download_url = '%s/PyCommunity-0.1a-py2.5.egg' % url,69 #download_url = '%s/PyCommunity-0.1a-py2.5.egg' % url, 70 70 license = "http://www.gnu.org/copyleft/gpl.html", 71 71 platforms = ["any"],
