-
Notifications
You must be signed in to change notification settings - Fork 0
Docs: Add docs to repo #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
imatwawana
wants to merge
12
commits into
main
Choose a base branch
from
ihm/251128-add-docs
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 11 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
063e1da
Added make files and markdown files and recreated structure
imatwawana 41ca6c3
Made some general fixes
imatwawana d2b5d9b
Updated descriptions via Copilot
imatwawana 8f26153
Fixed frontmatter
imatwawana d3fbd51
Deleted script
imatwawana 16ef830
Replaced info tags with admonitions
imatwawana 4667f62
Updated Youtube component with shortcode
imatwawana 952da10
Replaced Image tags with figure shortcodes and updated image file paths
imatwawana 9e8f993
Made some style fixes
imatwawana 029db34
Edited files against Google style guide via copilot
imatwawana 9ded300
Fixed links
imatwawana 74b83c6
Applied feedback from review-fixed link
imatwawana File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| .ONESHELL: | ||
| .DELETE_ON_ERROR: | ||
| export SHELL := bash | ||
| export SHELLOPTS := pipefail:errexit | ||
| MAKEFLAGS += --warn-undefined-variables | ||
| MAKEFLAGS += --no-builtin-rule | ||
|
|
||
| include docs.mk |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,112 @@ | ||
| # The source of this file is https://raw.githubusercontent.com/grafana/writers-toolkit/main/docs/docs.mk. | ||
| # A changelog is included in the head of the `make-docs` script. | ||
| include variables.mk | ||
| -include variables.mk.local | ||
|
|
||
| .ONESHELL: | ||
| .DELETE_ON_ERROR: | ||
| export SHELL := bash | ||
| export SHELLOPTS := pipefail:errexit | ||
| MAKEFLAGS += --warn-undefined-variables | ||
| MAKEFLAGS += --no-builtin-rule | ||
|
|
||
| .DEFAULT_GOAL: help | ||
|
|
||
| # Adapted from https://www.thapaliya.com/en/writings/well-documented-makefiles/ | ||
| .PHONY: help | ||
| help: ## Display this help. | ||
| help: | ||
| @awk 'BEGIN { \ | ||
| FS = ": ##"; \ | ||
| printf "Usage:\n make <target>\n\nTargets:\n" \ | ||
| } \ | ||
| /^[a-zA-Z0-9_\.\-\/%]+: ##/ { printf " %-15s %s\n", $$1, $$2 }' \ | ||
| $(MAKEFILE_LIST) | ||
|
|
||
| GIT_ROOT := $(shell git rev-parse --show-toplevel) | ||
|
|
||
| PODMAN := $(shell if command -v podman >/dev/null 2>&1; then echo podman; else echo docker; fi) | ||
|
|
||
| ifeq ($(PROJECTS),) | ||
| $(error "PROJECTS variable must be defined in variables.mk") | ||
| endif | ||
|
|
||
| # First project is considered the primary one used for doc-validator. | ||
| PRIMARY_PROJECT := $(subst /,-,$(firstword $(subst :, ,$(firstword $(PROJECTS))))) | ||
|
|
||
| # Host port to publish container port to. | ||
| ifeq ($(origin DOCS_HOST_PORT), undefined) | ||
| export DOCS_HOST_PORT := 3002 | ||
| endif | ||
|
|
||
| # Container image used to perform Hugo build. | ||
| ifeq ($(origin DOCS_IMAGE), undefined) | ||
| export DOCS_IMAGE := grafana/docs-base:latest | ||
| endif | ||
|
|
||
| # Container image used for doc-validator linting. | ||
| ifeq ($(origin DOC_VALIDATOR_IMAGE), undefined) | ||
| export DOC_VALIDATOR_IMAGE := grafana/doc-validator:latest | ||
| endif | ||
|
|
||
| # Container image used for vale linting. | ||
| ifeq ($(origin VALE_IMAGE), undefined) | ||
| export VALE_IMAGE := grafana/vale:latest | ||
| endif | ||
|
|
||
| # PATH-like list of directories within which to find projects. | ||
| # If all projects are checked out into the same directory, ~/repos/ for example, then the default should work. | ||
| ifeq ($(origin REPOS_PATH), undefined) | ||
| export REPOS_PATH := $(realpath $(GIT_ROOT)/..) | ||
| endif | ||
|
|
||
| # How to treat Hugo relref errors. | ||
| ifeq ($(origin HUGO_REFLINKSERRORLEVEL), undefined) | ||
| export HUGO_REFLINKSERRORLEVEL := WARNING | ||
| endif | ||
|
|
||
| .PHONY: docs-rm | ||
| docs-rm: ## Remove the docs container. | ||
| $(PODMAN) rm -f $(DOCS_CONTAINER) | ||
|
|
||
| .PHONY: docs-pull | ||
| docs-pull: ## Pull documentation base image. | ||
| $(PODMAN) pull -q $(DOCS_IMAGE) | ||
|
|
||
| make-docs: ## Fetch the latest make-docs script. | ||
| make-docs: | ||
| 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 | ||
| $(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 | ||
| $(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' $(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) $(CURDIR)/make-docs $(PROJECTS) | ||
|
|
||
| .PHONY: vale | ||
| vale: ## Run vale on the entire docs folder. | ||
| vale: make-docs | ||
| 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. | ||
| curl -s -LO https://raw.githubusercontent.com/grafana/writers-toolkit/main/docs/docs.mk | ||
| curl -s -LO https://raw.githubusercontent.com/grafana/writers-toolkit/main/docs/make-docs | ||
| chmod +x make-docs |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.