Update make docs procedure (#83045)

Co-authored-by: grafanabot <bot@grafana.com>
This commit is contained in:
github-actions[bot] 2024-02-19 13:16:52 +02:00 committed by GitHub
parent bfd5475e1e
commit d541416615
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -6,6 +6,12 @@
# [Semantic versioning](https://semver.org/) is used to help the reader identify the significance of changes.
# Changes are relevant to this script and the support docs.mk GNU Make interface.
#
# ## 6.0.0 (2024-02-16)
#
# ### Changed
#
# - Require `jq` for human readable `make doc-validator` output.
#
# ## 5.4.0 (2024-02-12)
#
# ### Changed
@ -702,6 +708,13 @@ POSIX_HERESTRING
case "${image}" in
'grafana/doc-validator')
if ! command -v jq >/dev/null 2>&1; then
errr '`jq` must be installed for the `doc-validator` target to work.'
note 'To install `jq`, refer to https://jqlang.github.io/jq/download/,'
exit 1
fi
proj="$(new_proj "$1")"
printf '\r\n'
"${PODMAN}" run \
@ -714,8 +727,10 @@ case "${image}" in
"${DOCS_IMAGE}" \
"--include=${DOC_VALIDATOR_INCLUDE}" \
"--skip-checks=${DOC_VALIDATOR_SKIP_CHECKS}" \
/hugo/content/docs \
"$(proj_canonical "${proj}")" | sed "s#$(proj_dst "${proj}")#sources#"
"/hugo/content$(proj_canonical "${proj}")" \
"$(proj_canonical "${proj}")" \
| sed "s#$(proj_dst "${proj}")#sources#" \
| 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'
;;
'grafana/vale')
proj="$(new_proj "$1")"