Skip to content

Commit 9a7fd3c

Browse files
authored
Merge pull request #5564 from camilamacedo86/doc-test-assesibility
📖 docs: Fix accessibility for assistive tools in documentation notes
2 parents e04f07c + 090e27a commit 9a7fd3c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+541
-306
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Docs Accessibility
2+
3+
on:
4+
push:
5+
paths:
6+
- '**/*.md'
7+
pull_request:
8+
paths:
9+
- '**/*.md'
10+
11+
jobs:
12+
lint:
13+
name: "Check Docs Accessibility"
14+
runs-on: ubuntu-latest
15+
# Pull requests from the same repository won't trigger this checks as they were already triggered by the push
16+
if: (github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository)
17+
steps:
18+
- name: Clone the code
19+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
20+
- name: Run check
21+
run: make test-docs-accessibility

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,10 @@ test-external-plugin: install ## Run tests for external plugin
234234
test-spaces: ## Run the trailing spaces check
235235
./test/check_spaces.sh
236236

237+
.PHONY: test-docs-accessibility
238+
test-docs-accessibility: ## Run the documentation accessibility check
239+
./test/check_docs_accessibility.sh
240+
237241
## TODO: Remove me when go/v4 plugin be removed
238242
## Deprecated
239243
.PHONY: test-legacy

docs/book/src/cronjob-tutorial/cronjob-tutorial.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ once, seeing them to completion.
1919
Instead of trying to tackle rewriting the Job controller as well, we'll
2020
use this as an opportunity to see how to interact with external types.
2121

22-
<aside class="note">
22+
<aside class="note" role="note">
2323

24-
<h1>Following Along vs Jumping Ahead</h1>
24+
<p class="note-title">Following Along vs Jumping Ahead</p>
2525

2626
Note that most of this tutorial is generated from literate Go files that
2727
live in the book source directory:
@@ -52,7 +52,7 @@ cd project
5252
kubebuilder init --domain tutorial.kubebuilder.io --repo tutorial.kubebuilder.io/project
5353
```
5454

55-
<aside class="note">
55+
<aside class="note" role="note">
5656

5757
Your project's name defaults to that of your current working directory.
5858
You can pass `--project-name=<dns1123-label-string>` to set a different project name.
@@ -62,9 +62,9 @@ You can pass `--project-name=<dns1123-label-string>` to set a different project
6262
Now that we've got a project in place, let's take a look at what
6363
Kubebuilder has scaffolded for us so far...
6464

65-
<aside class="note">
65+
<aside class="note" role="note">
6666

67-
<h1>Developing in <code>$GOPATH</code></h1>
67+
<p class="note-title">Developing in <code>$GOPATH</code></p>
6868

6969
If your project is initialized within [`GOPATH`][GOPATH-golang-docs], the implicitly called `go mod init` will interpolate the module path for you.
7070
Otherwise `--repo=<module path>` must be set.

docs/book/src/cronjob-tutorial/running-webhook.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ Run the following command to build your image locally.
1212
make docker-build docker-push IMG=<some-registry>/<project-name>:tag
1313
```
1414

15-
<aside class="note">
16-
<h1> Using Kind </h1>
15+
<aside class="note" role="note">
16+
<p class="note-title"> Using Kind </p>
1717

1818
Consider incorporating Kind into your workflow for a faster, more efficient local development and CI experience.
1919
Note that, if you're using a Kind cluster, there's no need to push your image to a remote container registry.
@@ -73,8 +73,8 @@ kubectl create -f config/samples/batch_v1_cronjob.yaml
7373
You can also try to create an invalid CronJob (e.g. use an ill-formatted
7474
schedule field). You should see a creation failure with a validation error.
7575

76-
<aside class="warning">
77-
<h3>The Bootstrapping Problem</h3>
76+
<aside class="warning" role="note">
77+
<p class="note-title">The Bootstrapping Problem</p>
7878

7979
When you deploy a webhook into the same cluster that it will validate, you can run into a *bootstrapping issue*:
8080
the webhook may try to validate the creation of its own Pod before it’s actually running.

