From 1319f8b0184d2b3d40fcc3cefdf96091824e12de Mon Sep 17 00:00:00 2001 From: liuyuzhou Date: Sat, 2 Nov 2024 16:42:35 +0800 Subject: [PATCH] Add Doc shell script --- docs/README.md | 3 ++- docs/make.sh | 29 +++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100755 docs/make.sh diff --git a/docs/README.md b/docs/README.md index fbd58155a5141..1191c934395ff 100644 --- a/docs/README.md +++ b/docs/README.md @@ -15,7 +15,8 @@ it is expected to replace various mediums like: ```bash pip install sphinx sphinx-design sphinxawesome-theme -make html +chmod a+x make.sh +./make.sh html ``` That's it! You can view the documentation under `./build/html/index.html` in your browser. diff --git a/docs/make.sh b/docs/make.sh new file mode 100755 index 0000000000000..c6ebbb2d09d83 --- /dev/null +++ b/docs/make.sh @@ -0,0 +1,29 @@ +#!/bin/sh + +# Command file for Sphinx documentation + +if [ -z "$SPHINXBUILD" ]; then + SPHINXBUILD=sphinx-build +fi +SOURCEDIR=source +BUILDDIR=build + +$SPHINXBUILD > /dev/null 2>&1 +if [ $? -eq 127 ]; then + echo + echo "The 'sphinx-build' command was not found. Make sure you have Sphinx" + echo "installed, then set the SPHINXBUILD environment variable to point" + echo "to the full path of the 'sphinx-build' executable. Alternatively you" + echo "may add the Sphinx directory to PATH." + echo + echo "If you don't have Sphinx installed, grab it from" + echo "https://www.sphinx-doc.org/" + exit 1 +fi + +if [ -z "$1" ]; then + $SPHINXBUILD -M help $SOURCEDIR $BUILDDIR $SPHINXOPTS $O + exit 0 +fi + +$SPHINXBUILD -M "$1" $SOURCEDIR $BUILDDIR $SPHINXOPTS $O \ No newline at end of file