The Botorch website was created with Docusaurus, with some customization to support tutorials, and supplemented with Sphinx for API documentation.
Ensure necessary dependencies are installed (ideally to your virtual env):
pip install -e ".[tutorials]"For convenience we provide a single shell script to convert the tutorials and build the website in one command. Must be executed from the repository root.
./scripts/build_docs.shTo also execute the tutorials, add the -t flag.
To generate a static build add the -b flag.
-h for all options.
Tutorials can be executed locally using the following script. This is optional for locally building the website and is slow.
python3 scripts/run_tutorials.py -w .We convert tutorial notebooks to MDX for embedding as docs. This needs to be done before serving the website and can be done by running this script from the project root:
python3 scripts/convert_ipynb_to_mdx.py --cleanYou need Node >= 18.x and Yarn in order to build the Botorch website.
Switch to the website dir from the project root and start the server:
cd website
yarn install
yarn startOpen http://localhost:3000 (if doesn't automatically open).
Anytime you change the contents of the page, the page should auto-update.
Note
You may need to switch to the "Next" version of the website documentation to see your latest changes.
Sphinx is used to generate an API reference from the source file docstrings. In production we use ReadTheDocs to build and host these docs, but they can also be built locally for testing.
cd sphinx/
make htmlThe build output is in sphinx/build/html/ but Sphinx does not provide a server. Here's a serving example using Python:
cd sphinx/build/html/
python3 -m http.server 8000The site is hosted on GitHub pages, automatically deployed using the Github deploy-pages action - see the config file for details.