aboutsummaryrefslogtreecommitdiffstats
path: root/setup.py
diff options
context:
space:
mode:
authorWaylan Limberg <waylan@gmail.com>2012-03-07 05:54:32 -0500
committerWaylan Limberg <waylan@gmail.com>2012-03-07 05:55:58 -0500
commitdd380f464a4eaa1a7e5eca9e4ab2b0bf32ecb835 (patch)
treee49babf34f1c5d188ff0161d053cd3472450a3cc /setup.py
parentdc49e92bad4f2534a6080849365186fe62343b8f (diff)
downloadmarkdown-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-xsetup.py20
1 files changed, 12 insertions, 8 deletions
diff --git a/setup.py b/setup.py
index 7918ee4..8bb0b22 100755
--- a/setup.py
+++ b/setup.py
@@ -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) + ' &#8212; Python Markdown'
+ if name.lower() != 'index' or parts:
+ c['page_title'] = '%s &#8212; Python Markdown' % c['title']
else:
c['page_title'] = 'Python Markdown'
# Build crumb trail
- if c['title']:
- c['crumb'] = '<li><a href="%s">%s</a> &raquo;</li>' % (file, c['title'])
+ crumbs = []
+ ctemp = '<li><a href="%s">%s</a> &raquo;</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):