diff options
author | Aldo Cortesi <aldo@nullcube.com> | 2014-01-19 13:28:18 +1300 |
---|---|---|
committer | Aldo Cortesi <aldo@nullcube.com> | 2014-01-19 13:28:18 +1300 |
commit | 5782f9393ec5a8f16168c1324d3cc96136718760 (patch) | |
tree | d2f81591febd1515b3f31d046a36e69a7a3eb9b9 /doc-src/index.py | |
parent | bf1399fa2bc2f34a480a27f2a8ec98f2e479ddc2 (diff) | |
parent | 5acbef236c503bf973a5782dd0139efa977824ea (diff) | |
download | mitmproxy-5782f9393ec5a8f16168c1324d3cc96136718760.tar.gz mitmproxy-5782f9393ec5a8f16168c1324d3cc96136718760.tar.bz2 mitmproxy-5782f9393ec5a8f16168c1324d3cc96136718760.zip |
Merge branch 'master' of ssh.github.com:cortesi/mitmproxy
Diffstat (limited to 'doc-src/index.py')
-rw-r--r-- | doc-src/index.py | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/doc-src/index.py b/doc-src/index.py index 3333a1b9..e62c1709 100644 --- a/doc-src/index.py +++ b/doc-src/index.py @@ -1,11 +1,12 @@ -import os, sys +import os, sys, datetime import countershape from countershape import Page, Directory, PythonModule, markup, model import countershape.template sys.path.insert(0, "..") -from libmproxy import filt +from libmproxy import filt, version -MITMPROXY_SRC = "~/mitmproxy/mitmproxy" +MITMPROXY_SRC = os.path.abspath("..") +ns.VERSION = version.VERSION if ns.options.website: ns.idxpath = "doc/index.html" @@ -16,18 +17,20 @@ else: ns.title = countershape.template.Template(None, "<h1>@!this.title!@</h1>") -this.titlePrefix = "mitmproxy 0.10 - " +this.titlePrefix = "%s - " % version.NAMEVERSION this.markup = markup.Markdown(extras=["footnotes"]) ns.docMaintainer = "Aldo Cortesi" ns.docMaintainerEmail = "aldo@corte.si" -ns.copyright = u"\u00a9 mitmproxy project, 2013" +ns.copyright = u"\u00a9 mitmproxy project, %s" % datetime.date.today().year def mpath(p): p = os.path.join(MITMPROXY_SRC, p) return os.path.expanduser(p) -ns.index_contents = file(mpath("README.mkd")).read() +with open(mpath("README.mkd")) as f: + readme = f.read() + ns.index_contents = readme.split("\n", 1)[1] #remove first line (contains build status) def example(s): d = file(mpath(s)).read().rstrip() |