Closed xrstf closed 10 months ago
@xrstf Thanks for this cleanup. Let me know when it is ready to be merged. I've just checked the live result and it looked pretty good to me.
/hold
This is ready from my site, but I'm putting it on hold to coordinate the merge and deployment.
/lgtm /hold cancel
/approve
[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: tengqm, xrstf
The full list of commands accepted by this bot can be found here.
The pull request process is described here
This is a follow-up to #333. In that PR, the navData.js generation was refactored, but I was unsure if it still functioned properly. While investigating I found that there is really no need to keep generating a standalone file, if we simply put the necessary data into the DOM from the beginning.
So that's what this PR does. It extends the generated markup a bit, by introducing
<div class="toc-item" id="...">...</div>
wrappers around each concept/section and by re-organizing the DOM for the navigation tree entirely. That way the scroll-apiref.js can deduce everything it needs from the site already.Sadly the script lives in another castle, so to show the result of this PR, I uploaded it to https://kube-api.ninja/refdocs-pr/ (using copies of the assets hosted on kubernetes.io).
https://github.com/kubernetes/website/pull/43076 is the sister PR to this one, containing the rewritten
scroll-apiref.js
.