Proxing all small web through /x/ might not be desirable. In this commit I am adding a new argument, -p, that allows proxing all external requests using a third party proxy, like Portal (https://portal.mozz.us).
By proding a value for this parameter any request made to `/x/` whose host does not match the root host will be rejected.
This will generate `id` attributes for all heading levels. The labels
are generated using steps 1-4 of the gitlab flavored markdown algorithm
which seems to be pretty standard for generating anchors:
https://docs.gitlab.com/ee/user/markdown.html#header-ids-and-links
A unique ID isn't appended to avoid having to store a list of previous
headers to compare against.
This overrides any robots.txt file in the proxied gemini capsule, on the
basis that this is intended for gemini robots (which can be expected to
follow the robots.txt companion spec) rather than web robots.
The main purpose though for disallowing web robots is to prevent them
from crawling the proxied cross-site geminispace under /x/, since web
robots won't know even to read the robots.txt files for other capsules
proxied this way.
By default, kineto loads a stylesheet given to -s from disk and places
it inline with the HTML in a <style>...</style> block. This patch adds
a -e flag to load a stylesheet externally. When the -e flag is passed
with a URI (relative or absolute), the given link is placed in the href
of a <link rel="stylesheet"...> tag. This helps facilitate caching
which can *significantly* reduce request overhead, particularly when the
stylesheet is large (>= the size of the page content).
The given URI is not validated, and if it is invalid the browser will
404 when requesting it and the page will have no style.