Allow the base URL to be set, and default to the host root.
Urlencode the heading ids, whitespace not permitted.