Skip to content

Commit 3f5113a

Browse files
Merge pull request #46 from encode/toc
Add TOC
2 parents 5f1d52b + fe7de53 commit 3f5113a

10 files changed

Lines changed: 98 additions & 284 deletions

File tree

docs/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ A starting point can be as simple as...
3838
<head>
3939
<meta charset="utf-8">
4040
<meta name="viewport" content="width=device-width, initial-scale=1.0">
41-
<title>{{ page.title }}</title>
41+
<title>{{ page.toc.title }}</title>
4242
<link rel="stylesheet" href="{{ '/css/default.css' | url }}">
4343
</head>
4444
<body>

src/mkdocs/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
from .__version__ import __title__, __version__
2-
from .mkdocs import get_current_page, get_site_index, Page, Static, SiteIndex, MkDocs, cli
2+
from .mkdocs import get_current_page, get_site, Page, Static, Site, MkDocs, cli
33

44

55
__all__ = [
66
'__title__',
77
'__version__',
88
'get_current_page',
9-
'get_site_index',
9+
'get_site',
1010
'Page',
1111
'Static',
12-
'SiteIndex',
12+
'Site',
1313
'MkDocs',
1414
'cli',
1515
]

src/mkdocs/__version__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
__title__ = "mkdocs"
2-
__version__ = "2.0.dev2"
2+
__version__ = "2.0.dev3"

src/mkdocs/default/base.html

Lines changed: 0 additions & 17 deletions
This file was deleted.

src/mkdocs/default/favicon.html

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/mkdocs/default/highlight.css

Lines changed: 0 additions & 86 deletions
This file was deleted.

src/mkdocs/default/style.css

Lines changed: 0 additions & 148 deletions
This file was deleted.

src/mkdocs/extensions/relative_urls.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
class URLProcessor(markdown.treeprocessors.Treeprocessor):
99
def run(self, root):
1010
page = mkdocs.get_current_page()
11-
site_index = mkdocs.get_site_index()
11+
site = mkdocs.get_site()
1212
key = ''
1313
link = ''
1414

@@ -34,7 +34,7 @@ def run(self, root):
3434
path_from = page.path
3535
path_to = os.path.normpath(path_from.parent.joinpath(url.path))
3636

37-
target = site_index.lookup.get(path_to)
37+
target = site.lookup.get(path_to)
3838
if target is None:
3939
continue # Broken link!
4040

0 commit comments

Comments
 (0)