forked from graphql/graphql.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
new landing — docs tweaks #41
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
Merged
Merged
Changes from 15 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
692cf1a
Switch out @theguild/remark-mermaid to for rehype-mermaid
hasparus ec606ec
Expose Heading hooks from nextra-theme-docs
hasparus 14e569f
Customize MDX links and headings
hasparus f180b30
Support Tailwind text opacity in typography-link
hasparus 34cd0b6
fixup! Expose Heading hooks from nextra-theme-docs
hasparus 4d28812
fixup! Expose Heading hooks from nextra-theme-docs
hasparus a6380af
Style Mermaid charts with CSS Custom Properties
hasparus af374b0
Fix search styles
hasparus a4e9c14
install Chromium Headless Shell in builds
hasparus 238132e
Install libnspr4 and libgbm1 in builds
hasparus 26b9a1f
Update lockfile
hasparus 3bc9781
patch mermaid-isomorphic
hasparus 32b5f77
Patch again
hasparus ce9beaf
Update flowchart padding
hasparus 062fd96
Remove old comment
hasparus 2755dfe
Remove duplicate border
hasparus File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
diff --git a/dist/mermaid-isomorphic.js b/dist/mermaid-isomorphic.js | ||
index aa5dc09a5dfb58a98d3f12cd2fc473caddd97b0d..d0fa3ca8e690233d0b50e4f992ab6ac33c11585b 100644 | ||
--- a/dist/mermaid-isomorphic.js | ||
+++ b/dist/mermaid-isomorphic.js | ||
@@ -1,4 +1,5 @@ | ||
-import { chromium } from 'playwright'; | ||
+import { chromium as playwright } from 'playwright'; | ||
+import chromium from '@sparticuz/chromium'; | ||
const html = import.meta.resolve('../index.html'); | ||
const mermaidScript = { | ||
url: import.meta.resolve('mermaid/dist/mermaid.js') | ||
@@ -7,6 +8,9 @@ const faStyle = { | ||
// We use url, not path. If we use path, the fonts can’t be resolved. | ||
url: import.meta.resolve('@fortawesome/fontawesome-free/css/all.css') | ||
}; | ||
+ | ||
+chromium.setGraphicsMode = false; | ||
+ | ||
/* c8 ignore start */ | ||
/** | ||
* Render mermaid diagrams in the browser. | ||
@@ -122,7 +126,21 @@ async function getBrowser(browserType, launchOptions) { | ||
* A function that renders Mermaid diagrams in the browser. | ||
*/ | ||
export function createMermaidRenderer(options = {}) { | ||
- const { browserType = chromium, launchOptions } = options; | ||
+ let { browserType = playwright, launchOptions } = options; | ||
+ | ||
+ if (process.env.CI) { | ||
+ if (options.browserType) { | ||
+ throw new Error('options.browserType is not supported because @hasparus patched it to run on Vercel builds, sorry'); | ||
+ } | ||
+ browserType = { | ||
+ launch: async () => playwright.launch({ | ||
+ ...launchOptions, | ||
+ args: chromium.args, | ||
+ executablePath: await chromium.executablePath(), | ||
+ }) | ||
+ } | ||
+ } | ||
+ | ||
let browserPromise; | ||
let count = 0; | ||
return async (diagrams, renderOptions) => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
diff --git a/dist/index.d.mts b/dist/index.d.mts | ||
index 71f87bcd1dde49d7c19ad49fc098e715a76c5c10..6671e29326be99861058895916185910452ced17 100644 | ||
--- a/dist/index.d.mts | ||
+++ b/dist/index.d.mts | ||
@@ -1421,3 +1421,19 @@ declare function ThemeSwitch({ lite, className }: ThemeSwitchProps): ReactElemen | ||
declare function Layout({ children, themeConfig, pageOpts }: NextraThemeLayoutProps): ReactElement; | ||
|
||
export { Bleed, Collapse, type PartialDocsThemeConfig as DocsThemeConfig, Link, LocaleSwitch, Navbar, NotFoundPage, SkipNavContent, SkipNavLink, ThemeSwitch, Layout as default, getComponents, useConfig, useMenu, useThemeConfig }; | ||
+ | ||
+export type ActiveAnchor = Record< | ||
+ string, | ||
+ { | ||
+ isActive?: boolean | ||
+ aboveHalfViewport: boolean | ||
+ index: number | ||
+ insideHalfViewport: boolean | ||
+ } | ||
+> | ||
+ | ||
+export declare const useActiveAnchor: () => ActiveAnchor | ||
+export declare const useSetActiveAnchor: () => Dispatch<SetStateAction<ActiveAnchor>> | ||
+export declare const useIntersectionObserver: () => IntersectionObserver | null | ||
+export declare const useSlugs: () => WeakMap<any, any> | ||
+ | ||
diff --git a/dist/index.js b/dist/index.js | ||
index 56201641fd965dcc5ab7c5df53e444c41293c00e..860b8cfd297e82da041c4d8287ed266691d75a0e 100644 | ||
--- a/dist/index.js | ||
+++ b/dist/index.js | ||
@@ -100,10 +100,10 @@ IntersectionObserverContext.displayName = "IntersectionObserver"; | ||
var slugs = /* @__PURE__ */ new WeakMap(); | ||
var SlugsContext = createContext(slugs); | ||
SlugsContext.displayName = "Slugs"; | ||
-var useActiveAnchor = () => useContext(ActiveAnchorContext); | ||
-var useSetActiveAnchor = () => useContext(SetActiveAnchorContext); | ||
-var useIntersectionObserver = () => useContext(IntersectionObserverContext); | ||
-var useSlugs = () => useContext(SlugsContext); | ||
+export var useActiveAnchor = () => useContext(ActiveAnchorContext); | ||
+export var useSetActiveAnchor = () => useContext(SetActiveAnchorContext); | ||
+export var useIntersectionObserver = () => useContext(IntersectionObserverContext); | ||
+export var useSlugs = () => useContext(SlugsContext); | ||
var ActiveAnchorProvider = ({ | ||
children | ||
}) => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
This is SVG padding so we can't make it responsive easily.