-
Notifications
You must be signed in to change notification settings - Fork 1
feat(docs): Evolve and standardize the documentation workflow #88
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
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| name: Documentation | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ "main" ] | ||
| pull_request: | ||
|
|
||
| jobs: | ||
| docs-checks: | ||
| uses: canonical/operator-workflows/.github/workflows/docs.yaml@main | ||
| secrets: inherit | ||
|
|
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
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,12 @@ | ||
| ; Copyright 2025 Canonical Ltd. | ||
| ; See LICENSE file for licensing details. | ||
|
|
||
| StylesPath = .vale/styles | ||
|
|
||
| Packages = https://github.com/canonical/platform-engineering-vale-package/releases/download/latest/pfe-vale.zip | ||
|
|
||
| Vocab = PFE, local | ||
|
|
||
| [*] | ||
| BasedOnStyles = PFE | ||
|
|
File renamed without changes.
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,41 @@ | ||
| # Copyright 2025 Canonical Ltd. | ||
| # See LICENSE file for licensing details. | ||
|
|
||
| # Top-level Makefile | ||
| # Delegates targets to Makefile.docs | ||
|
|
||
| # ============================================================================== | ||
| # Macros | ||
| # ============================================================================== | ||
|
|
||
| # Colors | ||
| NO_COLOR=\033[0m | ||
| CYAN_COLOR=\033[0;36m | ||
| YELLOW_COLOR=\033[0;93m | ||
| RED_COLOR=\033[0;91m | ||
|
|
||
| msg = @printf '$(CYAN_COLOR)$(1)$(NO_COLOR)\n' | ||
| errmsg = @printf '$(RED_COLOR)Error: $(1)$(NO_COLOR)\n' && exit 1 | ||
|
|
||
| # ============================================================================== | ||
| # Core | ||
| # ============================================================================== | ||
|
|
||
| include Makefile.docs | ||
|
|
||
| .PHONY: help | ||
| help: _list-targets ## Prints all available targets | ||
|
|
||
| .PHONY: _list-targets | ||
| _list-targets: ## This collects and prints all targets, ignore internal commands | ||
| $(call msg,Available targets:) | ||
| @awk -F'[:#]' ' \ | ||
| /^[a-zA-Z0-9._-]+:([^=]|$$)/ { \ | ||
| target = $$1; \ | ||
| comment = ""; \ | ||
| if (match($$0, /## .*/)) \ | ||
| comment = substr($$0, RSTART + 3); \ | ||
| if (target != ".PHONY" && target !~ /^_/ && !seen[target]++) \ | ||
| printf " make %-20s $(YELLOW_COLOR)# %s$(NO_COLOR)\n", target, comment; \ | ||
| }' $(MAKEFILE_LIST) | sort | ||
|
|
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,75 @@ | ||
| # Copyright 2025 Canonical Ltd. | ||
| # See LICENSE file for licensing details. | ||
|
|
||
| # Minimal makefile for documentation | ||
| # | ||
|
|
||
| # Vale settings | ||
| VALE_DIR ?= .vale | ||
| PRAECEPTA_CONFIG ?= .vale.ini | ||
| DOCS_FILES ?= docs/ README.md CONTRIBUTING.md | ||
|
|
||
| HAS_VALE := $(shell command -v vale;) | ||
| HAS_LYCHEE := $(shell command -v lychee;) | ||
|
|
||
| # ============================================================================== | ||
| # Docs Targets | ||
| # ============================================================================== | ||
|
|
||
| .PHONY: docs-check | ||
| docs-check: vale lychee ## Run all Docs checks | ||
|
|
||
| .PHONY: docs-clean | ||
| docs-clean: vale-clean | ||
|
|
||
| # ============================================================================== | ||
| # Dependency Check Targets | ||
| # ============================================================================== | ||
|
|
||
| .PHONY: .check-vale | ||
| .check-vale: | ||
| ifndef HAS_VALE | ||
| $(call errmsg,'vale' is not installed. Please install it first) \ | ||
| exit 1; | ||
| endif | ||
|
|
||
| .PHONY: .check-lychee | ||
| .check-lychee: | ||
| ifndef HAS_LYCHEE | ||
| $(call errmsg,'lychee' is not installed. Please install it first) \ | ||
| exit 1; | ||
| endif | ||
|
|
||
|
|
||
| # ============================================================================== | ||
| # Main Vale Targets | ||
| # ============================================================================== | ||
|
|
||
| .PHONY: vale-sync | ||
| vale-sync: ## Download and install external Vale configuration sources | ||
| $(call msg,--- Syncing Vale styles... ---) | ||
| @vale sync | ||
|
|
||
| .PHONY: vale | ||
| vale: .check-vale vale-sync ## Run Vale checks on docs | ||
| $(call msg,--- Running Vale checks on "$(DOCS_FILES)"... ---) | ||
| @vale --config=$(PRAECEPTA_CONFIG) $(DOCS_FILES) | ||
|
|
||
| # ============================================================================== | ||
| # Main Lychee Targets | ||
| # ============================================================================== | ||
|
|
||
| .PHONY: lychee | ||
| lychee: .check-lychee ## Run Lychee checks on docs | ||
| $(call msg,--- Running lychee checks on "$(LYCHEE_DOCS_FILES)"... ---) | ||
| @lychee $(DOCS_FILES) | ||
|
|
||
| # ============================================================================== | ||
| # Helper Targets | ||
| # ============================================================================== | ||
|
|
||
| .PHONY: vale-clean | ||
| vale-clean: | ||
| $(call msg,--- Cleaning downloaded packages and ignored files from "$(VALE_DIR)"... ---) | ||
| @git clean -dfX $(VALE_DIR) | ||
|
|
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 |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| ## External access | ||
|
|
||
| In order for the [Pollen](https://charmhub.io/pollen) charm to work correctly, | ||
| it needs access to the [Snap Store's API](api.snapcraft.io) to download Pollen's snap. | ||
| it needs access to the [Snap Store's API](https://api.snapcraft.io/) to download Pollen's snap. |
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.