Skip to content

Commit 48653db

Browse files
committed
(docs/infra): migrate book to mdbook v0.5.0
The migration from mdbook v0.4.40 to v0.5.0 introduces a few nice features that will provide better UX and DX.
1 parent 0f74925 commit 48653db

File tree

15 files changed

+254
-178
lines changed

15 files changed

+254
-178
lines changed

docs/book/book.toml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
[book]
22
authors = ["The Kubebuilder Maintainers"]
3-
multilingual = false
43
src = "src"
54
title = "The Kubebuilder Book"
65

@@ -17,9 +16,3 @@ command = "./litgo.sh"
1716

1817
[preprocessor.markerdocs]
1918
command = "./markerdocs.sh"
20-
21-
[context.environment]
22-
environment = { GO_VERSION = "1.23" }
23-
24-
[context.deploy-preview.environment]
25-
environment = { GO_VERSION = "1.23" }

docs/book/install-and-build.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ if [[ ${arch} == "amd64" ]]; then
3939
elif [[ ${arch} == "x86" ]]; then
4040
arch="i686"
4141
elif [[ ${arch} == "arm64" ]]; then
42-
# arm64 is not supported for v0.4.40 mdbook, so using x86_64 type.
42+
# arm64 is not supported for v0.4.40 mdbook, so using x86_64 type.
4343
# Once the mdbook is upgraded to latest, use 'aarch64'
4444
arch="x86_64"
4545
fi
@@ -58,7 +58,7 @@ case ${os} in
5858
;;
5959
linux)
6060
# works for linux, too
61-
target="unknown-${os}-gnu"
61+
target="unknown-${os}-musl"
6262
;;
6363
*)
6464
target="unknown-${os}"
@@ -67,7 +67,7 @@ esac
6767

6868
# grab mdbook
6969
# we hardcode linux/amd64 since rust uses a different naming scheme and it's a pain to tran
70-
MDBOOK_VERSION="v0.4.40"
70+
MDBOOK_VERSION="v0.5.0"
7171
MDBOOK_BASENAME="mdBook-${MDBOOK_VERSION}-${arch}-${target}"
7272
MDBOOK_URL="https://github.com/rust-lang/mdBook/releases/download/${MDBOOK_VERSION}/${MDBOOK_BASENAME}.${ext}"
7373

docs/book/src/introduction.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
**Note:** Impatient readers may head straight to [Quick Start](quick-start.md).
1+
>[!Tip]
2+
>Impatient readers may head straight to [Quick Start](quick-start.md).
23
3-
**Using previous version of Kubebuilder v1 or v2?**
4-
**Check the legacy documentation for [v1](https://book-v1.book.kubebuilder.io), [v2](https://book-v2.book.kubebuilder.io) or [v3](https://book-v3.book.kubebuilder.io)**
4+
>[!Important]
5+
>Using previous version of Kubebuilder? Check the legacy documentation for [v1](https://book-v1.book.kubebuilder.io), [v2](https://book-v2.book.kubebuilder.io) or [v3](https://book-v3.book.kubebuilder.io).
56
67
## Who is this for
78

docs/book/src/logos/favicon.png

55.1 KB
Loading
File renamed without changes.

docs/book/src/migration/multi-group.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,9 @@ mv internal/webhook/* internal/webhook/batch/
6060
For any new webhook created for a new group, the respective functions will be created under subdirectory `internal/webhook/<group>/`.
6161

6262
<aside class="note">
63+
6364
<h1>If you are using the deprecated layout go/v3</h1>
65+
6466
Then, your layout has not the internal directory. So, you will move the controller(s) under a directory with the name of the API group which it is responsible for manage.
6567

6668
```bash
@@ -127,6 +129,8 @@ The [CronJob tutorial][cronjob-tutorial] explains each of these changes in
127129
more detail (in the context of how they're generated by Kubebuilder for
128130
single-group projects).
129131

132+
</aside>
133+
130134
[multi-group-issue]: https://github.com/kubernetes-sigs/kubebuilder/issues/923 "Kubebuilder Issue #923"
131135
[cronjob-tutorial]: /cronjob-tutorial/cronjob-tutorial.md "Tutorial: Building CronJob"
132136
[migration-guide]: /migration/migration_guide_gov3_to_gov4.md "Migration from go/v3 to go/v4"

docs/book/src/reference/platform.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ The following covers what you need to do to provide the support for one or more
1818

1919
The images used in workloads such as in your Pods/Deployments will need to provide the support for this other platform.
2020
You can inspect the images using a ManifestList of supported platforms using the command
21-
[docker manifest inspect <image>][docker-manifest], i.e.:
21+
[`docker manifest inspect <image>`][docker-manifest], i.e.:
2222

2323
```shell
2424
$ docker manifest inspect myregistry/example/myimage:v0.0.1

docs/book/theme/css/custom.css

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* Adds a thin border to the sidebar (aesthetics) */
2-
#sidebar {
2+
#mdbook-sidebar {
33
border-right: 1px solid var(--theme-popup-border);
44
}
55

@@ -36,6 +36,14 @@ html {
3636
text-decoration: solid underline var(--links);
3737
}
3838

39+
/* Hides excessive theme options */
40+
#mdbook-theme-default_theme,
41+
#mdbook-theme-rust,
42+
#mdbook-theme-coal,
43+
#mdbook-theme-ayu {
44+
display: none;
45+
}
46+
3947
/* custom light theme */
4048
.light {
4149
--sidebar-bg: #eef5ff;

docs/book/theme/css/markers.css

Lines changed: 28 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@
77
* extract the actual relevant information. Theoretically, this'll let us do
88
* stuff like transform the information for different screen widths. */
99

10+
/* Removes the counter from marker definitions */
11+
dd:has(+ dd)::before,
12+
dd + dd::before {
13+
content: normal;
14+
}
15+
1016
/* the marker */
1117
.marker {
1218
display: flex;
@@ -65,14 +71,14 @@
6571
font-style: inherit;
6672
}
6773
.marker dl.args.summary dt:first-child::before {
68-
content: ':';
74+
content: ":";
6975
}
7076
.marker dl.args.summary dt::before {
71-
content: ',';
77+
content: ",";
7278
}
7379
/* hide in non-summary view */
7480
.marker dd.args {
75-
display: none
81+
display: none;
7682
}
7783

7884
/* the description */
@@ -85,7 +91,7 @@
8591

8692
/* all arguments */
8793
.marker dl.args dt.argument::after {
88-
content: '=';
94+
content: "=";
8995
}
9096
.marker dl.args dd.type {
9197
font-style: italic;
@@ -98,14 +104,16 @@
98104
font-size: 0.875em;
99105
}
100106
.marker .literal {
101-
font-family: "Source Code Pro", Consolas, "Ubuntu Mono", Menlo, "DejaVu Sans Mono", monospace, monospace;
107+
font-family:
108+
"Source Code Pro", Consolas, "Ubuntu Mono", Menlo, "DejaVu Sans Mono",
109+
monospace, monospace;
102110
font-size: 0.875em; /* please adjust the ace font size accordingly in editor.js */
103111
}
104112
.marker .argument.type::before {
105-
content: '‹';
113+
content: "‹";
106114
}
107115
.marker .argument.type::after {
108-
content: '›';
116+
content: "›";
109117
}
110118

111119
/* summary args */
@@ -134,7 +142,7 @@
134142
}
135143

