Skip to content

Commit 36e1a62

Browse files
github-actions[bot]grafanabotitsmylife
authored
Update make docs procedure (#322)
To test the changes, run the following and browse to URL output by the script: ```console git fetch git checkout origin/update-make-docs cd docs make docs ``` --------- Co-authored-by: grafanabot <bot@grafana.com> Co-authored-by: ismail simsek <ismailsimsek09@gmail.com>
1 parent dfc801b commit 36e1a62

File tree

2 files changed

+9
-62
lines changed

2 files changed

+9
-62
lines changed

docs/docs.mk

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,6 @@ ifeq ($(PROJECTS),)
3131
$(error "PROJECTS variable must be defined in variables.mk")
3232
endif
3333

34-
# First project is considered the primary one used for doc-validator.
35-
PRIMARY_PROJECT := $(subst /,-,$(firstword $(subst :, ,$(firstword $(PROJECTS)))))
36-
3734
# Host port to publish container port to.
3835
ifeq ($(origin DOCS_HOST_PORT), undefined)
3936
export DOCS_HOST_PORT := 3002
@@ -44,12 +41,7 @@ ifeq ($(origin DOCS_IMAGE), undefined)
4441
export DOCS_IMAGE := grafana/docs-base:latest
4542
endif
4643

47-
# Container image used for doc-validator linting.
48-
ifeq ($(origin DOC_VALIDATOR_IMAGE), undefined)
49-
export DOC_VALIDATOR_IMAGE := grafana/doc-validator:latest
50-
endif
51-
52-
# Container image used for vale linting.
44+
# Container image used for Vale linting.
5345
ifeq ($(origin VALE_IMAGE), undefined)
5446
export VALE_IMAGE := grafana/vale:latest
5547
endif
@@ -99,14 +91,6 @@ docs-debug: ## Run Hugo web server with debugging enabled. TODO: support all SER
9991
docs-debug: make-docs
10092
WEBSITE_EXEC='hugo server --bind 0.0.0.0 --port 3002 --debug' $(CURDIR)/make-docs $(PROJECTS)
10193

102-
.PHONY: doc-validator
103-
doc-validator: ## Run doc-validator on the entire docs folder which includes pulling the latest `DOC_VALIDATOR_IMAGE` (default: `grafana/doc-validator:latest`) container image. To not pull the image, set `PULL=false`.
104-
doc-validator: make-docs
105-
ifeq ($(PULL), true)
106-
$(PODMAN) pull -q $(DOC_VALIDATOR_IMAGE)
107-
endif
108-
DOCS_IMAGE=$(DOC_VALIDATOR_IMAGE) $(CURDIR)/make-docs $(PROJECTS)
109-
11094
.PHONY: vale
11195
vale: ## Run vale on the entire docs folder which includes pulling the latest `VALE_IMAGE` (default: `grafana/vale:latest`) container image. To not pull the image, set `PULL=false`.
11296
vale: make-docs

docs/make-docs

Lines changed: 8 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@
88
# [Semantic versioning](https://semver.org/) is used to help the reader identify the significance of changes.
99
# Changes are relevant to this script and the support docs.mk GNU Make interface.
1010
#
11+
# ## 9.0.0 (2025-04-05)
12+
#
13+
# ### Removed
14+
#
15+
# - doc-validator target and associated scripts.
16+
#
17+
# Most useful rules have been migrated to Vale and the others are often false positives.
18+
#
1119
# ## 8.5.2 (2025-02-28)
1220
#
1321
# ### Fixed
@@ -831,51 +839,6 @@ ${DOCS_IMAGE}
831839
POSIX_HERESTRING
832840

833841
case "${image}" in
834-
'grafana/doc-validator')
835-
proj="$(new_proj "$1")"
836-
printf '\r\n'
837-
838-
IFS='' read -r cmd <<EOF
839-
${PODMAN} run \
840-
--init \
841-
--interactive \
842-
--platform linux/amd64 \
843-
--rm \
844-
--tty \
845-
${volumes} \
846-
${DOCS_IMAGE} \
847-
--include=${DOC_VALIDATOR_INCLUDE} \
848-
--skip-checks=${DOC_VALIDATOR_SKIP_CHECKS} \
849-
/hugo/content$(proj_canonical "${proj}") \
850-
"$(proj_canonical "${proj}") \
851-
| sed "s#$(proj_dst "${proj}")#sources#"
852-
EOF
853-
854-
if [ -n "${DEBUG}" ]; then
855-
debg "${cmd}"
856-
fi
857-
858-
case "${OUTPUT_FORMAT}" in
859-
human)
860-
if ! command -v jq >/dev/null 2>&1; then
861-
# shellcheck disable=SC2016
862-
errr '`jq` must be installed for the `doc-validator` target to work.'
863-
# shellcheck disable=SC2016
864-
note 'To install `jq`, refer to https://jqlang.github.io/jq/download/,'
865-
866-
exit 1
867-
fi
868-
869-
${cmd} \
870-
| jq -r '"ERROR: \(.location.path):\(.location.range.start.line // 1):\(.location.range.start.column // 1): \(.message)" + if .suggestions[0].text then "\nSuggestion: \(.suggestions[0].text)" else "" end'
871-
;;
872-
json)
873-
${cmd}
874-
;;
875-
*) # default
876-
errr "Invalid output format '${OUTPUT_FORMAT}'"
877-
esac
878-
;;
879842
'grafana/vale')
880843
proj="$(new_proj "$1")"
881844
printf '\r\n'

0 commit comments

Comments
 (0)