Skip to content

Commit 70becf8

Browse files
github-actions[bot]grafanabotzoltanbedi
authored
Update make docs procedure (#310)
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: Zoltán Bedi <zoltan.bedi@gmail.com>
1 parent 9e656bc commit 70becf8

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

docs/docs.mk

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,3 +120,12 @@ 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+
# ls static/templates/ | sed 's/-template\.md//' | xargs
125+
TOPIC_TYPES := concept multiple-tasks reference section task tutorial visualization
126+
.PHONY: $(patsubst %,topic/%,$(TOPIC_TYPES))
127+
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`.
128+
$(patsubst %,topic/%,$(TOPIC_TYPES)):
129+
$(if $(TOPIC_PATH),,$(error "You must set the TOPIC_PATH variable to the path where the $(@F) topic will be created. For example: make $(@) TOPIC_PATH=sources/my-new-topic.md"))
130+
mkdir -p $(dir $(TOPIC_PATH))
131+
curl -s -o $(TOPIC_PATH) https://raw.githubusercontent.com/grafana/writers-toolkit/refs/heads/main/docs/static/templates/$(@F)-template.md

docs/make-docs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,24 @@
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+
# ## 8.5.2 (2025-02-28)
12+
#
13+
# ### Fixed
14+
#
15+
# - topic/<KIND> targets are no longer no-ops as a result of 8.5.1.
16+
#
17+
# ## 8.5.1 (2025-02-18)
18+
#
19+
# ### Fixed
20+
#
21+
# - PHONY declaration for topic/<KIND> targets.
22+
#
23+
# ## 8.5.0 (2025-02-13)
24+
#
25+
# ### Added
26+
#
27+
# - make topic/<KIND> TOPIC_PATH=<PATH> target to create a new topic from the Writers' Toolkit templates.
28+
#
1129
# ## 8.4.0 (2025-01-27)
1230
#
1331
# ### Fixed

0 commit comments

Comments
 (0)