From python-checkins at python.org Wed Aug 1 14:03:27 2007 From: python-checkins at python.org (georg.brandl) Date: Wed, 1 Aug 2007 14:03:27 +0200 (CEST) Subject: [Python-checkins] r56640 - in doctools/trunk/converter: filenamemap.py newfiles/ACKS newfiles/about.rst Message-ID: <20070801120327.367BD1E4009@bag.python.org> Author: georg.brandl Date: Wed Aug 1 14:03:25 2007 New Revision: 56640 Added: doctools/trunk/converter/newfiles/ACKS Modified: doctools/trunk/converter/filenamemap.py doctools/trunk/converter/newfiles/about.rst Log: Add the ACKS file and include it in the "About" document. Modified: doctools/trunk/converter/filenamemap.py ============================================================================== --- doctools/trunk/converter/filenamemap.py (original) +++ doctools/trunk/converter/filenamemap.py Wed Aug 1 14:03:25 2007 @@ -454,6 +454,8 @@ 'reference', 'tutorial', 'whatsnew', + 'lib', + 'tools', ] # includefiles for \verbatiminput and \input @@ -476,6 +478,7 @@ newfiles_mapping = { 'conf.py': 'conf.py', 'TODO': 'TODO', + 'ACKS': 'ACKS', 'ref_index.rst': 'reference/index.rst', 'tutorial_index.rst': 'tutorial/index.rst', Added: doctools/trunk/converter/newfiles/ACKS ============================================================================== --- (empty file) +++ doctools/trunk/converter/newfiles/ACKS Wed Aug 1 14:03:25 2007 @@ -0,0 +1,197 @@ +Contributors to the Python Documentation +---------------------------------------- + +This file lists people who have contributed in some way to the Python +documentation. It is probably not complete -- if you feel that you or +anyone else should be on this list, please let us know (send email to +docs at python.org), and we'll be glad to correct the problem. + +It is only with the input and contributions of the Python community +that Python has such wonderful documentation -- Thank You! + + +* Aahz +* Michael Abbott +* Steve Alexander +* Jim Ahlstrom +* Fred Allen +* A. Amoroso +* Pehr Anderson +* Oliver Andrich +* Jes?s Cea Avi?n +* Daniel Barclay +* Chris Barker +* Don Bashford +* Anthony Baxter +* Bennett Benson +* Jonathan Black +* Robin Boerdijk +* Michal Bozon +* Aaron Brancotti +* Keith Briggs +* Lee Busby +* Lorenzo M. Catucci +* Mauro Cicognini +* Gilles Civario +* Mike Clarkson +* Steve Clift +* Dave Cole +* Matthew Cowles +* Jeremy Craven +* Andrew Dalke +* Ben Darnell +* L. Peter Deutsch +* Robert Donohue +* Fred L. Drake, Jr. +* Jeff Epler +* Michael Ernst +* Blame Andy Eskilsson +* Carey Evans +* Martijn Faassen +* Carl Feynman +* Hern?n Mart?nez Foffani +* Stefan Franke +* Jim Fulton +* Peter Funk +* Lele Gaifax +* Matthew Gallagher +* Ben Gertzfield +* Nadim Ghaznavi +* Jonathan Giddy +* Shelley Gooch +* Nathaniel Gray +* Grant Griffin +* Thomas Guettler +* Anders Hammarquist +* Mark Hammond +* Harald Hanche-Olsen +* Manus Hand +* Gerhard H?ring +* Travis B. Hartwell +* Janko Hauser +* Bernhard Herzog +* Magnus L. Hetland +* Konrad Hinsen +* Stefan Hoffmeister +* Albert Hofkamp +* Gregor Hoffleit +* Steve Holden +* Thomas Holenstein +* Gerrit Holl +* Rob Hooft +* Brian Hooper +* Randall Hopper +* Michael Hudson +* Eric Huss +* Jeremy Hylton +* Roger Irwin +* Jack Jansen +* Philip H. Jensen +* Pedro Diaz Jimenez +* Kent Johnson +* Lucas de Jonge +* Andreas Jung +* Robert Kern +* Jim Kerr +* Jan Kim +* Greg Kochanski +* Guido Kollerie +* Peter A. Koren +* Daniel Kozan +* Andrew M. Kuchling +* Dave Kuhlman +* Erno Kuusela +* Detlef Lannert +* Piers Lauder +* Glyph Lefkowitz +* Marc-Andr? Lemburg +* Ulf A. Lindgren +* Everett Lipman +* Mirko Liss +* Martin von L?wis +* Fredrik Lundh +* Jeff MacDonald +* John Machin +* Andrew MacIntyre +* Vladimir Marangozov +* Vincent Marchetti +* Laura Matson +* Daniel May +* Doug Mennella +* Paolo Milani +* Skip Montanaro +* Paul Moore +* Ross Moore +* Sjoerd Mullender +* Dale Nagata +* Ng Pheng Siong +* Koray Oner +* Tomas Oppelstrup +* Denis S. Otkidach +* Zooko O'Whielacronx +* William Park +* Joonas Paalasmaa +* Harri Pasanen +* Bo Peng +* Tim Peters +* Christopher Petrilli +* Justin D. Pettit +* Chris Phoenix +* Fran?ois Pinard +* Paul Prescod +* Eric S. Raymond +* Edward K. Ream +* Sean Reifschneider +* Bernhard Reiter +* Armin Rigo +* Wes Rishel +* Jim Roskind +* Guido van Rossum +* Donald Wallace Rouse II +* Nick Russo +* Chris Ryland +* Constantina S. +* Hugh Sasse +* Bob Savage +* Scott Schram +* Neil Schemenauer +* Barry Scott +* Joakim Sernbrant +* Justin Sheehy +* Michael Simcich +* Ionel Simionescu +* Gregory P. Smith +* Roy Smith +* Clay Spence +* Nicholas Spies +* Tage Stabell-Kulo +* Frank Stajano +* Anthony Starks +* Greg Stein +* Peter Stoehr +* Mark Summerfield +* Reuben Sumner +* Kalle Svensson +* Jim Tittsler +* Ville Vainio +* Martijn Vries +* Charles G. Waldman +* Greg Ward +* Barry Warsaw +* Corran Webster +* Glyn Webster +* Bob Weiner +* Eddy Welbourne +* Mats Wichmann +* Gerry Wiener +* Timothy Wild +* Collin Winter +* Blake Winton +* Dan Wolfe +* Steven Work +* Thomas Wouters +* Ka-Ping Yee +* Rory Yorke +* Moshe Zadka +* Milan Zamazal +* Cheng Zhang Modified: doctools/trunk/converter/newfiles/about.rst ============================================================================== --- doctools/trunk/converter/newfiles/about.rst (original) +++ doctools/trunk/converter/newfiles/about.rst Wed Aug 1 14:03:25 2007 @@ -13,4 +13,6 @@ docs at python.org mailing list. We're always looking for volunteers wanting to help with the docs, so feel free to send a mail there! -See :ref:`reporting-bugs` for information how to report bugs in Python itself. \ No newline at end of file +See :ref:`reporting-bugs` for information how to report bugs in Python itself. + +.. include:: ACKS \ No newline at end of file From python-checkins at python.org Wed Aug 1 14:46:17 2007 From: python-checkins at python.org (georg.brandl) Date: Wed, 1 Aug 2007 14:46:17 +0200 (CEST) Subject: [Python-checkins] r56641 - in doctools/trunk/converter: filenamemap.py newfiles/TODO newfiles/doc_markup.rst restwriter.py Message-ID: <20070801124617.1B04E1E4003@bag.python.org> Author: georg.brandl Date: Wed Aug 1 14:46:16 2007 New Revision: 56641 Modified: doctools/trunk/converter/filenamemap.py doctools/trunk/converter/newfiles/TODO doctools/trunk/converter/newfiles/doc_markup.rst doctools/trunk/converter/restwriter.py Log: Get rid of the remaining warnings in the conversion. Modified: doctools/trunk/converter/filenamemap.py ============================================================================== --- doctools/trunk/converter/filenamemap.py (original) +++ doctools/trunk/converter/filenamemap.py Wed Aug 1 14:46:16 2007 @@ -546,6 +546,7 @@ toctree_mapping = { 'mac/scripting': ['gensuitemodule', 'aetools', 'aepack', 'aetypes', 'miniae'], 'mac/toolbox': ['colorpicker'], + 'mac/undoc': [], 'lib/libstrings': ['string', 're', 'struct', 'difflib', 'stringio', 'textwrap', 'codecs', 'unicodedata', 'stringprep', 'fpformat'], 'lib/datatypes': ['datetime', 'calendar', 'collections', 'heapq', 'bisect', @@ -601,6 +602,7 @@ 'lib/libsgi': ['al', 'cd', 'fl', 'fm', 'gl', 'imgfile', 'jpeg'], 'lib/libsun': ['sunaudio'], 'lib/windows': ['msilib', 'msvcrt', '_winreg', 'winsound'], + 'lib/tkinter': [], } # map sourcefilename to [pre, post] Modified: doctools/trunk/converter/newfiles/TODO ============================================================================== --- doctools/trunk/converter/newfiles/TODO (original) +++ doctools/trunk/converter/newfiles/TODO Wed Aug 1 14:46:16 2007 @@ -14,5 +14,5 @@ * write "About these documents" * finish "Documenting Python" * extend copyright.rst -* merge ACKS into about.rst * fix the "quadruple" index term +* fix :file: and |version| in install \ No newline at end of file Modified: doctools/trunk/converter/newfiles/doc_markup.rst ============================================================================== --- doctools/trunk/converter/newfiles/doc_markup.rst (original) +++ doctools/trunk/converter/newfiles/doc_markup.rst Wed Aug 1 14:46:16 2007 @@ -368,8 +368,6 @@ The name of a file or directory. -.. XXX: filenq, filevar - .. describe:: guilabel Labels presented as part of an interactive user interface should be marked Modified: doctools/trunk/converter/restwriter.py ============================================================================== --- doctools/trunk/converter/restwriter.py (original) +++ doctools/trunk/converter/restwriter.py Wed Aug 1 14:46:16 2007 @@ -332,6 +332,8 @@ # loses comments, but huh return EmptyNode() if isinstance(subnode, InlineNode): + if subnode.cmdname in ('filevar', 'envvar'): + return NodeList([TextNode('{'), do(subnode.args[0]), TextNode('}')]) if subnode.cmdname == 'optional': # this is not mapped to ReST markup return subnode @@ -639,7 +641,7 @@ self.write_directive('deprecated', text(node.args[0]), node.args[1], spbelow=False) elif cmdname == 'localmoduletable': - if self.toctree: + if self.toctree is not None: self.write_directive('toctree', '', spbelow=True, spabove=True) with self.indented(): for entry in self.toctree: @@ -830,7 +832,7 @@ # maps argumentless commands to text simplecmd_mapping = { - 'NULL': '`NULL`', + 'NULL': '*NULL*', 'shortversion': '|version|', 'version': '|release|', 'today': '|today|', @@ -848,6 +850,7 @@ 'method': 'meth', 'module': 'mod', 'programopt': 'option', + 'filenq': 'file', # these mean: no change 'cdata': '', 'class': '', @@ -857,8 +860,6 @@ 'dfn': '', 'envvar': '', 'file': '', - 'filenq': '', - 'filevar': '', 'guilabel': '', 'kbd': '', 'keyword': '', @@ -890,7 +891,7 @@ if cmdname in ('code', 'bfcode', 'samp', 'texttt', 'regexp'): self.visit_wrapped('``', self.get_textonly_node(content, 'code', warn=1), '``', noescape=True) - elif cmdname in ('emph', 'textit'): + elif cmdname in ('emph', 'textit', 'var'): self.visit_wrapped('*', self.get_textonly_node(content, 'emph', warn=1), '*') elif cmdname in ('strong', 'textbf'): @@ -898,7 +899,7 @@ warn=1), '**') elif cmdname in ('b', 'textrm', 'email'): self.visit_node(content) - elif cmdname in ('var', 'token'): + elif cmdname == 'token': # \token appears in productionlists only self.visit_wrapped('`', self.get_textonly_node(content, 'var', warn=1), '`') @@ -948,11 +949,13 @@ self.visit_wrapped('(', node.args[1], ')') elif cmdname == 'longprogramopt': self.visit_wrapped(':option:`--', content, '`') + elif cmdname == 'filevar': + self.visit_wrapped(':file:`{', content, '}`') elif cmdname == '': self.visit_node(content) # stray commands from distutils elif cmdname in ('argument name', 'value', 'attribute', 'option name'): - self.visit_wrapped('`', content, '`') + self.visit_wrapped('*', content, '*') else: self.visit_wrapped(':%s:`' % (self.role_mapping[cmdname] or cmdname), self.get_textonly_node( From python-checkins at python.org Wed Aug 1 16:09:19 2007 From: python-checkins at python.org (georg.brandl) Date: Wed, 1 Aug 2007 16:09:19 +0200 (CEST) Subject: [Python-checkins] r56642 - in doctools/trunk: TODO converter/newfiles/doc_markup.rst sphinx/roles.py sphinx/style/default.css Message-ID: <20070801140919.081851E4003@bag.python.org> Author: georg.brandl Date: Wed Aug 1 16:09:18 2007 New Revision: 56642 Modified: doctools/trunk/TODO doctools/trunk/converter/newfiles/doc_markup.rst doctools/trunk/sphinx/roles.py doctools/trunk/sphinx/style/default.css Log: Make system messages stand out in HTML output. Modified: doctools/trunk/TODO ============================================================================== --- doctools/trunk/TODO (original) +++ doctools/trunk/TODO Wed Aug 1 16:09:18 2007 @@ -1,6 +1,7 @@ Global TODO =========== +- "often used" combo box in sidebar - discuss and debug comments system - navigation links at the bottom too - write new Makefile, handle automatic version info and checkout @@ -11,4 +12,3 @@ - look at the old tools/ scripts, what functionality should be rewritten - add search via Xapian? - optionally have a contents tree view in the sidebar (AJAX based)? - Modified: doctools/trunk/converter/newfiles/doc_markup.rst ============================================================================== --- doctools/trunk/converter/newfiles/doc_markup.rst (original) +++ doctools/trunk/converter/newfiles/doc_markup.rst Wed Aug 1 16:09:18 2007 @@ -362,11 +362,17 @@ .. describe:: envvar - An environment variable. Index entries are generated. + An environment variable. Index entries are generated. .. describe:: file - The name of a file or directory. + The name of a file or directory. Within the contents, you can use curly + braces to indicate a "variable" part, for example:: + + ... is installed in :file:`/usr/lib/python2.{x}/site-packages` ... + + In the built documentation, the ``x`` will be displayed differently to + indicate that it is to be replaced by the Python minor version. .. describe:: guilabel Modified: doctools/trunk/sphinx/roles.py ============================================================================== --- doctools/trunk/sphinx/roles.py (original) +++ doctools/trunk/sphinx/roles.py Wed Aug 1 16:09:18 2007 @@ -21,9 +21,6 @@ generic_docroles = { 'command' : nodes.strong, 'dfn' : nodes.emphasis, - 'file' : nodes.emphasis, - 'filenq' : nodes.emphasis, - 'filevar' : nodes.emphasis, 'guilabel' : nodes.strong, 'kbd' : nodes.literal, 'keyword' : nodes.literal, @@ -114,7 +111,25 @@ def menusel_role(typ, rawtext, text, lineno, inliner, options={}, content=[]): - return [nodes.emphasis(rawtext, text.replace('-->', u'\N{TRIANGULAR BULLET}'))], [] + return [nodes.emphasis( + rawtext, utils.unescape(text).replace('-->', u'\N{TRIANGULAR BULLET}'))], [] + + +_filevar_re = re.compile('{([^}]+)}') + +def file_role(typ, rawtext, text, lineno, inliner, options={}, content=[]): + text = utils.unescape(text) + retnodes = [] + pos = 0 + for m in _filevar_re.finditer(text): + if m.start() > pos: + txt = text[pos:m.start()] + retnodes.append(nodes.literal(txt, txt)) + retnodes.append(nodes.emphasis('', '', nodes.literal(m.group(1), m.group(1)))) + pos = m.end() + if pos < len(text): + retnodes.append(nodes.literal(text[pos:], text[pos:])) + return retnodes, [] specific_docroles = { @@ -137,6 +152,7 @@ 'token' : xfileref_role, 'menuselection' : menusel_role, + 'file' : file_role, } for rolename, func in specific_docroles.iteritems(): Modified: doctools/trunk/sphinx/style/default.css ============================================================================== --- doctools/trunk/sphinx/style/default.css (original) +++ doctools/trunk/sphinx/style/default.css Wed Aug 1 16:09:18 2007 @@ -744,6 +744,12 @@ margin-bottom: 10px; } +.system-message { + background-color: #fda; + padding: 5px; + border: 3px solid red; +} + /* :::: PRINT :::: */ @media print { div.documentwrapper { From python-checkins at python.org Wed Aug 1 17:31:11 2007 From: python-checkins at python.org (georg.brandl) Date: Wed, 1 Aug 2007 17:31:11 +0200 (CEST) Subject: [Python-checkins] r56643 - in doctools/trunk: converter/newfiles/conf.py converter/newfiles/doc_sphinx.rst converter/util.py sphinx/roles.py Message-ID: <20070801153111.7314B1E4008@bag.python.org> Author: georg.brandl Date: Wed Aug 1 17:31:10 2007 New Revision: 56643 Modified: doctools/trunk/converter/newfiles/conf.py doctools/trunk/converter/newfiles/doc_sphinx.rst doctools/trunk/converter/util.py doctools/trunk/sphinx/roles.py Log: Strip parentheses during conversion, add them during build. Modified: doctools/trunk/converter/newfiles/conf.py ============================================================================== --- doctools/trunk/converter/newfiles/conf.py (original) +++ doctools/trunk/converter/newfiles/conf.py Wed Aug 1 17:31:10 2007 @@ -37,5 +37,5 @@ # typographically correct entities. use_smartypants = True -# If true, trailing '()' will be stripped from :func: etc. cross-references. -strip_trailing_parentheses = False +# If true, '()' will be appended to :func: etc. cross-reference text. +add_function_parentheses = True Modified: doctools/trunk/converter/newfiles/doc_sphinx.rst ============================================================================== --- doctools/trunk/converter/newfiles/doc_sphinx.rst (original) +++ doctools/trunk/converter/newfiles/doc_sphinx.rst Wed Aug 1 17:31:10 2007 @@ -50,6 +50,6 @@ If true, use SmartyPants to convert quotes and dashes to the typographically correct entities. -strip_trailing_parentheses : bool - If true, trailing parentheses will be stripped from ``:func:`` etc. - crossreferences. \ No newline at end of file +add_function_parentheses : bool + If true, ``()`` will be appended to the content of ``:func:``, ``:meth:`` and + ``:cfunc:`` cross-references. \ No newline at end of file Modified: doctools/trunk/converter/util.py ============================================================================== --- doctools/trunk/converter/util.py (original) +++ doctools/trunk/converter/util.py Wed Aug 1 17:31:10 2007 @@ -70,6 +70,7 @@ wordchars_e = alphanum + u'+`(-' bad_markup_re = re.compile(r'(:[a-zA-Z0-9_-]+:)?(`{1,2})[ ]*(.+?)[ ]*(\2)') quoted_code_re = re.compile(r'\\`(``.+?``)\'') +paren_re = re.compile(r':(func|meth|cfunc):`(.*?)\(\)`') def repair_bad_inline_markup(text): # remove quoting from `\code{x}' @@ -80,6 +81,9 @@ # special: literal backquotes xtext = xtext.replace('``````', '\x02') + # remove () from function markup + xtext = paren_re.sub(r':\1:`\2`', xtext) + ntext = [] lasti = 0 l = len(xtext) Modified: doctools/trunk/sphinx/roles.py ============================================================================== --- doctools/trunk/sphinx/roles.py (original) +++ doctools/trunk/sphinx/roles.py Wed Aug 1 17:31:10 2007 @@ -98,9 +98,9 @@ # 'token' is the default role inside 'productionlist' directives if typ == '': typ = 'token' - if env.config.get('strip_trailing_parentheses', False): - if text[-2:] == '()': - text = text[:-2] + if typ in ('func', 'meth', 'cfunc') and \ + env.config.get('add_function_parentheses', True): + text += '()' pnode = addnodes.pending_xref(rawtext) pnode['reftype'] = typ pnode['reftarget'] = ws_re.sub('', text) From python-checkins at python.org Wed Aug 1 17:36:53 2007 From: python-checkins at python.org (georg.brandl) Date: Wed, 1 Aug 2007 17:36:53 +0200 (CEST) Subject: [Python-checkins] r56644 - in doctools/trunk: TODO sphinx/templates/layout.html Message-ID: <20070801153653.0F2DE1E4009@bag.python.org> Author: georg.brandl Date: Wed Aug 1 17:36:52 2007 New Revision: 56644 Modified: doctools/trunk/TODO doctools/trunk/sphinx/templates/layout.html Log: Add a navbar at the bottom too. Modified: doctools/trunk/TODO ============================================================================== --- doctools/trunk/TODO (original) +++ doctools/trunk/TODO Wed Aug 1 17:36:52 2007 @@ -3,10 +3,8 @@ - "often used" combo box in sidebar - discuss and debug comments system -- navigation links at the bottom too - write new Makefile, handle automatic version info and checkout - write a "printable" builder (export to latex, most probably) -- discuss the default role - discuss lib -> ref section move - prepare for databases other than sqlite for comments - look at the old tools/ scripts, what functionality should be rewritten Modified: doctools/trunk/sphinx/templates/layout.html ============================================================================== --- doctools/trunk/sphinx/templates/layout.html (original) +++ doctools/trunk/sphinx/templates/layout.html Wed Aug 1 17:36:52 2007 @@ -42,6 +42,7 @@ {% block head %}{% endblock %} +{% filter capture('relbar') %} +{% endfilter %}
{%- if builder != 'htmlhelp' %} @@ -80,6 +82,7 @@ {%- endif %}
+{{ relbar }}