Move include path to base object

This commit is contained in:
Anthony Johnson 2015-10-27 11:28:07 -07:00
parent d30fa32762
commit 61db34a4d6
2 changed files with 12 additions and 12 deletions

View File

@ -124,6 +124,18 @@ class PythonMapperBase(object):
slug = re.sub(r'[^\w\.]+', '-', slug).strip('-')
return os.path.join(*slug.split('.'))
@property
def include_path(self):
"""Return 'absolute' path without regarding OS path separator
This is used in ``toctree`` directives, as Sphinx always expects Unix
path separators
"""
parts = [self.url_root]
parts.extend(self.pathname.split(os.path.sep))
parts.append('index')
return '/'.join(parts)
@property
def ref_type(self):
return self.type

View File

@ -356,18 +356,6 @@ class DotNetPythonMapper(PythonMapperBase):
'''Same as above, return the truncated name instead'''
return self.ref_name.split('.')[-1]
@property
def include_path(self):
"""Return 'absolute' path without regarding OS path separator
This is used in ``toctree`` directives, as Sphinx always expects Unix
path separators
"""
parts = [self.url_root]
parts.extend(self.pathname.split(os.path.sep))
parts.append('index')
return '/'.join(parts)
@staticmethod
def transform_doc_comments(text):
"""