aboutsummaryrefslogtreecommitdiffstats
path: root/python/servo
diff options
context:
space:
mode:
authorSimon Sapin <simon.sapin@exyr.org>2014-11-28 18:35:32 +0000
committerSimon Sapin <simon.sapin@exyr.org>2014-12-02 21:49:30 -0800
commit96c3c6fd434ac9493e9f877acfe666965b1d02cc (patch)
treea27181e5019bdcb124caffcdd8ac74a899822ac5 /python/servo
parentd25c66904e32759d1b06e891ff20b021f6aadc76 (diff)
downloadservo-96c3c6fd434ac9493e9f877acfe666965b1d02cc.tar.gz
servo-96c3c6fd434ac9493e9f877acfe666965b1d02cc.zip
Replace `mach serve-docs` by `mach browse-doc`, fix #3913
Diffstat (limited to 'python/servo')
-rw-r--r--python/servo/post_build_commands.py19
1 files changed, 6 insertions, 13 deletions
diff --git a/python/servo/post_build_commands.py b/python/servo/post_build_commands.py
index 2f692ce7724..236726f4771 100644
--- a/python/servo/post_build_commands.py
+++ b/python/servo/post_build_commands.py
@@ -102,18 +102,11 @@ class MachCommands(CommandBase):
return subprocess.call(["cargo", "doc"] + params,
env=self.build_env(), cwd=self.servo_crate())
- @Command('serve-docs',
- description='Locally serve Servo and Rust documentation',
+ @Command('browse-doc',
+ description='Generate documentation and open it in a web browser',
category='post-build')
- @CommandArgument(
- 'port', default=8888, nargs='?', type=int, metavar='PORT',
- help="Port to serve documentation at (default is 8888)")
- def serve_docs(self, port):
+ def serve_docs(self):
self.doc([])
- chdir(path.join("components", "servo", "target", "doc"))
- Handler = SimpleHTTPServer.SimpleHTTPRequestHandler
-
- httpd = SocketServer.TCPServer(("", port), Handler)
-
- print("serving at port", port)
- httpd.serve_forever()
+ import webbrowser
+ webbrowser.open("file://" + path.abspath(path.join(
+ "target", "doc", "servo", "index.html")))