Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update make docs procedure #10539

Merged
merged 7 commits into from
Feb 19, 2025
Merged
Show file tree
Hide file tree
Changes from 4 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
8 changes: 8 additions & 0 deletions docs/docs.mk
Original file line number Diff line number Diff line change
Expand Up @@ -120,3 +120,11 @@ update: ## Fetch the latest version of this Makefile and the `make-docs` script
curl -s -LO https://raw.githubusercontent.com/grafana/writers-toolkit/main/docs/docs.mk
curl -s -LO https://raw.githubusercontent.com/grafana/writers-toolkit/main/docs/make-docs
chmod +x make-docs

.PHONY: topic/%
Copy link
Contributor

@narqo narqo Feb 14, 2025

Choose a reason for hiding this comment

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

(nit) Does make resolve % in the phony declarations? I thought the declaration is static so target/% doesn't make target/foo phony, no?

Copy link
Member

Choose a reason for hiding this comment

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

No you're right, that's actually not gonna work if there's a topic/task file. I'll open a PR upstream to fix that behavior and you can expect an update to this PR in the next couple days

Copy link
Member

Choose a reason for hiding this comment

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

Fixed in 8d9899f (#10539)

topic/%: ## Create a topic from the Writers' Toolkit template. Specify the topic type as the target, for example, `make topic/task TOPIC_PATH=sources/my-new-topic.md`.
topic/%:
$(if $(TOPIC_PATH),,$(error "You must set the TOPIC_PATH variable to the path where the $(@) topic will be created.
For example: make $(@) TOPIC_PATH=sources/my-new-topic.md"))
mkdir -p $(dir $(TOPIC_PATH))
curl -s -o $(TOPIC_PATH) https://raw.githubusercontent.com/grafana/writers-toolkit/refs/heads/main/docs/static/templates/$(@F)-template.md
26 changes: 26 additions & 0 deletions docs/make-docs
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
#!/bin/sh
# shellcheck disable=SC2034
#
# The source of this file is https://raw.githubusercontent.com/grafana/writers-toolkit/main/docs/make-docs.
# # `make-docs` procedure changelog
#
# Updates should conform to the guidelines in https://keepachangelog.com/en/1.1.0/.
# [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.
#
# ## 8.4.0 (2025-01-27)
#
# ### Fixed
#
# - Correct mount for the /docs/grafana-cloud/send-data/fleet-management/ project.
#
# ## 8.3.0 (2024-12-27)
#
# ### Added
Expand Down Expand Up @@ -304,13 +312,15 @@ PODMAN="$(if command -v podman >/dev/null 2>&1; then echo podman; else echo dock

if ! command -v curl >/dev/null 2>&1; then
if ! command -v wget >/dev/null 2>&1; then
# shellcheck disable=SC2016
errr 'either `curl` or `wget` must be installed for this script to work.'

exit 1
fi
fi

if ! command -v "${PODMAN}" >/dev/null 2>&1; then
# shellcheck disable=SC2016
errr 'either `podman` or `docker` must be installed for this script to work.'

exit 1
Expand Down Expand Up @@ -357,6 +367,10 @@ EOF
exit 1
fi

# The following variables comprise a pseudo associative array of project names to source repositories.
# You only need to set a SOURCES variable if the project name does not match the source repository name.
# You can get a key identifier using the `identifier` function.
# To look up the value of any pseudo associative array, use the `aget` function.
SOURCES_as_code='as-code-docs'
SOURCES_enterprise_metrics='backend-enterprise'
SOURCES_enterprise_metrics_='backend-enterprise'
Expand All @@ -366,24 +380,34 @@ SOURCES_grafana_cloud_alerting_and_irm_slo='slo'
SOURCES_grafana_cloud_k6='k6-docs'
SOURCES_grafana_cloud_data_configuration_integrations='cloud-onboarding'
SOURCES_grafana_cloud_frontend_observability_faro_web_sdk='faro-web-sdk'
SOURCES_grafana_cloud_send_data_fleet_management='fleet-management'
SOURCES_helm_charts_mimir_distributed='mimir'
SOURCES_helm_charts_tempo_distributed='tempo'
SOURCES_opentelemetry='opentelemetry-docs'
SOURCES_resources='website'

# The following variables comprise a pseudo associative array of project names to versions.
# You only need to set a VERSIONS variable if it is not the default of 'latest'.
# You can get a key identifier using the `identifier` function.
# To look up the value of any pseudo associative array, use the `aget` function.
VERSIONS_as_code='UNVERSIONED'
VERSIONS_grafana_cloud='UNVERSIONED'
VERSIONS_grafana_cloud_alerting_and_irm_machine_learning='UNVERSIONED'
VERSIONS_grafana_cloud_alerting_and_irm_slo='UNVERSIONED'
VERSIONS_grafana_cloud_k6='UNVERSIONED'
VERSIONS_grafana_cloud_data_configuration_integrations='UNVERSIONED'
VERSIONS_grafana_cloud_frontend_observability_faro_web_sdk='UNVERSIONED'
VERSIONS_grafana_cloud_send_data_fleet_management='UNVERSIONED'
VERSIONS_opentelemetry='UNVERSIONED'
VERSIONS_resources='UNVERSIONED'
VERSIONS_technical_documentation='UNVERSIONED'
VERSIONS_website='UNVERSIONED'
VERSIONS_writers_toolkit='UNVERSIONED'

# The following variables comprise a pseudo associative array of project names to source repository paths.
# You only need to set a PATHS variable if it is not the default of 'docs/sources'.
# You can get a key identifier using the `identifier` function.
# To look up the value of any pseudo associative array, use the `aget` function.
PATHS_grafana_cloud='content/docs/grafana-cloud'
PATHS_helm_charts_mimir_distributed='docs/sources/helm-charts/mimir-distributed'
PATHS_helm_charts_tempo_distributed='docs/sources/helm-charts/tempo-distributed'
Expand Down Expand Up @@ -816,7 +840,9 @@ EOF
case "${OUTPUT_FORMAT}" in
human)
if ! command -v jq >/dev/null 2>&1; then
# shellcheck disable=SC2016
errr '`jq` must be installed for the `doc-validator` target to work.'
# shellcheck disable=SC2016
note 'To install `jq`, refer to https://jqlang.github.io/jq/download/,'

exit 1
Expand Down