diff --git a/docs/en/changelog.md b/docs/en/changelog.md index e256b77..7906c74 100644 --- a/docs/en/changelog.md +++ b/docs/en/changelog.md @@ -33,8 +33,11 @@ branch/PR. See also `tk-katana`'s `docker` version shipped with CentOS 7. - Will not re-build Docker image if `tk-doc-generator` image exists. - Force rebuild using `preview_docs.sh --rebuild`. + - Can now be run anywhere, including within `tk-doc-generator` -- `build_docs.sh`: Fixed configurations using absolute paths. +- `build_docs.sh`: + - Fixed configurations using absolute paths. + - Fixed inaccurate echo statements - `Gemfile*`: Using WWFX `just-the-docs` with [new external links test](https://github.com/shotgunsoftware/just-the-docs/pull/9) diff --git a/preview_docs.sh b/preview_docs.sh index 314e981..60a4968 100755 --- a/preview_docs.sh +++ b/preview_docs.sh @@ -55,14 +55,13 @@ esac # Setup useful directory variables for current script's folder/parent folder THIS_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" -PARENT_DIR="$( cd ${THIS_DIR}/.. >/dev/null 2>&1 && pwd )" # Build if image does not exist OR first argument is --rebuild IMAGE_TAG="${IMAGE_TAG:-tk-doc-generator}" if [ -z "$(docker images --quiet ${IMAGE_TAG})" -o "${ARG1}" == "--rebuild" ] then - docker build --tag "${IMAGE_TAG}" ${PARENT_DIR}/tk-doc-generator + docker build --tag "${IMAGE_TAG}" ${THIS_DIR} else echo "'${IMAGE_TAG}' docker image already built" echo "To force a re-build, try running this script with --rebuild flag" @@ -74,9 +73,9 @@ fi MOUNT_TO="${MOUNT_TO:-/app}" if ( docker run --help | grep --quiet -- --mount ) then - MOUNT_FLAGS='--mount '"type=bind,source=${PARENT_DIR},target=${MOUNT_TO}" + MOUNT_FLAGS='--mount '"type=bind,source=$(pwd),target=${MOUNT_TO}" else - MOUNT_FLAGS='-v '"${PARENT_DIR}:${MOUNT_TO}" + MOUNT_FLAGS='-v '"$(pwd):${MOUNT_TO}" fi @@ -85,10 +84,8 @@ docker run --rm \ ${MOUNT_FLAGS} \ ${IMAGE_TAG} \ --url="http://localhost" \ - --url-path="${PARENT_DIR}/_build" \ + --url-path="$(pwd)/_build" \ --source="${MOUNT_TO}/docs" \ --output="${MOUNT_TO}/_build" - -echo "Documentation built in ${PARENT_DIR}/_build/index.html" -echo "Be sure to run 'docker container prune' to remove finished containers." +echo "Documentation built. Open in web-browser: $(pwd)/_build/index.html" diff --git a/scripts/build_docs.sh b/scripts/build_docs.sh index 0202da1..d5075fb 100755 --- a/scripts/build_docs.sh +++ b/scripts/build_docs.sh @@ -70,13 +70,12 @@ echo "Cleaning out final build location '${OUTPUT}'..." rm -rf ${OUTPUT} echo "Creating build location '${TMP_BUILD_FOLDER}'..." -mkdir -p ${TMP_BUILD_FOLDER} +mkdir -p ${TMP_BUILD_FOLDER}/_plugins -echo "Copying source files into '${TMP_FOLDER}'..." +echo "Copying source files into '${TMP_BUILD_FOLDER}'..." cp -r ${SOURCE}/* ${TMP_BUILD_FOLDER} -echo "Copying plugins into '${TMP_FOLDER}/_plugins'..." -mkdir -p ${TMP_BUILD_FOLDER}/_plugins +echo "Copying plugins into '${TMP_BUILD_FOLDER}/_plugins'..." cp -nr ${TK_DOC_GEN_SRC}/jekyll/_plugins/* ${TMP_BUILD_FOLDER}/_plugins echo "Running Sphinx RST -> Markdown build process..." diff --git a/scripts/get-tk-core-packages.sh b/scripts/get-tk-core-packages.sh index 2d44f68..b966142 100755 --- a/scripts/get-tk-core-packages.sh +++ b/scripts/get-tk-core-packages.sh @@ -30,7 +30,7 @@ Example: EOF } -if [ $# -ne 1 -o ] +if [ $# -ne 1 ] then echo 'ERROR: Please provide a folder to download/install into!' echo