mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 08:35:43 +02:00
docs/server: open browser using xdg-open
This commit is contained in:
parent
601d4309ed
commit
1ff5e1a33b
2 changed files with 5 additions and 1 deletions
|
@ -1,4 +1,5 @@
|
|||
from http.server import HTTPServer, SimpleHTTPRequestHandler
|
||||
from subprocess import call
|
||||
|
||||
PORT = 8000
|
||||
URL = f"http://localhost:{PORT}"
|
||||
|
@ -8,6 +9,7 @@ class AutoBrowseHTTPServer(HTTPServer):
|
|||
def server_activate(self):
|
||||
HTTPServer.server_activate(self)
|
||||
print(f"Serving documentation at {URL}")
|
||||
call(["xdg-open", URL])
|
||||
|
||||
|
||||
class UncachedHTTPHandler(SimpleHTTPRequestHandler):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue