|
1 | 1 | # The source of this file is https://raw.githubusercontent.com/grafana/writers-toolkit/main/docs/docs.mk.
|
2 |
| -# 3.0.0 (2023-05-18) |
| 2 | +# A changelog is included in the head of the `make-docs` script. |
3 | 3 | include variables.mk
|
4 | 4 | -include variables.mk.local
|
5 | 5 |
|
|
34 | 34 | # First project is considered the primary one used for doc-validator.
|
35 | 35 | PRIMARY_PROJECT := $(subst /,-,$(firstword $(subst :, ,$(firstword $(PROJECTS)))))
|
36 | 36 |
|
37 |
| -# Name for the container. |
38 |
| -ifeq ($(origin DOCS_CONTAINER), undefined) |
39 |
| -export DOCS_CONTAINER := $(PRIMARY_PROJECT)-docs |
40 |
| -endif |
41 |
| - |
42 | 37 | # Host port to publish container port to.
|
43 | 38 | ifeq ($(origin DOCS_HOST_PORT), undefined)
|
44 | 39 | export DOCS_HOST_PORT := 3002
|
@@ -76,44 +71,39 @@ docs-rm: ## Remove the docs container.
|
76 | 71 |
|
77 | 72 | .PHONY: docs-pull
|
78 | 73 | docs-pull: ## Pull documentation base image.
|
79 |
| - $(PODMAN) pull $(DOCS_IMAGE) |
| 74 | + $(PODMAN) pull -q $(DOCS_IMAGE) |
80 | 75 |
|
81 | 76 | make-docs: ## Fetch the latest make-docs script.
|
82 | 77 | make-docs:
|
83 |
| - if [[ ! -f "$(PWD)/make-docs" ]]; then |
| 78 | + if [[ ! -f "$(CURDIR)/make-docs" ]]; then |
84 | 79 | echo 'WARN: No make-docs script found in the working directory. Run `make update` to download it.' >&2
|
85 | 80 | exit 1
|
86 | 81 | fi
|
87 | 82 |
|
88 | 83 | .PHONY: docs
|
89 | 84 | docs: ## Serve documentation locally, which includes pulling the latest `DOCS_IMAGE` (default: `grafana/docs-base:latest`) container image. See also `docs-no-pull`.
|
90 | 85 | docs: docs-pull make-docs
|
91 |
| - $(PWD)/make-docs $(PROJECTS) |
| 86 | + $(CURDIR)/make-docs $(PROJECTS) |
92 | 87 |
|
93 | 88 | .PHONY: docs-no-pull
|
94 | 89 | docs-no-pull: ## Serve documentation locally without pulling the `DOCS_IMAGE` (default: `grafana/docs-base:latest`) container image.
|
95 | 90 | docs-no-pull: make-docs
|
96 |
| - $(PWD)/make-docs $(PROJECTS) |
| 91 | + $(CURDIR)/make-docs $(PROJECTS) |
97 | 92 |
|
98 | 93 | .PHONY: docs-debug
|
99 | 94 | docs-debug: ## Run Hugo web server with debugging enabled. TODO: support all SERVER_FLAGS defined in website Makefile.
|
100 | 95 | docs-debug: make-docs
|
101 |
| - WEBSITE_EXEC='hugo server --bind 0.0.0.0 --port 3002 --debug' $(PWD)/make-docs $(PROJECTS) |
| 96 | + WEBSITE_EXEC='hugo server --bind 0.0.0.0 --port 3002 --debug' $(CURDIR)/make-docs $(PROJECTS) |
102 | 97 |
|
103 | 98 | .PHONY: doc-validator
|
104 | 99 | doc-validator: ## Run doc-validator on the entire docs folder.
|
105 | 100 | doc-validator: make-docs
|
106 |
| - DOCS_IMAGE=$(DOC_VALIDATOR_IMAGE) $(PWD)/make-docs $(PROJECTS) |
107 |
| - |
108 |
| -.PHONY: doc-validator/% |
109 |
| -doc-validator/%: ## Run doc-validator on a specific path. To lint the path /docs/sources/administration, run 'make doc-validator/administration'. |
110 |
| -doc-validator/%: make-docs |
111 |
| - DOCS_IMAGE=$(DOC_VALIDATOR_IMAGE) DOC_VALIDATOR_INCLUDE=$(subst doc-validator/,,$@) $(PWD)/make-docs $(PROJECTS) |
| 101 | + DOCS_IMAGE=$(DOC_VALIDATOR_IMAGE) $(CURDIR)/make-docs $(PROJECTS) |
112 | 102 |
|
113 | 103 | .PHONY: vale
|
114 | 104 | vale: ## Run vale on the entire docs folder.
|
115 | 105 | vale: make-docs
|
116 |
| - DOCS_IMAGE=$(VALE_IMAGE) $(PWD)/make-docs $(PROJECTS) |
| 106 | + DOCS_IMAGE=$(VALE_IMAGE) $(CURDIR)/make-docs $(PROJECTS) |
117 | 107 |
|
118 | 108 | .PHONY: update
|
119 | 109 | update: ## Fetch the latest version of this Makefile and the `make-docs` script from Writers' Toolkit.
|
|
0 commit comments