-
Notifications
You must be signed in to change notification settings - Fork 260
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
Introduce support for Docusaurus 3.5.0+ #919
Conversation
Size Change: -5.24 MB (-38.76%) 🎉 Total Size: 8.28 MB
ℹ️ View Unchanged
|
Visit the preview URL for this PR (updated for commit b06fdcc): https://docusaurus-openapi-36b86--pr919-xgjyuhft.web.app (expires Sun, 15 Sep 2024 16:15:49 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 |
import type { Props } from "@theme/DocItem"; | ||
import DocItemLayout from "@theme/DocItem/Layout"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like this change caused a visual update to generated API pages. Previously, the pagination at the bottom of the page was constrained to the center portion of the page, now after this update, the pagination also stretches into the right sidebar. We prefer the way it was previously. Is there any way to restore that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch @IanVS! I thought I could get away with not including Layout
in our theme but didn't notice this side effect. Should be an easy fix.
If you need a fix sooner, you can swizzle Layout
and use the useDoc
hook to extract api
from front matter, which can be used to conditionally set the footer/paginator col width:
Snippet:
<div className="row">
<div className={clsx("col", !docTOC.hidden && styles.docItemCol)}>
{unlisted && <Unlisted />}
<DocVersionBanner />
<div className={styles.docItemContainer}>
<article>
<DocBreadcrumbs />
<DocVersionBadge />
{docTOC.mobile}
<DocItemContent>{children}</DocItemContent>
<div className="row">
<div className={clsx("col", api ? "col--7" : "col--12")}>
<DocItemFooter />
</div>
</div>
</article>
<div className="row">
<div className={clsx("col", api ? "col--7" : "col--12")}>
<DocItemPaginator />
</div>
</div>
</div>
</div>
{docTOC.desktop && <div className="col col--3">{docTOC.desktop}</div>}
</div>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I caught it because of a visual regression testing tool, have you considered adding something like that to the demo, to catch small changes like this that are potentially easy to miss?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have - would you be willing to share your setup? I know Docusaurus uses Playwright + Argos, but I was hoping for something self-contained that can run entirely in GH Actions. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have used Percy in the past and recently switched to using lost-pixel. I'm using their platform version via a github action (which is free for open source projects), but they also have a purely open-source self-hosted model available that would probably meet your needs from what I can tell.
Description
Introduces support for latest Docusaurus, i.e. 3.5.0 - 3.5.2. Note that Docusaurus 3.5.0 moved
useDoc
andDocProvider
which required changes that will not be backward compatible with prior Docusaurus versions.