Add ![[file.spd]] embed support - #139
Merged
Merged
Conversation
Wires 'spd' up to Obsidian's internal app.embedRegistry the same way 'note' already is, so a .spd file can be embedded inline in a note. SupernoteAtelierEmbed is simpler than SupernoteEmbed (.note's embed): .spd has no page concept, just layered tiles flattened into one composite image, so there's no page-nav toolbar to build. Extracts the render logic (read file -> SupernoteAtelier.open() -> toCompositeImage() -> data URL) that SupernoteAtelierView already had into a shared helper so the view and the new embed don't duplicate it. One item off #138.
6 tasks
5 tasks
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.
Summary
First slice of #138:
![[file.spd]]embed support, mirroring how![[file.note]]embeds already work.SupernoteAtelierEmbed(new, insrc/atelierView.ts) registersspdwithapp.embedRegistrythe same waySupernoteEmbeddoes fornote(seeSupernotePlugin.onloadinsrc/main.ts).SupernoteEmbed:.spdhas no page concept, just layered tiles flattened into one composite image viaSupernoteAtelier.toCompositeImage(), so there's no page-nav toolbar to build — just the image (or an empty/error message).SupernoteAtelier.open()→toCompositeImage()→ data URL) thatSupernoteAtelierView(Prototype .spd (Supernote Atelier) file support #137) already had into a sharedrenderAtelierCompositeDataUrl()helper, so the view and the new embed don't duplicate it.Scoped deliberately narrow: the other items in #138 (layer on/off toggle, export/conversion commands, viewport/zoom, device attach/upload) are separate follow-up work, not part of this PR.
Test plan
npm run buildsucceedsnpm test— all 95 existing tests still passnpm run lint— no new warnings/errors![[somefile.spd]]in a note) — no automated Electron/GUI harness for this repo yet, same as Prototype .spd (Supernote Atelier) file support #137's manual verification step