136144
.marker .type .slice::before {
137-
content: '[]';
145+
content: "[]";
138146
}
139147

140148
/* description args */
@@ -158,10 +166,10 @@
158166

159167
/* summary view */
160168
.markers-summarize:checked ~ dl > .marker dd.args {
161-
display: inline-block
169+
display: inline-block;
162170
}
163171
.markers-summarize:checked ~ dl > .marker dd.description dl.args {
164-
display: none
172+
display: none;
165173
}
166174
.markers-summarize:checked ~ dl > .marker dd.description {
167175
margin-bottom: 0.25em;
@@ -172,11 +180,11 @@ input.markers-summarize {
172180
}
173181
label.markers-summarize::before {
174182
margin-right: 0.5em;
175-
content: '\25bc';
183+
content: "\25bc";
176184
display: inline-block;
177185
}
178186
input.markers-summarize:checked ~ label.markers-summarize::before {
179-
content: '\25b6';
187+
content: "\25b6";
180188
}
181189

182190
/* misc */
@@ -280,7 +288,6 @@ details.collapse-code > summary::-webkit-details-marker {
280288
display: none;
281289
}
282290

283-
284291
/* diagrams */
285292

286293
.diagrams {
@@ -296,12 +303,15 @@ details.collapse-code > summary::-webkit-details-marker {
296303
font-weight: bold;
297304
}
298305

299-
.diagrams object, .diagrams svg {
306+
.diagrams object,
307+
.diagrams svg {
300308
max-width: 100%;
301309
max-height: 10em; /* force svg height to behave */
302310
}
303311

304-
.diagrams path, .diagrams polyline, .diagrams circle {
312+
.diagrams path,
313+
.diagrams polyline,
314+
.diagrams circle {
305315
stroke: var(--fg);
306316
}
307317

@@ -360,7 +370,9 @@ aside.note.warning > h1::before {
360370
/* literate source citations */
361371
cite.literate-source {
362372
font-size: 75%;
363-
font-family: "Source Code Pro", Consolas, "Ubuntu Mono", Menlo, "DejaVu Sans Mono", monospace, monospace;
373+
font-family:
374+
"Source Code Pro", Consolas, "Ubuntu Mono", Menlo, "DejaVu Sans Mono",
375+
monospace, monospace;
364376
}
365377
cite.literate-source::before {
366378
content: "$ ";

0 commit comments

Comments
 (0)