'Redirect to GitHub-hosted documentation.'

def _RedirectToRemoteHelp(self, path):

    allowed_chars = set(((string.ascii_letters + string.digits) + '._'))
    if (not (set(path) <= allowed_chars)):
        raise RuntimeError(('Unusual    chars    in    path    %r    -    possible    exploit    attempt.' % path))
    target_path = os.path.join(config.CONFIG['AdminUI.github_docs_location'], path.replace('.html', '.adoc'))
    return werkzeug_wrappers.Response(("\n<script>\nvar    friendly_hash    =    window.location.hash.replace('#_',    '#').replace(/_/g,    '-');\nwindow.location    =    '%s'    +    friendly_hash;\n</script>\n" % target_path), mimetype='text/html')
