Commits

georg.brandl  committed af07883

Merged revisions 64642-64643,64698 via svnmerge from
svn+ssh://pythondev@svn.python.org/doctools/branches/0.4.x

........
r64642 | georg.brandl | 2008-07-01 23:02:35 +0200 (Tue, 01 Jul 2008) | 2 lines

#3251: label names are case insensitive.
........
r64643 | georg.brandl | 2008-07-01 23:24:55 +0200 (Tue, 01 Jul 2008) | 2 lines

Add a note about decorated functions.
........
r64698 | georg.brandl | 2008-07-04 12:21:09 +0200 (Fri, 04 Jul 2008) | 2 lines

Allow setting current module to None.
........

  • Participants
  • Parent commits a5e1d71

Comments (0)

Files changed (3)

File doc/ext/autodoc.rst

    These work exactly like :dir:`autoclass` etc., but do not offer the options
    used for automatic member documentation.
 
+   .. note::
+
+      If you document decorated functions or methods, keep in mind that autodoc
+      retrieves its docstrings by importing the module and inspecting the
+      ``__doc__`` attribute of the given function or method.  That means that if
+      a decorator replaces the decorated function with another, it must copy the
+      original ``__doc__`` to the new function.
+
+      From Python 2.5, :func:`functools.wraps` can be used to create
+      well-behaved decorating functions.
+
 
 There are also new config values that you can set:
 

File sphinx/directives/other.py

     # stuff in module foo, but links to module foo won't lead here.
     env = state.document.settings.env
     modname = arguments[0].strip()
-    env.currmodule = modname
+    if modname == 'None':
+        env.currmodule = None
+    else:
+        env.currmodule = modname
     return []
 
 currentmodule_directive.arguments = (1, 0, 0)

File sphinx/roles.py

         # normalize whitespace in definition terms (if the term reference is
         # broken over a line, a newline will be in target)
         target = ws_re.sub(' ', target).lower()
+    elif typ == 'ref':
+        # reST label names are always lowercased
+        target = ws_re.sub('', target).lower()
     else:
         # remove all whitespace to avoid referencing problems
         target = ws_re.sub('', target)