docs/book/src/cronjob-tutorial/running.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ manifests using controller-tools, if needed:
1616
make install
1717
```
1818

19-
<aside class="note">
19+
<aside class="note" role="note">
2020

21-
<h1>Too long annotations error</h1>
21+
<p class="note-title">Too long annotations error</p>
2222

2323
If you encounter errors when applying the CRDs, due to `metadata.annotations` exceeding the
2424
262144 bytes limit, please refer to the specific entry in the [FAQ section](/faq#the-error-too-long-must-have-at-most-262144-bytes-is-faced-when-i-run-make-install-to-apply-the-crd-manifests-how-to-solve-it-why-this-error-is-faced).
@@ -29,9 +29,9 @@ Now that we've installed our CRDs, we can run the controller against our
2929
cluster. This will use whatever credentials that we connect to the
3030
cluster with, so we don't need to worry about RBAC just yet.
3131

32-
<aside class="note">
32+
<aside class="note" role="note">
3333

34-
<h1>Running webhooks locally</h1>
34+
<p class="note-title">Running webhooks locally</p>
3535

3636
If you want to run the webhooks locally, you'll have to generate
3737
certificates for serving the webhooks, and place them in the right
@@ -82,8 +82,8 @@ make docker-build docker-push IMG=<some-registry>/<project-name>:tag
8282
make deploy IMG=<some-registry>/<project-name>:tag
8383
```
8484

85-
<aside class="note">
86-
<h1>Registry Permission</h1>
85+
<aside class="note" role="note">
86+
<p class="note-title">Registry Permission</p>
8787

8888
This image ought to be published in the personal registry you specified. And it is required to have access to pull the image from the working environment.
8989
Make sure you have the proper permission to the registry if the above commands don't work.
@@ -98,7 +98,7 @@ kind load docker-image <your-image-name>:tag --name <your-kind-cluster-name>
9898

9999
To know more, see: [Using Kind For Development Purposes and CI](./../reference/kind.md)
100100

101-
<h1>RBAC errors</h1>
101+
<p class="note-title">RBAC errors</p>
102102

103103
If you encounter RBAC errors, you may need to grant yourself cluster-admin
104104
privileges or be logged in as admin. See [Prerequisites for using Kubernetes RBAC on GKE cluster v1.11.x and older][pre-rbc-gke] which may be your case.

docs/book/src/cronjob-tutorial/webhook-implementation.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ kubebuilder create webhook --group batch --version v1 --kind CronJob --defaultin
3737

3838
This changes the path in the webhook marker annotation but does not change where the webhook files are scaffolded. The webhook files will still be created in `internal/webhook/v1/`.
3939

40-
<aside class="note">
41-
<h1>Version Requirements</h1>
40+
<aside class="note" role="note">
41+
<p class="note-title">Version Requirements</p>
4242

4343
Custom webhook paths require **controller-runtime v0.21+**. In earlier versions (< `v0.21`), the webhook path must follow a specific pattern and cannot be customized. The path is automatically generated based on the resource's group, version, and kind (e.g., `/mutate-batch-v1-cronjob`).
4444

docs/book/src/cronjob-tutorial/writing-tests.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ The basic approach is that, in your generated `suite_test.go` file, you will use
99

