Embed hosted diagrams: a README image that updates, an iframe and oEmbed - #91
Merged
Merged
Conversation
The .svg link revalidates on every view, /d/:id/embed can be framed by any site, and /oembed lets Notion, Medium and docs sites embed a link. Share copies the README image and the embed code.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
FL-88.
/d/:id.svgstays current in a README: served withCache-Control: no-cache, max-age=0and an ETag per revision (and format), with an explicit 304 onIf-None-Match. GitHub's image proxy asks every time; an unchanged drawing costs a 304, an update shows at once./d/:id/embed: the drawing alone, fitted to the frame, linking back to the page;Content-Security-Policy: frame-ancestors *, noX-Frame-Options./oembed?url=: rich oEmbed JSON (version 1.0), an iframe sized to the drawing withinmaxwidth/maxheight, and the OG image as the thumbnail; 404 for links that are not ours, 501 forformat=xml. The page advertises it with<link rel="alternate" type="application/json+oembed">, so Notion, Medium and docs sites embed a pasted link.[](…/d/id)) and Copy embed code (the iframe).Tests: server suite against PostgreSQL (16, three new), publish e2e for both buttons. e2e 144, vitest 300, lint and typecheck.