Skip to content

Conversation

@vitorfloriano
Copy link
Contributor

@vitorfloriano vitorfloriano commented Nov 14, 2025

This PR migrates the Kubebuilder book from mdBook v0.4.40 to v0.5.0.

Since this is a breaking change, the custom preprocessors (literatego and markerdocs) had to be slightly adjusted. The mdBook parser also got stricter and some fixes were necessary. See the mdBook v0.5 migration guide.

mdBook v0.5.0 introduces fixes and a some nice features that could improve the book DX and UX. To name a few:

  • Header navigation in the Table of Contents ("On this page")
  • The TOC now follows and highlights the current page
  • Support for definition lists in markdown (could be useful for the markers section)
  • Support for admonitions in markdown (could be useful for highlighting important info, like tips, warnings, notes, etc)

Related to #4862

@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 14, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: vitorfloriano
Once this PR has been reviewed and has the lgtm label, please assign kavinjsir for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Nov 14, 2025
@k8s-ci-robot
Copy link
Contributor

Hi @vitorfloriano. Thanks for your PR.

I'm waiting for a github.com member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@vitorfloriano vitorfloriano force-pushed the migrate-preprocessors branch 3 times, most recently from 5892069 to 0d68b62 Compare November 14, 2025 15:10
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 15, 2025
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 15, 2025
@vitorfloriano vitorfloriano force-pushed the migrate-preprocessors branch 2 times, most recently from 0264f19 to 5f1f791 Compare November 18, 2025 13:48
@vitorfloriano vitorfloriano marked this pull request as ready for review November 18, 2025 13:53
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 18, 2025
@vitorfloriano
Copy link
Contributor Author

@camilamacedo86 Now that mdBook v0.5.0 is out, I think this one is ready to ship.

I believe the deployment is failing right now due to another Cloudflare global network issue, so I guess we need to wait and see what happens when it's fixed.

The migration from mdbook v0.4.40 to v0.5.0
introduces a few nice features that will provide
better UX and DX.
@camilamacedo86
Copy link
Member

Hi @vitorfloriano

That seems amazing 🎉
That only thing that is not playing nice for us is all sub-sections be render in the menu ie:

Screenshot 2025-11-18 at 15 01 40

Is possible do not have that?
WDYT?

additional-css = ["theme/css/markers.css", "theme/css/custom.css", "theme/css/version-dropdown.css"]
git-repository-url = "https://github.com/kubernetes-sigs/kubebuilder"
edit-url-template = "https://github.com/kubernetes-sigs/kubebuilder/edit/master/docs/book/{path}"

Copy link
Contributor Author

@vitorfloriano vitorfloriano Nov 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@camilamacedo86 Unfortunately, it's not possible to not fold deeply nested sections like those. See this comment from the maintainer.

I could, though, include more foldable sections, like this:

image

I could also make them foldable but open by default, but the deeply nested sections would still be folded:

image

This is simply a matter of config:

Suggested change
[output.html.fold]
enable = true
level = 5 # 0 would be all folded

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we not enable = false to not have this behaviour?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we not enable = false to not have this behaviour?

@camilamacedo86 This config defaults to false. That's how it currently is. But the deep nested headers will always be folded, no matter the config.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you find any way of reduce that, I think it would be great already

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is really bad :-(

Screenshot 2025-11-18 at 18 00 47

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

very confusing :-(

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@camilamacedo86 I tweaked some CSS classes. See if you like it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The deployment is not showing the changes in the last commit...🤔 Perhaps it's showing a cached version of the website?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the latest tweaks I was able to show all sections in my localhost, but somehow the deploy preview is not updating...

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants