Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions doc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,24 @@ SPHINXOPTS =
SPHINXBUILD = sphinx-build
SPHINXPROJ = cismdoc
SOURCEDIR = source
DIRWITHCONFPY = doc-builder
BUILDDIR = build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" -c "$(DIRWITHCONFPY)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile
# 'make fetch-images' should be run before building the documentation. (If building via
# the build_docs command, this is run automatically for you.) This is needed because we
# have configured this repository (via an .lfsconfig file at the top level) to NOT
# automatically fetch any of the large files when cloning / fetching.
fetch-images:
git lfs install --force
git lfs pull --exclude="" --include=""

.PHONY: help fetch-images Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" -c "$(DIRWITHCONFPY)" $(SPHINXOPTS) $(O)
29 changes: 29 additions & 0 deletions doc/build_docs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/usr/bin/env bash
set -e

if [ ! -f doc-builder/build_docs ]; then
script_dir="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
${script_dir}/../bin/git-fleximod update doc-builder
fi

# Check if --verbose or -V was passed
verbose=false
for arg in "$@"; do
case "$arg" in
--verbose|-V) verbose=true; break ;;
esac
done

if $verbose; then
echo "Running: make fetch-images"
make fetch-images
else
make fetch-images > /dev/null 2>&1
fi

if $verbose; then
echo "Running: ./doc-builder/build_docs $@"
fi
./doc-builder/build_docs "$@"

exit 0
32 changes: 32 additions & 0 deletions doc/build_docs_to_publish
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/usr/bin/env bash
set -e

script_dir="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
if [ ! -f doc-builder/build_docs_to_publish ]; then
"${script_dir}"/../bin/git-fleximod update doc-builder
fi

# Check if --verbose or -V was passed
verbose=false
for arg in "$@"; do
case "$arg" in
--verbose|-V) verbose=true; break ;;
esac
done

cd "${script_dir}"

if $verbose; then
echo "Running: make fetch-images"
make fetch-images
else
make fetch-images > /dev/null 2>&1
fi

if $verbose; then
echo "Running: ./doc-builder/build_docs_to_publish $@"
pwd
fi
./doc-builder/build_docs_to_publish "$@"

exit 0
Loading