From 93373efc8cbb95a40e6b4541a72be25e2bfbad4a Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Sat, 19 Mar 2011 16:30:45 +1300 Subject: Documentation, styling to fit on website. --- doc-src/02-docstyle.css | 41 +++++++++++++++++++------------------ doc-src/_layout.html | 7 ++----- doc-src/_websitelayout.html | 40 ++++++++++++++++++++++++++++++++++++ doc-src/index.html | 50 ++++++++++++++++++++++++--------------------- doc-src/index.py | 24 ++++++++++++++++------ doc-src/library.html | 2 +- doc-src/scripts.html | 2 +- doc-src/ssl.html | 3 --- 8 files changed, 110 insertions(+), 59 deletions(-) create mode 100644 doc-src/_websitelayout.html diff --git a/doc-src/02-docstyle.css b/doc-src/02-docstyle.css index b1a90727..5e45e0e7 100644 --- a/doc-src/02-docstyle.css +++ b/doc-src/02-docstyle.css @@ -1,28 +1,35 @@ -body { - -x-system-font:none; - font-family: Helvetica,Arial,Tahoma,Verdana,Sans-Serif; - color: #555555; - font-size: 1.2em; -} a { color: #3F8ED8; } -#hd { + +#hd.doc { + -x-system-font:none; + font-family: Helvetica,Arial,Tahoma,Verdana,Sans-Serif; + color: #555555; margin: 0; border-bottom: 1px solid #999; + margin-bottom: 1em; } -#hd h1 { +#hd.doc h1 { letter-spacing: 3px; - font-size: 2em; + font-size: 2.5em; line-height: 100%; margin: 0.3em 0; font-weight: normal; } +#hd.doc #nav { + font-size: 1.5em; +} + + #bd { - padding: 20px; + -x-system-font:none; + font-family: Helvetica,Arial,Tahoma,Verdana,Sans-Serif; + font-size: 1.6em; + color: #555555; } #bd h1 { @@ -37,7 +44,7 @@ a { margin-bottom: 5px; } -#ft { +#ft.doc { color: #aaa; border-top: 1px solid #aaa; clear: both; @@ -53,11 +60,10 @@ a { pre { padding: 10px; - background-color: #e0e0e0; margin: 10px; } -ul { +.docindex, .docindex ul { margin-top: 0.1em; margin-bottom: 0; margin-left: 2em; @@ -67,11 +73,6 @@ li a { text-decoration: none; } -#nav { - float: right; - - +.highlight { + font-size: 14px; } - - - diff --git a/doc-src/_layout.html b/doc-src/_layout.html index 6010c95c..b0e68abd 100644 --- a/doc-src/_layout.html +++ b/doc-src/_layout.html @@ -1,6 +1,5 @@
-
- +
$!title!$ -
$!body!$
-
+

@!copyright!@

diff --git a/doc-src/_websitelayout.html b/doc-src/_websitelayout.html new file mode 100644 index 00000000..309c3de8 --- /dev/null +++ b/doc-src/_websitelayout.html @@ -0,0 +1,40 @@ +Fork me on GitHub +
+
+

mitmproxy

+
+ +
+
+

an SSL-capable intercepting proxy

+
+
+
+
+ + + $!title!$ + $!body!$ +
+
+
+
+

Copyright 2011 Aldo Cortesi

+
+
+ +$!ga!$ diff --git a/doc-src/index.html b/doc-src/index.html index dbbee537..b7561350 100644 --- a/doc-src/index.html +++ b/doc-src/index.html @@ -1,26 +1,30 @@ - -* [Introduction](@!urlTo("intro.html")!@) -* [Interception](@!urlTo("interception.html")!@) -* [Client-side replay](@!urlTo("clientreplay.html")!@) -* [Server-side replay](@!urlTo("serverreplay.html")!@) -* [Sticky cookies](@!urlTo("stickycookies.html")!@) -* [Anticache](@!urlTo("anticache.html")!@) -* [Filter expressions](@!urlTo("filters.html")!@) -* [Scripting API](@!urlTo("scripts.html")!@) -* [SSL](@!urlTo("/ssl.html")!@) - * [Firefox](@!urlTo("certinstall/firefox.html")!@) - * [OSX](@!urlTo("certinstall/osx.html")!@) - * [Windows 7](@!urlTo("certinstall/windows7.html")!@) - * [iPhone/iPad](@!urlTo("certinstall/ios.html")!@) -* [libmproxy](@!urlTo("library.html")!@) -* Tutorials - * Client replay: a 30 second example - * Scripting: On-the-fly modifications to HTTP conversations [coming soon] - * Sticky cookies [coming soon] - * Breaking iPhone apps for fun and profit [coming soon] -* [FAQ](@!urlTo("faq.html")!@) -* [Administrivia](@!urlTo("admin.html")!@) - + 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, "

@!this.title!@

") + this.layout = countershape.Layout("_websitelayout.html") +else: + ns.title = countershape.template.Template(None, "

@!docTitle!@ - @!this.title!@

") + 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, "

@!docTitle!@ - @!this.title!@

") 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") ] diff --git a/doc-src/library.html b/doc-src/library.html index 2266c077..5b19b61f 100644 --- a/doc-src/library.html +++ b/doc-src/library.html @@ -8,5 +8,5 @@ this lets you log in to a site using your browser, and then make subsequent requests using a tool like __curl__, which will then seem to be part of the authenticated session. -$!example("../examples/stickycookies.py")!$ +$!example("examples/stickycookies.py")!$ diff --git a/doc-src/scripts.html b/doc-src/scripts.html index 0b0b5f80..30f52ed8 100644 --- a/doc-src/scripts.html +++ b/doc-src/scripts.html @@ -8,7 +8,7 @@ The script interface is simple - scripts simply read, modify and return a single __libmproxy.flow.Flow__ object, using the methods defined in the __libmproxy.script__ module. Scripts must be executable. -$!example("../examples/simple_script")!$ +$!example("examples/simple_script")!$ diff --git a/doc-src/ssl.html b/doc-src/ssl.html index afe8f389..16dd9d8f 100644 --- a/doc-src/ssl.html +++ b/doc-src/ssl.html @@ -1,7 +1,4 @@ -SSL -=== - The first time __mitmproxy__ or __mitmdump__ is started, the following set of certificate files for a dummy Certificate Authority are created in the config directory (~/.mitmproxy by default): -- cgit v1.2.3