aboutsummaryrefslogtreecommitdiffstats
path: root/doc-src/index.py
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2011-03-19 16:30:45 +1300
committerAldo Cortesi <aldo@nullcube.com>2011-03-19 16:30:45 +1300
commit93373efc8cbb95a40e6b4541a72be25e2bfbad4a (patch)
tree830821924115eed98b7d5589332b506e2700526b /doc-src/index.py
parentde73927896fabe57a489f2e9f2979070a6831373 (diff)
downloadmitmproxy-93373efc8cbb95a40e6b4541a72be25e2bfbad4a.tar.gz
mitmproxy-93373efc8cbb95a40e6b4541a72be25e2bfbad4a.tar.bz2
mitmproxy-93373efc8cbb95a40e6b4541a72be25e2bfbad4a.zip
Documentation, styling to fit on website.
Diffstat (limited to 'doc-src/index.py')
-rw-r--r--doc-src/index.py24
1 files changed, 18 insertions, 6 deletions
diff --git a/doc-src/index.py b/doc-src/index.py
index b6a0caca..0241e2f5 100644
--- a/doc-src/index.py
+++ b/doc-src/index.py
@@ -5,23 +5,34 @@ import countershape.grok, countershape.template
sys.path.insert(0, "..")
from libmproxy import filt
-this.layout = countershape.Layout("_layout.html")
+MITMPROXY_SRC = "~/git/public/mitmproxy"
+
+if ns.options.website:
+ ns.title = countershape.template.Template(None, "<h1>@!this.title!@ </h1>")
+ this.layout = countershape.Layout("_websitelayout.html")
+else:
+ ns.title = countershape.template.Template(None, "<h1> @!docTitle!@ - @!this.title!@ </h1>")
+ this.layout = countershape.Layout("_layout.html")
ns.docTitle = "mitmproxy"
this.markup = markup.Markdown()
ns.docMaintainer = "Aldo Cortesi"
ns.docMaintainerEmail = "aldo@corte.si"
ns.copyright = u"\u00a9 mitmproxy project, 2011"
-ns.title = countershape.template.Template(None, "<h1> @!docTitle!@ - @!this.title!@ </h1>")
ns.index = countershape.widgets.SiblingPageIndex('/index.html', divclass="pageindex")
-ns.license = file("../LICENSE").read()
-ns.index_contents = file("../README.mkd").read()
+def mpath(p):
+ p = os.path.join(MITMPROXY_SRC, p)
+ return os.path.expanduser(p)
+
+ns.license = file(mpath("LICENSE")).read()
+ns.index_contents = file(mpath("README.mkd")).read()
+
top = os.path.abspath(os.getcwd())
def example(s):
- d = file(os.path.join(top, s)).read()
+ d = file(mpath(s)).read()
return countershape.template.pySyntax(d)
@@ -54,7 +65,7 @@ ns.filt_help = filt_help
pages = [
- Page("index.html", "Index"),
+ Page("index.html", "docs"),
Page("intro.html", "Introduction"),
Page("interception.html", "Interception"),
Page("clientreplay.html", "Client-side replay"),
@@ -65,6 +76,7 @@ pages = [
Page("scripts.html", "External scripts"),
Page("library.html", "libmproxy: mitmproxy as a library"),
Page("ssl.html", "SSL"),
+ Directory("certinstall"),
Page("faq.html", "FAQ"),
Page("admin.html", "Administrivia")
]