Skip to content
Merged
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 makefiles/Documentation.mk
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,22 @@ HAS_DOCS = FALSE
ifneq ("$(wildcard docs)","")
ifneq ("$(wildcard mkdocs.yml)","")
HAS_DOCS = TRUE
CLEAN_TARGETS := $(CLEAN_TARGETS) docs-rm-mkdocs-image docs-rm-theme-files
LAMINAS_DOCS_DIRECTORY := $(PROJECT_DIR)docs
endif
endif

ifneq ("$(wildcard doc)","")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ifneq ("$(wildcard mkdocs.yml)","")
HAS_DOCS = TRUE
LAMINAS_DOCS_DIRECTORY := $(PROJECT_DIR)doc
endif
endif


ifeq ("$(HAS_DOCS)","TRUE")

CLEAN_TARGETS := $(CLEAN_TARGETS) docs-rm-mkdocs-image docs-rm-theme-files

HELP += $(call MK_HELP,'docs-build','Build the docs static HTML files using a Docker container')

# Fetch the documentation theme repo
Expand All @@ -32,7 +41,7 @@ endif

docs-build: docs-build-mkdocs-image
@$(DOCKER_RUN) $(MKDOCS_IMAGE_NAME) ./documentation-theme/build.sh -u https://www.example.com
$(info ${PWD}/docs/html/index.html)
$(info $(LAMINAS_DOCS_DIRECTORY)/html/index.html)
.PHONY: docs-build

# Removes the docker image for MkDocs
Expand All @@ -46,7 +55,7 @@ endif
# Removes `./documentation-theme`
docs-rm-theme-files:
@rm -rf documentation-theme
@rm -rf docs/html
@rm -rf $(LAMINAS_DOCS_DIRECTORY)/html
.PHONY: docs-rm-theme-files

endif
17 changes: 14 additions & 3 deletions makefiles/LinkChecker.mk
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,24 @@ LINK_CHECKER_DOCKERFILE := $(_MAKEFILE_DIR)link-checker/Dockerfile
LINK_CHECKER_IMAGE_ID := $(shell docker images -q ${LINK_CHECKER_IMAGE_NAME} | xargs)

ifneq ("$(wildcard docs)","")
ifneq ("$(wildcard mkdocs.yml)","")
HAS_DOCS = TRUE
QA_TARGETS := $(QA_TARGETS) docs-check-links
CLEAN_TARGETS := $(CLEAN_TARGETS) docs-rm-link-checker
LAMINAS_DOCS_DIRECTORY := $(PROJECT_DIR)docs
endif
endif

ifneq ("$(wildcard doc)","")
ifneq ("$(wildcard mkdocs.yml)","")
HAS_DOCS = TRUE
LAMINAS_DOCS_DIRECTORY := $(PROJECT_DIR)doc
endif
endif

ifeq ("$(HAS_DOCS)","TRUE")

QA_TARGETS := $(QA_TARGETS) docs-check-links
CLEAN_TARGETS := $(CLEAN_TARGETS) docs-rm-link-checker

HELP += $(call MK_HELP,'docs-check-links','Checks links in the documentation Markdown files')

docs-build-link-checker:
Expand All @@ -34,7 +45,7 @@ docs-build-link-checker-unconditionally:

docs-check-links: docs-build-link-checker
@$(call MK_INFO,"Checking links in documentation files")
@$(DOCKER_RUN) ${LINK_CHECKER_IMAGE_NAME} -t 5 -qq -f compact "docs/**/*.md" README.md
@$(DOCKER_RUN) ${LINK_CHECKER_IMAGE_NAME} -t 5 -qq -f compact "$(LAMINAS_DOCS_DIRECTORY)/**/*.md" README.md
.PHONY: docs-check-links

endif
11 changes: 11 additions & 0 deletions makefiles/MarkdownLint.mk
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,20 @@ MDLINT_CONFIG_FILE ?= https://raw.githubusercontent.com/laminas/laminas-continuo
MDLINT_IMAGE ?= davidanson/markdownlint-cli2:v0.23.2
# File pattern passed to markdownlint-cli2
MARKDOWN_FILE_PATTERN ?= *.md !COPYRIGHT.md !LICENSE.md

ifneq ("$(wildcard docs)","")
ifneq ("$(wildcard mkdocs.yml)","")
HAS_DOCS = TRUE
MARKDOWN_FILE_PATTERN := $(MARKDOWN_FILE_PATTERN) docs/**/*.md
endif
endif

ifneq ("$(wildcard doc)","")
ifneq ("$(wildcard mkdocs.yml)","")
HAS_DOCS = TRUE
MARKDOWN_FILE_PATTERN := $(MARKDOWN_FILE_PATTERN) doc/**/*.md
endif
endif

$(eval MD_FILE_COUNT := $(shell find . -type f -name '*.md' -prune \( \! -path '*/vendor/*' \) -prune \( \! -path '*/tools/*' \) -print | wc -l))

Expand Down
Loading