diff options
author | Waylan Limberg <waylan@gmail.com> | 2012-03-07 05:54:32 -0500 |
---|---|---|
committer | Waylan Limberg <waylan@gmail.com> | 2012-03-07 05:55:58 -0500 |
commit | dd380f464a4eaa1a7e5eca9e4ab2b0bf32ecb835 (patch) | |
tree | e49babf34f1c5d188ff0161d053cd3472450a3cc /setup.py | |
parent | dc49e92bad4f2534a6080849365186fe62343b8f (diff) | |
download | markdown-dd380f464a4eaa1a7e5eca9e4ab2b0bf32ecb835.tar.gz markdown-dd380f464a4eaa1a7e5eca9e4ab2b0bf32ecb835.tar.bz2 markdown-dd380f464a4eaa1a7e5eca9e4ab2b0bf32ecb835.zip |
Fixed a few minor redering bugs in docs.
Diffstat (limited to 'setup.py')
-rwxr-xr-x | setup.py | 20 |
1 files changed, 12 insertions, 8 deletions
@@ -93,23 +93,27 @@ class build_docs(Command): c[k] = ' '.join(v) self.md.reset() # Manipulate path - path = path.lstrip(os.path.join(self.build_base, 'docs/')) + path = path[len(os.path.join(self.build_base, 'docs/')):] dir, file = os.path.split(path) name, ext = os.path.splitext(file) parts = [x for x in dir.split(os.sep) if x] c['source'] = '%s.txt' % name c['base'] = '../'*len(parts) # Build page title - parts = [x.replace('_', ' ').capitalize() for x in parts[1:]] - if name.lower() != 'index': - parts.append(name.replace('_', ' ').capitalize()) - if parts: - c['page_title'] = ' | '.join(parts) + ' — Python Markdown' + if name.lower() != 'index' or parts: + c['page_title'] = '%s — Python Markdown' % c['title'] else: c['page_title'] = 'Python Markdown' # Build crumb trail - if c['title']: - c['crumb'] = '<li><a href="%s">%s</a> »</li>' % (file, c['title']) + crumbs = [] + ctemp = '<li><a href="%s">%s</a> »</li>' + for n, part in enumerate(parts): + href = ('../'*n) + 'index.html' + label = part.replace('_', ' ').capitalize() + crumbs.append(ctemp % (href, label)) + if c['title'] and name.lower() != 'index': + crumbs.append(ctemp % (file, c['title'])) + c['crumb'] = '\n'.join(crumbs) return c def run(self): |