From f6699792da82c00de4cdcc1e413bd65caad9d3c3 Mon Sep 17 00:00:00 2001 From: Thomas Kriechbaumer Date: Sun, 25 Mar 2018 12:12:00 +0200 Subject: docs: add auto-generated options reference --- docs/src/content/concepts-filters.md | 32 +-------------------- docs/src/content/concepts-options.md | 33 +++++----------------- docs/src/generated/.gitkeep | 0 docs/src/layouts/shortcodes/readfile.html | 6 ++++ docs/src/themes/mitmproxydocs/static/css/style.css | 15 ++++++++++ 5 files changed, 29 insertions(+), 57 deletions(-) create mode 100644 docs/src/generated/.gitkeep create mode 100644 docs/src/layouts/shortcodes/readfile.html (limited to 'docs/src') diff --git a/docs/src/content/concepts-filters.md b/docs/src/content/concepts-filters.md index ada24e32..f0b9a4b2 100644 --- a/docs/src/content/concepts-filters.md +++ b/docs/src/content/concepts-filters.md @@ -10,37 +10,7 @@ menu: Many commands in the mitmproxy tool make use of filter expressions. Filter expressions consist of the following operators: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
~aMatch asset in response: CSS, Javascript, Flash, images.
~b regexBody
~bq regexRequest body
~bs regexResponse body
~c intHTTP response code
~d regexDomain
~dst regexMatch destination address
~eMatch error
~h regexHeader
~hq regexRequest header
~hs regexResponse header
~httpMatch HTTP flows
~m regexMethod
~markedMatch marked flows
~qMatch request with no response
~sMatch response
~src regexMatch source address
~t regexContent-type header
~tcpMatch TCP flows
~tq regexRequest Content-Type header
~ts regexResponse Content-Type header
~u regexURL
~websocketMatch WebSocket flows
!unary not
&and
|or
(...)grouping
- +{{< readfile file="/generated/filters.html" >}} - Regexes are Python-style - Regexes can be specified as quoted strings diff --git a/docs/src/content/concepts-options.md b/docs/src/content/concepts-options.md index 18776841..b533c175 100644 --- a/docs/src/content/concepts-options.md +++ b/docs/src/content/concepts-options.md @@ -34,33 +34,14 @@ interactively have immediate effect in the running instance, and can be made persistent by saving the settings out to a YAML configuration file (please see the specific tool's interactive help for details on how to do this). -For all tools, options can be set directly by name using the `--set` command-line -option. Please see the command-line help (`--help`) for usage. +For all tools, options can be set directly by name using the `--set` +command-line option. Please see the command-line help (`--help`) for usage. -## Example - -Here is an excerpt showing the first few lines of the complete `--options` -output: - -{{< highlight yaml >}} - -# Add all certificates of the upstream server to the certificate chain -# that will be served to the proxy client, as extras. Type bool. -add_upstream_certs_to_client_chain: false - -# Allow remote clients to connect to proxy. If set to false, client will -# not be able to connect to proxy unless it is on the same network or -# the proxyauth option is set Type bool. -allow_remote: false - -# Strip out request headers that might cause the server to return -# 304-not-modified. Type bool. -anticache: false - -# Try to convince servers to send us un-compressed data. Type bool. -anticomp: false - -{{< /highlight >}} +## Available Options +This list might not reflect what is actually available in your current mitmproxy +environment. For an up-to-date list please use the `--options` flag for each of +the mitmproxy tools. +{{< readfile file="/generated/options.html" >}} diff --git a/docs/src/generated/.gitkeep b/docs/src/generated/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/docs/src/layouts/shortcodes/readfile.html b/docs/src/layouts/shortcodes/readfile.html new file mode 100644 index 00000000..6860b0f1 --- /dev/null +++ b/docs/src/layouts/shortcodes/readfile.html @@ -0,0 +1,6 @@ +{{$file := .Get "file"}} +{{- if eq (.Get "markdown") "true" -}} +{{- $file | readFile | markdownify -}} +{{- else -}} +{{ $file | readFile | safeHTML }} +{{- end -}} diff --git a/docs/src/themes/mitmproxydocs/static/css/style.css b/docs/src/themes/mitmproxydocs/static/css/style.css index db5a36cf..d42e307e 100644 --- a/docs/src/themes/mitmproxydocs/static/css/style.css +++ b/docs/src/themes/mitmproxydocs/static/css/style.css @@ -250,6 +250,21 @@ .chroma .gu { color: #75715e; } +.badge { + color: #fff; + background-color: #6c757d; + display: inline-block; + padding: .25em .4em; + font-size: 75%; + font-weight: 1; + line-height: 1; + text-align: center; + white-space: nowrap; + vertical-align: baseline; + border-radius: 0.25rem; } + .badge:empty { + display: none; } + @keyframes spinAround { from { transform: rotate(0deg); } -- cgit v1.2.3