mirror of
https://github.com/facebookresearch/pytorch3d.git
synced 2025-12-22 15:20:34 +08:00
Setup website with docusaurus (#11)
Summary: Set up landing page, docs page, and html versions of the ipython notebook tutorials. Pull Request resolved: https://github.com/fairinternal/pytorch3d/pull/11 Reviewed By: gkioxari Differential Revision: D19730380 Pulled By: nikhilaravi fbshipit-source-id: 5df8d3f2ac2f8dce4d51f5d14fc336508c2fd0ea
This commit is contained in:
committed by
Facebook Github Bot
parent
e290f87ca9
commit
15d3a4557e
60
scripts/build_website.sh
Normal file
60
scripts/build_website.sh
Normal file
@@ -0,0 +1,60 @@
|
||||
#!/bin/bash
|
||||
# Copyright (c) Facebook, Inc. and its affiliates.
|
||||
|
||||
# run this script from the project root using `./scripts/build_docs.sh`
|
||||
|
||||
usage() {
|
||||
echo "Usage: $0 [-b]"
|
||||
echo ""
|
||||
echo "Build PyTorch3D documentation."
|
||||
echo ""
|
||||
echo " -b Build static version of documentation (otherwise start server)"
|
||||
echo ""
|
||||
exit 1
|
||||
}
|
||||
|
||||
BUILD_STATIC=false
|
||||
|
||||
while getopts 'hb' flag; do
|
||||
case "${flag}" in
|
||||
h)
|
||||
usage
|
||||
;;
|
||||
b)
|
||||
BUILD_STATIC=true
|
||||
;;
|
||||
*)
|
||||
usage
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
|
||||
echo "-----------------------------------"
|
||||
echo "Building PyTorch3d Docusaurus site"
|
||||
echo "-----------------------------------"
|
||||
cd website || exit
|
||||
yarn
|
||||
cd ..
|
||||
|
||||
echo "-----------------------------------"
|
||||
echo "Generating tutorials"
|
||||
echo "-----------------------------------"
|
||||
cwd=$(pwd)
|
||||
mkdir -p "website/_tutorials"
|
||||
mkdir -p "website/static/files"
|
||||
python scripts/parse_tutorials.py --repo_dir "${cwd}"
|
||||
|
||||
cd website || exit
|
||||
|
||||
if [[ $BUILD_STATIC == true ]]; then
|
||||
echo "-----------------------------------"
|
||||
echo "Building static site"
|
||||
echo "-----------------------------------"
|
||||
yarn build
|
||||
else
|
||||
echo "-----------------------------------"
|
||||
echo "Starting local server"
|
||||
echo "-----------------------------------"
|
||||
yarn start
|
||||
fi
|
||||
Reference in New Issue
Block a user