Skip to content

Commit

Permalink
chore: [release-3.0.x] docs: Refactor Loki configuration to be includ…
Browse files Browse the repository at this point in the history
…ed via docs/shared (#12575)

Co-authored-by: Jack Baldry <[email protected]>
  • Loading branch information
grafanabot and jdbaldry authored Apr 11, 2024
1 parent 785e963 commit b5f4699
Show file tree
Hide file tree
Showing 7 changed files with 6,228 additions and 5,847 deletions.
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,11 @@ PROMTAIL_UI_FILES := $(shell find ./clients/pkg/promtail/server/ui -type f -name

# Documentation source path
DOC_SOURCES_PATH := docs/sources
DOC_TEMPLATE_PATH := docs/templates

# Configuration flags documentation
DOC_FLAGS_TEMPLATE := $(DOC_SOURCES_PATH)/configure/index.template
DOC_FLAGS := $(DOC_SOURCES_PATH)/configure/_index.md
DOC_FLAGS_TEMPLATE := $(DOC_TEMPLATE_PATH)/configuration.template
DOC_FLAGS := $(DOC_SOURCES_PATH)/shared/configuration.md

##########
# Docker #
Expand Down
26 changes: 8 additions & 18 deletions docs/docs.mk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# The source of this file is https://raw.githubusercontent.com/grafana/writers-toolkit/main/docs/docs.mk.
# 3.0.0 (2023-05-18)
# A changelog is included in the head of the `make-docs` script.
include variables.mk
-include variables.mk.local

Expand Down Expand Up @@ -34,11 +34,6 @@ endif
# First project is considered the primary one used for doc-validator.
PRIMARY_PROJECT := $(subst /,-,$(firstword $(subst :, ,$(firstword $(PROJECTS)))))

# Name for the container.
ifeq ($(origin DOCS_CONTAINER), undefined)
export DOCS_CONTAINER := $(PRIMARY_PROJECT)-docs
endif

# Host port to publish container port to.
ifeq ($(origin DOCS_HOST_PORT), undefined)
export DOCS_HOST_PORT := 3002
Expand Down Expand Up @@ -76,44 +71,39 @@ docs-rm: ## Remove the docs container.

.PHONY: docs-pull
docs-pull: ## Pull documentation base image.
$(PODMAN) pull $(DOCS_IMAGE)
$(PODMAN) pull -q $(DOCS_IMAGE)

make-docs: ## Fetch the latest make-docs script.
make-docs:
if [[ ! -f "$(PWD)/make-docs" ]]; then
if [[ ! -f "$(CURDIR)/make-docs" ]]; then
echo 'WARN: No make-docs script found in the working directory. Run `make update` to download it.' >&2
exit 1
fi

.PHONY: docs
docs: ## Serve documentation locally, which includes pulling the latest `DOCS_IMAGE` (default: `grafana/docs-base:latest`) container image. See also `docs-no-pull`.
docs: docs-pull make-docs
$(PWD)/make-docs $(PROJECTS)
$(CURDIR)/make-docs $(PROJECTS)

.PHONY: docs-no-pull
docs-no-pull: ## Serve documentation locally without pulling the `DOCS_IMAGE` (default: `grafana/docs-base:latest`) container image.
docs-no-pull: make-docs
$(PWD)/make-docs $(PROJECTS)
$(CURDIR)/make-docs $(PROJECTS)

.PHONY: docs-debug
docs-debug: ## Run Hugo web server with debugging enabled. TODO: support all SERVER_FLAGS defined in website Makefile.
docs-debug: make-docs
WEBSITE_EXEC='hugo server --bind 0.0.0.0 --port 3002 --debug' $(PWD)/make-docs $(PROJECTS)
WEBSITE_EXEC='hugo server --bind 0.0.0.0 --port 3002 --debug' $(CURDIR)/make-docs $(PROJECTS)

.PHONY: doc-validator
doc-validator: ## Run doc-validator on the entire docs folder.
doc-validator: make-docs
DOCS_IMAGE=$(DOC_VALIDATOR_IMAGE) $(PWD)/make-docs $(PROJECTS)

.PHONY: doc-validator/%
doc-validator/%: ## Run doc-validator on a specific path. To lint the path /docs/sources/administration, run 'make doc-validator/administration'.
doc-validator/%: make-docs
DOCS_IMAGE=$(DOC_VALIDATOR_IMAGE) DOC_VALIDATOR_INCLUDE=$(subst doc-validator/,,$@) $(PWD)/make-docs $(PROJECTS)
DOCS_IMAGE=$(DOC_VALIDATOR_IMAGE) $(CURDIR)/make-docs $(PROJECTS)

.PHONY: vale
vale: ## Run vale on the entire docs folder.
vale: make-docs
DOCS_IMAGE=$(VALE_IMAGE) $(PWD)/make-docs $(PROJECTS)
DOCS_IMAGE=$(VALE_IMAGE) $(CURDIR)/make-docs $(PROJECTS)

.PHONY: update
update: ## Fetch the latest version of this Makefile and the `make-docs` script from Writers' Toolkit.
Expand Down
Loading

0 comments on commit b5f4699

Please sign in to comment.