docs.gl
docs.gl copied to clipboard
Offline version cannot really be used offline
The offline version downloaded from About cannot be used normally without internet.
The Problem:
- Without internet, the left sidebar links, search and MathJax rendering, etc are completely not functional.
Temporary Solutions:
- I just batch replace all the external links to
jquery.min.js
,jquery-ui.min.js
from every file to links to local disk versions of these files, and it seems works out fine. (MathJax is not working of course) - And batch replace the all the home logo links on top left to
href="../index.html"
.
Maybe we can do these at the build process?
Thanks for pointing this out. I don't have the bandwidth to do these but I would love to see a PR.
The docs can be viewed offline using a local HTTP server. However, because function documentation files have no extension, a custom server that serves extensionless files as text/html
has to be used.
As a quick solution to anybody that has this issue, you can copy this python script to something like serve.py
and then run it:
#!/usr/bin/env python3
import http.server
import socketserver
class Handler(http.server.SimpleHTTPRequestHandler):
extensions_map = http.server.SimpleHTTPRequestHandler.extensions_map.copy()
extensions_map[''] = 'text/html'
host = "localhost"
port = 8080
with socketserver.TCPServer((host, port), Handler) as httpd:
print(f"serving docs at http://{host}:{port}")
httpd.serve_forever()