manim/scripts/make_and_open_docs.py
Aathish Sivasubrahmanian 353dfdc403
Add a way to pass a custom browser if wanted. (#343)
You can now use `python make_and_open_docs.py <browser>` to open the docs in <browser>
2020-08-25 11:03:09 -04:00

13 lines
415 B
Python

from pathlib import Path
import os
import sys
import webbrowser
path_makefile = Path(__file__).parents[1] / "docs"
os.system(f"cd {path_makefile} && make html")
website = "file://" + str(path_makefile / "build" / "html" / "index.html")
try: # Allows you to pass a custom browser if you want.
webbrowser.get(sys.argv[1]).open_new_tab(f"{website}")
except IndexError:
webbrowser.open_new_tab(f"{website}")