Browse Source

#8 Using `webbrowser` to open HTML file

Thanks @maxiaojun !
Swaroop C H 12 years ago
parent
commit
ad953a216c
1 changed files with 4 additions and 1 deletions
  1. 4 1
      fabfile.py

+ 4 - 1
fabfile.py

@@ -249,7 +249,10 @@ def html():
             "-s",
             "--toc"] + [i["file"] for i in CONFIG["MARKDOWN_FILES"]]
     local(" ".join(args))
-    local("open {}.html".format(CONFIG["FULL_PROJECT_NAME"]))
+    html_file = "file://" + os.path.abspath(
+        "{}.html".format(CONFIG["FULL_PROJECT_NAME"]))
+    print(html_file)
+    webbrowser.open(html_file)
 
 
 @task