diff options
author | Aldo Cortesi <aldo@nullcube.com> | 2013-01-01 15:30:02 +1300 |
---|---|---|
committer | Aldo Cortesi <aldo@nullcube.com> | 2013-01-01 15:30:02 +1300 |
commit | 6f1fa30bc6bc0081917dbabe7da34c2a7ee9ea61 (patch) | |
tree | 1a14757b85c7ab3444591dce80476265bffe2e8d /doc-src | |
parent | 8b666819296e1109a3a9d92175ef507b46700e85 (diff) | |
download | mitmproxy-6f1fa30bc6bc0081917dbabe7da34c2a7ee9ea61.tar.gz mitmproxy-6f1fa30bc6bc0081917dbabe7da34c2a7ee9ea61.tar.bz2 mitmproxy-6f1fa30bc6bc0081917dbabe7da34c2a7ee9ea61.zip |
Docs: make nav sidebar work
Diffstat (limited to 'doc-src')
-rw-r--r-- | doc-src/_layout.html | 56 | ||||
-rw-r--r-- | doc-src/index.py | 15 |
2 files changed, 40 insertions, 31 deletions
diff --git a/doc-src/_layout.html b/doc-src/_layout.html index 1ea11bf2..ecc10736 100644 --- a/doc-src/_layout.html +++ b/doc-src/_layout.html @@ -19,42 +19,42 @@ <ul class="nav nav-list"> - <li><a href="@!urlTo("intro.html")!@">Introduction</a></li> - <li><a href="@!urlTo("install.html")!@">Installation</a></li> - <li><a href="@!urlTo("mitmproxy.html")!@">mitmproxy</a></li> - <li><a href="@!urlTo("mitmdump.html")!@">mitmdump</a></li> - <li><a href="@!urlTo("faq.html")!@">FAQ</a></li> + $!nav("intro.html", this, state)!$ + $!nav("install.html", this, state)!$ + $!nav("mitmproxy.html", this, state)!$ + $!nav("mitmdump.html", this, state)!$ + $!nav("faq.html", this, state)!$ <li class="nav-header">Features</li> - <li><a href="@!urlTo("clientreplay.html")!@">Client-side replay</a></li> - <li><a href="@!urlTo("serverreplay.html")!@">Server-side replay</a></li> - <li><a href="@!urlTo("sticky.html")!@">Sticky cookies and auth</a></li> - <li><a href="@!urlTo("reverseproxy.html")!@">Reverse proxy mode</a></li> - <li><a href="@!urlTo("upstreamcerts.html")!@">Upstream Certs</a></li> - <li><a href="@!urlTo("replacements.html")!@">Replacements</a></li> - <li><a href="@!urlTo("anticache.html")!@">Anticache</a></li> - <li><a href="@!urlTo("filters.html")!@">Filter expressions</a></li> - - <li class="nav-header">Scripting mitmproxy</li> - <li><a href="@!urlTo("scripting/inlinescripts.html")!@">Inline Scripts</a></li> - <li><a href="@!urlTo("scripting/libmproxy.html")!@">libmproxy</a></li> + $!nav("clientreplay.html", this, state)!$ + $!nav("serverreplay.html", this, state)!$ + $!nav("sticky.html", this, state)!$ + $!nav("reverseproxy.html", this, state)!$ + $!nav("upstreamcerts.html", this, state)!$ + $!nav("replacements.html", this, state)!$ + $!nav("anticache.html", this, state)!$ + $!nav("filters.html", this, state)!$ <li class="nav-header">SSL interception</li> - <li><a href="@!urlTo("ssl.html")!@">Overview</a></li> - <li><a href="@!urlTo("certinstall/firefox.html")!@">Firefox</a></li> - <li><a href="@!urlTo("certinstall/osx.html")!@">OSX</a></li> - <li><a href="@!urlTo("certinstall/windows7.html")!@">Windows 7</a></li> - <li><a href="@!urlTo("certinstall/ios.html")!@">iPhone/iPad</a></li> - <li><a href="@!urlTo("certinstall/android.html")!@">Android</a></li> + $!nav("ssl.html", this, state)!$ + $!nav("certinstall/firefox.html", this, state)!$ + $!nav("certinstall/osx.html", this, state)!$ + $!nav("certinstall/windows7.html", this, state)!$ + $!nav("certinstall/ios.html", this, state)!$ + $!nav("certinstall/android.html", this, state)!$ <li class="nav-header">Transparent Proxying</li> - <li><a href="@!urlTo("transparent.html")!@">Overview</a></li> - <li><a href="@!urlTo("transparent/linux.html")!@">Linux</a></li> - <li><a href="@!urlTo("transparent/osx.html")!@">OSX</a></li> + $!nav("transparent.html", this, state)!$ + $!nav("transparent/linux.html", this, state)!$ + $!nav("transparent/osx.html", this, state)!$ <li class="nav-header">Tutorials</li> - <li> <a href="@!urlTo("tutorials/30second.html")!@">Client replay: a 30 second example</a> </li> - <li> <a href="@!urlTo("tutorials/gamecenter.html")!@">Setting highscores on Apple's GameCenter</a> </li> + $!nav("tutorials/30second.html", this, state)!$ + $!nav("tutorials/gamecenter.html", this, state)!$ + + <li class="nav-header">Scripting mitmproxy</li> + $!nav("scripting/inlinescripts.html", this, state)!$ + $!nav("scripting/libmproxy.html", this, state)!$ </ul> diff --git a/doc-src/index.py b/doc-src/index.py index 2c4aa992..5b6fcc5e 100644 --- a/doc-src/index.py +++ b/doc-src/index.py @@ -1,6 +1,6 @@ import os, sys import countershape -from countershape import Page, Directory, PythonModule, markup +from countershape import Page, Directory, PythonModule, markup, model import countershape.template sys.path.insert(0, "..") from libmproxy import filt @@ -64,6 +64,15 @@ filt_help.extend( ns.filt_help = filt_help +def nav(page, current, state): + if current.match(page, False): + pre = '<li class="active">' + else: + pre = "<li>" + p = state.application.getPage(page) + return pre + '<a href="%s">%s</a></li>'%(model.UrlTo(page), p.title) +ns.nav = nav + pages = [ Page("index.html", "docs"), @@ -79,8 +88,8 @@ pages = [ Page("reverseproxy.html", "Reverse proxy mode"), Page("anticache.html", "Anticache"), Page("filters.html", "Filter expressions"), - Page("ssl.html", "Setting up SSL interception"), - Page("transparent.html", "Transparent Proxying"), + Page("ssl.html", "SSL Overview"), + Page("transparent.html", "Transparent Overview"), Directory("certinstall"), Directory("scripting"), Directory("tutorials"), |