mitmproxy/doc-src/index.py

70 lines
1.8 KiB
Python
Raw Normal View History

2011-03-17 20:04:49 +00:00
import os, sys
2010-02-16 04:09:07 +00:00
import countershape
from countershape import Page, Directory, PythonModule, markup
import countershape.grok, countershape.template
2011-03-17 20:04:49 +00:00
sys.path.insert(0, "..")
from libmproxy import filt
2010-02-16 04:09:07 +00:00
this.layout = countershape.Layout("_layout.html")
ns.docTitle = "mitmproxy"
this.markup = markup.Markdown()
2010-02-16 04:09:07 +00:00
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")
2010-02-16 04:09:07 +00:00
ns.license = file("../LICENSE").read()
ns.index_contents = file("../README.mkd").read()
top = os.path.abspath(os.getcwd())
def example(s):
d = file(os.path.join(top, s)).read()
return countershape.template.pySyntax(d)
ns.example = example
2011-03-17 20:04:49 +00:00
filt_help = []
for i in filt.filt_unary:
filt_help.append(
("~%s"%i.code, i.help)
)
for i in filt.filt_rex:
filt_help.append(
("~%s regex"%i.code, i.help)
)
for i in filt.filt_int:
filt_help.append(
("~%s int"%i.code, i.help)
)
filt_help.sort()
filt_help.extend(
[
("!", "unary not"),
("&", "and"),
("|", "or"),
("(...)", "grouping"),
]
)
ns.filt_help = filt_help
2010-02-16 04:09:07 +00:00
pages = [
Page("index.html", "Index"),
Page("intro.html", "Introduction"),
2011-03-16 02:27:26 +00:00
Page("clientreplay.html", "Client-side replay"),
Page("serverreplay.html", "Server-side replay"),
2011-03-16 02:50:31 +00:00
Page("stickycookies.html", "Sticky cookies"),
2011-03-17 20:04:49 +00:00
Page("anticache.html", "Anticache"),
Page("filters.html", "Filter expressions"),
Page("scripts.html", "External scripts"),
Page("library.html", "libmproxy: mitmproxy as a library"),
Page("ssl.html", "SSL"),
Page("faq.html", "FAQ"),
Page("admin.html", "Administrivia")
2010-02-16 04:09:07 +00:00
]