mirror of
https://github.com/ManimCommunity/manim.git
synced 2026-06-22 10:01:47 +00:00
Quoting the python library documentation: > The subprocess module provides more powerful facilities for spawning > new processes and retrieving their results; using that module is > preferable to using this function.
15 lines
480 B
Python
15 lines
480 B
Python
from __future__ import annotations
|
|
|
|
import subprocess
|
|
import sys
|
|
import webbrowser
|
|
from pathlib import Path
|
|
|
|
path_makefile = Path(__file__).resolve().parents[1] / "docs"
|
|
subprocess.run(["make", "html"], cwd=path_makefile)
|
|
|
|
website = (path_makefile / "build" / "html" / "index.html").absolute().as_uri()
|
|
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}")
|