1010
If you want to tinker with how your envtest cluster is configured, see section [Configuring envtest for integration tests](../reference/envtest.md) as well as the [`envtest docs`](https://pkg.go.dev/sigs.k8s.io/controller-runtime/pkg/envtest?tab=doc).
1111

12-
<aside class="note">
13-
<h1>Other Examples</h1>
12+
<aside class="note" role="note">
13+
<p class="note-title">Other Examples</p>
1414

1515
If you would like to see additional examples of controller tests generated by Kubebuilder, take a look at the <a href="../plugins/available/deploy-image-plugin-v1-alpha.md">Deploy Image plugin (deploy-image/v1-alpha)</a>.
1616
This plugin scaffolds APIs and controllers for managing an Operand (container image) on a cluster, following recommended patterns.

docs/book/src/faq.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11

22
# FAQ
33

4-
<aside class="note">
5-
<h1> Controller-Runtime FAQ </h1>
4+
<aside class="note" role="note">
5+
<p class="note-title"> Controller-Runtime FAQ </p>
66

77
Kubebuilder is developed on top of the [controller-runtime](https://github.com/kubernetes-sigs/controller-runtime)
88
and [controller-tools](https://github.com/kubernetes-sigs/controller-tools) libraries. We recommend you also check

docs/book/src/getting-started.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ We will create a sample project to let you know how it works. This sample will:
77
- Not allow more instances than the size defined in the CR which will be applied
88
- Update the Memcached CR status
99

10-
<aside class="note">
11-
<h1>Why Operators?</h1>
10+
<aside class="note" role="note">
11+
<p class="note-title">Why Operators?</p>
1212

1313
By following the [Operator Pattern][k8s-operator-pattern], it’s possible not only to provide all expected resources
1414
but also to manage them dynamically, programmatically, and at execution time. To illustrate this idea, imagine if
@@ -17,8 +17,8 @@ without any human intervention.
1717

1818
</aside>
1919

20-
<aside class="note">
21-
<h1>Following Along vs Jumping Ahead</h1>
20+
<aside class="note" role="note">
21+
<p class="note-title">Following Along vs Jumping Ahead</p>
2222

2323
Note that most of this tutorial is generated from literate Go files that
2424
form a runnable project, and live in the book source directory:
@@ -38,8 +38,8 @@ cd $GOPATH/memcached-operator
3838
kubebuilder init --domain=example.com
3939
```
4040

41-
<aside class="note">
42-
<h1>Developing in $GOPATH</h1>
41+
<aside class="note" role="note">
42+
<p class="note-title">Developing in $GOPATH</p>
4343

4444
If your project is initialized within [`GOPATH`][GOPATH-golang-docs], the implicitly called `go mod init` will interpolate the module path for you.
4545
Otherwise `--repo=<module path>` must be set.
@@ -66,8 +66,8 @@ By leveraging the Kubebuilder tool, we can define our APIs and objects represent
6666
While we've added only one Kind of resource in this example, we can have as many `Groups` and `Kinds` as necessary.
6767
To make it easier to understand, think of CRDs as the definition of our custom Objects, while CRs are instances of them.
6868

69-
<aside class="note">
70-
<h1> Please ensure that you check </h1>
69+
<aside class="note" role="note">
70+
<p class="note-title"> Please ensure that you check </p>
7171

7272
[Groups and Versions and Kinds, oh my!][group-kind-oh-my].
7373

@@ -106,8 +106,8 @@ type MemcachedStatus struct {
106106
}
107107
```
108108

109-
<aside class="note">
110-
<h1> Status Conditions </h1>
109+
<aside class="note" role="note">
110+
<p class="note-title"> Status Conditions </p>
111111

112112
Kubernetes has established conventions, and because of this, we use
113113
Status Conditions here. We want our custom APIs and controllers to behave
@@ -197,8 +197,8 @@ reconcile App {
197197
}
198198
```
199199

200-
<aside class="note">
201-
<h1> Return Options </h1>
200+
<aside class="note" role="note">
201+
<p class="note-title"> Return Options </p>
202202

203203
The following are a few possible return options to restart the Reconcile:
204204

@@ -356,9 +356,9 @@ if err := ctrl.SetControllerReference(memcached, dep, r.Scheme); err != nil {
356356
}
357357
```
358358
359-
<aside class="note">
359+
<aside class="note" role="note">
360360
361-
<h1><code>ownerRef</code> and Cascading Events</h1>
361+
<p class="note-title"><code>ownerRef</code> and Cascading Events</p>
362362
363363
The ownerRef is crucial not only for allowing us to observe changes on the specific resource but also because,
364364
if we delete the Memcached Custom Resource (CR) from the cluster, we want all resources owned by it to be automatically
@@ -435,8 +435,8 @@ see: [Run It On the Cluster](./quick-start#run-it-on-the-cluster)
435435
- To delve deeper into developing your solution, consider going through the [CronJob Tutorial][cronjob-tutorial]
436436
- For insights on optimizing your approach, refer to the [Best Practices][best-practices] documentation.
437437
438-
<aside class="note">
439-
<h1> Using Deploy Image plugin to generate APIs and source code </h1>
438+
<aside class="note" role="note">
439+
<p class="note-title"> Using Deploy Image plugin to generate APIs and source code </p>
440440
441441
Now that you have a better understanding, you might want to check out the [Deploy Image][deploy-image] Plugin.
442442
This plugin allows users to scaffold APIs/Controllers to deploy and manage an Operand (image) on the cluster.

docs/book/src/migration/ai-helpers.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
AI can assist manual migrations by reducing repetitive work and helping resolve breaking changes. It won't replace the [Manual Migration Process](./manual-process.md), but it can help reduce effort and accomplish the goal.
44

5-
<aside class="warning">
5+
<aside class="warning" role="note">
66

7-
<h1>Important</h1>
7+
<p class="note-title">Important</p>
88

99
These AI instructions are provided as examples to help guide your migration. Always validate AI output carefully - you remain responsible for ensuring correctness.
1010

0 commit comments

Comments
 (0)