Skip to content

Commit 886b418

Browse files
github-actions[bot]grafanabotjdbaldry
authored
Update make docs procedure (#3896)
Co-authored-by: grafanabot <[email protected]> Co-authored-by: Jack Baldry <[email protected]>
1 parent 0de034c commit 886b418

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

docs/docs.mk

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,3 +120,11 @@ update: ## Fetch the latest version of this Makefile and the `make-docs` script
120120
curl -s -LO https://raw.githubusercontent.com/grafana/writers-toolkit/main/docs/docs.mk
121121
curl -s -LO https://raw.githubusercontent.com/grafana/writers-toolkit/main/docs/make-docs
122122
chmod +x make-docs
123+
124+
.PHONY: topic/%
125+
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`.
126+
topic/%:
127+
$(if $(TOPIC_PATH),,$(error "You must set the TOPIC_PATH variable to the path where the $(@) topic will be created.
128+
For example: make $(@) TOPIC_PATH=sources/my-new-topic.md"))
129+
mkdir -p $(dir $(TOPIC_PATH))
130+
curl -s -o $(TOPIC_PATH) https://raw.githubusercontent.com/grafana/writers-toolkit/refs/heads/main/docs/static/templates/$(@F)-template.md

0 commit comments

Comments
 (0)