-
Notifications
You must be signed in to change notification settings - Fork 12
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
🔗 Add support for myst.xref.json #372
Conversation
@@ -14,7 +14,17 @@ function api404(message = 'No API route found at this URL') { | |||
|
|||
export const loader: LoaderFunction = async ({ request, params }) => { | |||
const { slug } = params; | |||
// Handle /myst.xref.json as slug | |||
if (slug === 'myst.xref') { |
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 would be much nicer if we could have a separate loader in a different file [myst.xref.json].tsx
. However, that URL gets gobbled up by this file, where $slug
is resolved to myst.xref
...
return json(data); | ||
return json(data, { | ||
headers: { | ||
'Access-Control-Allow-Origin': '*', |
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 covers the basic case of loading cross-reference tool-tips from external sites. It won't work for github pages.
Cross references for external MyST projects is added here: jupyter-book/mystmd#1180 - this PR finesses the themes so those changes work well:
myst.xref.json
is served by the theme, similar toobjects.inv
/api/lookup
is no longer used for external links