From 64be9b1a8a695f253dfcf2188ce303791d451bfa Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Sun, 19 Jan 2014 13:52:45 +1300 Subject: Optionally take the mitmproxy path for doc rendering from a env variable. --- doc-src/index.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc-src/index.py') diff --git a/doc-src/index.py b/doc-src/index.py index e62c1709..8f18e714 100644 --- a/doc-src/index.py +++ b/doc-src/index.py @@ -5,7 +5,7 @@ import countershape.template sys.path.insert(0, "..") from libmproxy import filt, version -MITMPROXY_SRC = os.path.abspath("..") +MITMPROXY_SRC = os.environ.get("MITMPROXY_SRC", os.path.abspath("..")) ns.VERSION = version.VERSION if ns.options.website: -- cgit v1.2.3 From dc59325329c345dac70aad0b8245371338356cce Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Sun, 19 Jan 2014 17:40:26 +1300 Subject: Refactor docs to define nav sidebar in only one place. --- doc-src/index.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc-src/index.py') diff --git a/doc-src/index.py b/doc-src/index.py index 8f18e714..f222de14 100644 --- a/doc-src/index.py +++ b/doc-src/index.py @@ -15,7 +15,6 @@ else: ns.idxpath = "index.html" this.layout = countershape.Layout("_layout.html") - ns.title = countershape.template.Template(None, "

@!this.title!@

") this.titlePrefix = "%s - " % version.NAMEVERSION this.markup = markup.Markdown(extras=["footnotes"]) @@ -72,6 +71,7 @@ def nav(page, current, state): p = state.application.getPage(page) return pre + '%s'%(model.UrlTo(page), p.title) ns.nav = nav +ns.navbar = countershape.template.File(None, "_nav.html") pages = [ Page("index.html", "Introduction"), -- cgit v1.2.3 From 8f88fcedd601c0033b4469b66626a83011879baf Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Wed, 22 Jan 2014 13:33:02 +1300 Subject: Move the doc tree out into its own repo. --- doc-src/index.py | 89 -------------------------------------------------------- 1 file changed, 89 deletions(-) delete mode 100644 doc-src/index.py (limited to 'doc-src/index.py') diff --git a/doc-src/index.py b/doc-src/index.py deleted file mode 100644 index f222de14..00000000 --- a/doc-src/index.py +++ /dev/null @@ -1,89 +0,0 @@ -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, version - -MITMPROXY_SRC = os.environ.get("MITMPROXY_SRC", os.path.abspath("..")) -ns.VERSION = version.VERSION - -if ns.options.website: - ns.idxpath = "doc/index.html" - this.layout = countershape.Layout("_websitelayout.html") -else: - ns.idxpath = "index.html" - this.layout = countershape.Layout("_layout.html") - -ns.title = countershape.template.Template(None, "

@!this.title!@

") -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, %s" % datetime.date.today().year - -def mpath(p): - p = os.path.join(MITMPROXY_SRC, p) - return os.path.expanduser(p) - -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() - extemp = """
%s
(%s)
""" - return extemp%(countershape.template.Syntax("py")(d), s) -ns.example = example - - -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 - - -def nav(page, current, state): - if current.match(page, False): - pre = '
  • ' - else: - pre = "
  • " - p = state.application.getPage(page) - return pre + '%s
  • '%(model.UrlTo(page), p.title) -ns.nav = nav -ns.navbar = countershape.template.File(None, "_nav.html") - -pages = [ - Page("index.html", "Introduction"), - Page("install.html", "Installation"), - Page("mitmproxy.html", "mitmproxy"), - Page("mitmdump.html", "mitmdump"), - Page("howmitmproxy.html", "How mitmproxy works"), - - Page("ssl.html", "Overview"), - Directory("certinstall"), - Directory("scripting"), - Directory("tutorials"), - Page("transparent.html", "Overview"), - Directory("transparent"), -] -- cgit v1.2.3