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 | |
parent | dc49e92bad4f2534a6080849365186fe62343b8f (diff) | |
download | markdown-dd380f464a4eaa1a7e5eca9e4ab2b0bf32ecb835.tar.gz markdown-dd380f464a4eaa1a7e5eca9e4ab2b0bf32ecb835.tar.bz2 markdown-dd380f464a4eaa1a7e5eca9e4ab2b0bf32ecb835.zip |
Fixed a few minor redering bugs in docs.
-rw-r--r-- | docs/_template.html | 2 | ||||
-rwxr-xr-x | setup.py | 20 |
2 files changed, 13 insertions, 9 deletions
diff --git a/docs/_template.html b/docs/_template.html index fa26d43..b58115d 100644 --- a/docs/_template.html +++ b/docs/_template.html @@ -3,7 +3,7 @@ <head> <meta charset=utf-8> <title>%(page_title)s</title> -<link rel="stylesheet" href="%(base)sdefault.css" type="text.css"> +<link rel="stylesheet" href="%(base)sdefault.css" type="text/css"> </head> <body> @@ -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): |