diff --git a/docs/README.md b/docs/README.md index 025dcdb0a7508..8ea0de0ecd5ef 100644 --- a/docs/README.md +++ b/docs/README.md @@ -37,6 +37,14 @@ Then build the docs from source: $ ./build_docs.sh ``` +The shell `./build_docs.sh` will integrate external connector docs, referencing `setup_docs.sh#integrate_connector_docs`. +This process involves cloning the repo of some external connectors, which can be time-consuming and prone to network issues. +So, if the connector docs have been synced before, and you wish to skip this step, you can do so by adding the following arg: + +```sh +$ ./build_docs.sh --skip-integrate-connector-docs +``` + The site can be viewed at http://localhost:1313/ ## Include externally hosted documentation diff --git a/docs/build_docs.sh b/docs/build_docs.sh index 80f7d0e251580..a06c7dc302b1b 100755 --- a/docs/build_docs.sh +++ b/docs/build_docs.sh @@ -24,6 +24,19 @@ then exit 1 fi git submodule update --init --recursive -./setup_docs.sh + +# whether to skip integrate connector docs. If contains arg '--skip-integrate-connector-docs' and +# the connectors directory is not empty, the external connector docs will not be generated. +connectors_dir="./themes/connectors" +SKIP_INTEGRATE_CONNECTOR_DOCS="" +for arg in "$@"; do + if [ -d "$connectors_dir" ] && [ "$arg" == "--skip-integrate-connector-docs" ]; then + SKIP_INTEGRATE_CONNECTOR_DOCS="--skip-integrate-connector-docs" + break + fi +done + +./setup_docs.sh $SKIP_INTEGRATE_CONNECTOR_DOCS + hugo mod get -u hugo -b "" serve diff --git a/docs/setup_docs.sh b/docs/setup_docs.sh index bd186e1006b0b..dd6d9750f6064 100755 --- a/docs/setup_docs.sh +++ b/docs/setup_docs.sh @@ -36,24 +36,33 @@ function integrate_connector_docs { } +SKIP_INTEGRATE_CONNECTOR_DOCS=false +for arg in "$@"; do + if [ "$arg" == "--skip-integrate-connector-docs" ]; then + SKIP_INTEGRATE_CONNECTOR_DOCS=true + break + fi +done + # Integrate the connector documentation +if [ "$SKIP_INTEGRATE_CONNECTOR_DOCS" = false ]; then + rm -rf themes/connectors/* + rm -rf tmp + mkdir tmp + cd tmp + + integrate_connector_docs elasticsearch v3.0 + integrate_connector_docs aws v4.2 + integrate_connector_docs cassandra v3.1 + integrate_connector_docs pulsar v4.0 + integrate_connector_docs jdbc v3.1 + integrate_connector_docs rabbitmq v3.0 + integrate_connector_docs gcp-pubsub v3.0 + integrate_connector_docs mongodb v1.1 + integrate_connector_docs opensearch v1.1 + integrate_connector_docs kafka v3.0 + integrate_connector_docs hbase v3.0 -rm -rf themes/connectors/* -rm -rf tmp -mkdir tmp -cd tmp - -integrate_connector_docs elasticsearch v3.0 -integrate_connector_docs aws v4.2 -integrate_connector_docs cassandra v3.1 -integrate_connector_docs pulsar v4.0 -integrate_connector_docs jdbc v3.1 -integrate_connector_docs rabbitmq v3.0 -integrate_connector_docs gcp-pubsub v3.0 -integrate_connector_docs mongodb v1.1 -integrate_connector_docs opensearch v1.1 -integrate_connector_docs kafka v3.0 -integrate_connector_docs hbase v3.0 - -cd .. -rm -rf tmp + cd .. + rm -rf tmp +fi