Skip to content
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

GitHub DS Plugin docs #292

Merged
merged 66 commits into from
Jul 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
c8677e2
created docs folder structure
usmangt Mar 4, 2024
c9eb179
Merge branch 'main' into docs/usman-github-docs
usmangt May 8, 2024
56a89d2
created the basic doc structure
usmangt May 8, 2024
15a8b3d
added more docs
usmangt May 8, 2024
326da39
saved changes
usmangt May 8, 2024
0871404
Add `make docs` procedure and a workflow to keep it up to date
jdbaldry May 29, 2024
97c36b9
Merge branch 'main' into docs/usman-github-docs
usmangt May 30, 2024
67363fe
Merge branch 'main' into docs/usman-github-docs
usmangt Jun 25, 2024
bd4ced5
added new info
usmangt Jul 2, 2024
d52849f
made more sections
usmangt Jul 3, 2024
78d8f94
added the provisioning and authentication sections
usmangt Jul 3, 2024
d270db5
added variables and macros section
usmangt Jul 3, 2024
8a31c83
completed the variables and macros section
usmangt Jul 3, 2024
2d4777b
fixed links images and text
usmangt Jul 3, 2024
dfca852
run prettier
usmangt Jul 3, 2024
47b6422
Apply suggestions from code review
usmangt Jul 9, 2024
223a905
Fix spell
ivanahuckova Jul 9, 2024
899864a
Merge branch 'main' into docs/usman-github-docs
ivanahuckova Jul 9, 2024
47c9c6f
Apply suggestions from code review
usmangt Jul 9, 2024
3a7a0e4
remove unnecssary information
usmangt Jul 11, 2024
65b134f
Apply suggestions from code review
usmangt Jul 11, 2024
5624cd3
fixed intro
usmangt Jul 11, 2024
c3fc9bd
fixed requrement section
usmangt Jul 11, 2024
e897fb8
fixed read more to further reading
usmangt Jul 11, 2024
fbe652f
removed aliases tag from metadata
usmangt Jul 15, 2024
7c12739
removed port information from requiremnts
usmangt Jul 15, 2024
466bfe9
added report issues into homepage section
usmangt Jul 15, 2024
87001d6
removed report-issues spearate page
usmangt Jul 15, 2024
bfc0759
removed faq page
usmangt Jul 15, 2024
6a2881f
improved the configuration section
usmangt Jul 15, 2024
ab62072
fixed typo
usmangt Jul 15, 2024
76b763d
fixed installation section
usmangt Jul 16, 2024
508d073
Merge branch 'main' into docs/usman-github-docs
usmangt Jul 16, 2024
ae27952
fixed minor changes
usmangt Jul 16, 2024
e4ce43e
fixed macros
usmangt Jul 16, 2024
e3a95a3
added note in configuration
usmangt Jul 16, 2024
913e484
added cache note
usmangt Jul 16, 2024
0982edd
added annotation note
usmangt Jul 16, 2024
f7b66ea
fixed minor
usmangt Jul 16, 2024
bf9595d
fixed provisioning annotation pages
usmangt Jul 16, 2024
e89fafa
improved the configuration section
usmangt Jul 16, 2024
8b96146
rename file accordingly
usmangt Jul 16, 2024
95475ce
fixed main page
usmangt Jul 16, 2024
853ee0a
fixed setup page
usmangt Jul 16, 2024
6043f93
fixed installation page
usmangt Jul 16, 2024
0f20a06
fixed token page
usmangt Jul 16, 2024
f1703e1
fixed token page
usmangt Jul 16, 2024
cd3ab41
fixed provisioning page
usmangt Jul 16, 2024
0304e28
fixed variable and macro page
usmangt Jul 16, 2024
be9fb11
fixed examples page
usmangt Jul 16, 2024
7a21747
run prettier
usmangt Jul 16, 2024
3c48b15
Apply suggestions from code review
usmangt Jul 16, 2024
70e6ab6
removed outdated info
usmangt Jul 17, 2024
1281141
Apply suggestions from code review
usmangt Jul 17, 2024
a482266
made requested changes
usmangt Jul 17, 2024
b1ade81
improved the examples section
usmangt Jul 17, 2024
7083bc5
fixed example page metadata
usmangt Jul 17, 2024
7905ca2
run prettier
usmangt Jul 17, 2024
0a34206
Update docs/sources/_index.md
usmangt Jul 17, 2024
dc1d56b
fixed the Get Started section
usmangt Jul 17, 2024
50a00b6
fixed get started links
usmangt Jul 18, 2024
503b516
fixed metadata on all pages and fixed sample dashboard page
usmangt Jul 19, 2024
9ba77cb
fixed minor changes
usmangt Jul 19, 2024
f646c6b
run prettier
usmangt Jul 19, 2024
813534c
renamed file and minor changes
usmangt Jul 19, 2024
9304ac7
Apply suggestions from code review
usmangt Jul 22, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,10 @@
# The '*' pattern is global owners.

* @grafana/oss-big-tent

docs/docs.mk @jdbaldry
docs/make-docs @jdbaldry
docs/Makefile @jdbaldry
docs/variables.mk @jdbaldry

.github/workflows/update-make-docs.yml @jdbaldry
15 changes: 15 additions & 0 deletions .github/workflows/update-make-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Update `make docs` procedure
on:
schedule:
- cron: '0 7 * * 1-5'
workflow_dispatch:
jobs:
main:
if: github.repository == 'grafana/github-datasource'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: grafana/writers-toolkit/update-make-docs@update-make-docs/v1
with:
pr_options: >
--label type/docs
8 changes: 8 additions & 0 deletions docs/Makefile
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
122 changes: 122 additions & 0 deletions docs/docs.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
# 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

# Whether to pull the latest container image before running the container.
ifeq ($(origin PULL), undefined)
export PULL := true
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. To not pull the image, set `PULL=false`.
ifeq ($(PULL), true)
docs: docs-pull make-docs
else
docs: make-docs
endif
$(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 which includes pulling the latest `DOC_VALIDATOR_IMAGE` (default: `grafana/doc-validator:latest`) container image. To not pull the image, set `PULL=false`.
doc-validator: make-docs
ifeq ($(PULL), true)
$(PODMAN) pull -q $(DOC_VALIDATOR_IMAGE)
endif
DOCS_IMAGE=$(DOC_VALIDATOR_IMAGE) $(CURDIR)/make-docs $(PROJECTS)

.PHONY: vale
vale: ## Run vale on the entire docs folder which includes pulling the latest `VALE_IMAGE` (default: `grafana/vale:latest`) container image. To not pull the image, set `PULL=false`.
vale: make-docs
ifeq ($(PULL), true)
$(PODMAN) pull -q $(VALE_IMAGE)
endif
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
Loading
Loading