From d52641dab41e54cb9450055aac3769fb34fce0d9 Mon Sep 17 00:00:00 2001 From: grafanabot Date: Thu, 6 Feb 2025 07:02:04 +0000 Subject: [PATCH] Update `make docs` procedure --- docs/docs.mk | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/docs.mk b/docs/docs.mk index c0aae10ba50d..46b2afb65476 100644 --- a/docs/docs.mk +++ b/docs/docs.mk @@ -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/% +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