Skip to content

Commit

Permalink
Update make docs procedure (#2969)
Browse files Browse the repository at this point in the history
* Update `make docs` procedure

* Trigger CI

---------

Co-authored-by: grafanabot <[email protected]>
Co-authored-by: Jack Baldry <[email protected]>
  • Loading branch information
3 people authored Sep 28, 2023
1 parent b07afb3 commit ce2ce78
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
12 changes: 6 additions & 6 deletions docs/docs.mk
Original file line number Diff line number Diff line change
Expand Up @@ -80,35 +80,35 @@ docs-pull: ## Pull documentation base 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)
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
6 changes: 2 additions & 4 deletions docs/make-docs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

# - Improved consistency of the webserver request loop by polling the Hugo port rather than the proxy port.


# ## 4.2.0 (2023-09-01)

# ### Added
Expand Down Expand Up @@ -476,8 +475,7 @@ POSIX_HERESTRING
fi
done
echo

echo 'Press Ctrl+C to stop the server'
echo 'Press Ctrl+c to stop the server'

unset i max req url
return
Expand Down Expand Up @@ -655,4 +653,4 @@ EOF
-e '/make/ d' || echo
fi
;;
esac
esac

0 comments on commit ce2ce78

Please sign in to comment.