Skip to content
This repository has been archived by the owner on Nov 25, 2024. It is now read-only.

Commit

Permalink
Separate docs generation from running locally
Browse files Browse the repository at this point in the history
Updates docs machinery to be able to symlink when running locally but
copy fully when generating for publish.

Signed-off-by: hasheddan <georgedanielmangum@gmail.com>
  • Loading branch information
hasheddan committed Dec 5, 2022
1 parent 673f682 commit 8bb2218
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions makelib/docs.mk
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,25 @@ DOCS_VERSION_DIR := $(DOCS_WORK_DIR)/$(DEST_DOCS_DIR)/$(DOCS_VERSION)
# ====================================================================================
# Targets

docs.generate:
docs.init:
rm -rf $(DOCS_WORK_DIR)
mkdir -p $(DOCS_WORK_DIR)
git clone --depth=1 -b master $(DOCS_GIT_REPO) $(DOCS_WORK_DIR)

docs.generate: docs.init
rm -rf $(DOCS_VERSION_DIR)
@if [ "$(DOCS_VERSION_ACTIVE)" == "true" ]; then \
$(INFO) Including version in documentation ; \
ln -s $(ROOT_DIR)/$(SOURCE_DOCS_DIR) $(DOCS_VERSION_DIR); \
cp -r $(SOURCE_DOCS_DIR)/ $(DOCS_VERSION_DIR); \
$(OK) Version included in documentation ; \
fi

docs.run: docs.generate
docs.run: docs.init
@if [ "$(DOCS_VERSION_ACTIVE)" == "true" ]; then \
$(INFO) Including version in documentation ; \
ln -s $(ROOT_DIR)/$(SOURCE_DOCS_DIR) $(DOCS_VERSION_DIR); \
$(OK) Version included in documentation ; \
fi
cd $(DOCS_WORK_DIR) && DOCS_VERSION=$(DOCS_VERSION) $(MAKE) run

docs.validate: docs.generate
Expand Down

0 comments on commit 8bb2218

Please sign in to comment.