Commits

Robert Lehmann committed e08f229

Fixed docname resolution.

  • Participants
  • Parent commits c6f265c

Comments (0)

Files changed (1)

File sphinx/environment.py

         env = self.document.settings.env
         settings, source = self.document.settings, self.document['source']
         # XXX check if this is reliable
-        docname = posixpath.splitext(posixpath.basename(source))[0]
+        assert source.startswith(env.srcdir)
+        docname = posixpath.splitext(source[len(env.srcdir):].lstrip('/'))[0]
         section = docname.split(SEP, 1)[0]
 
         # fetch translations