Repository navigation
Conversation
annotate renders each page of the original's PDF export and writes an image with labels for the spec's checks, plus an editable Excalidraw scene with the page as TDEV-BACKGROUND--FILE (#385). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- excalidoc's backgroundImageScene builds the scene for both the markup editor and the annotate CLI - leave header and footer bands out when locating body text - canvas is an optional dependency, loaded only by the annotate CLI Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
|
✅ Deploy Preview for teaching-dev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
General notes are an orange list at the top left of the first page. sharp encodes webp and is an optional dependency like canvas. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Notes without a place on the page use font size 20. Labels name the paragraph style only once, e.g. «Überschrift 1». «» is kept for styles. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Students set the width in the size field, so dragged sizes should fail. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ut them Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ing titles Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… the editor, drop sharp Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
Part 4 for #385, stacked on #388 (← #387 ← #386). It evaluates whether annotated page images of the original can be generated for the checks picked in the docx-spec, using the Excalidraw markup convention of
@tdev/excalidoc, and ships a working prototype.Result: feasible, with two manual steps
Word documents have no layout of their own, so the page images need a layout engine. Word or LibreOffice don't run in the CLI, and JS docx renderers are not exact. The prototype therefore takes the original exported as PDF from Word (one click for the teacher, pixel-exact):
For every page it writes:
original-annotated-<n>.webp.excalidraw: the page is the background image (PNG,TDEV-BACKGROUND-IMAGE/TDEV-BACKGROUND--FILE, built by the new pure helperbackgroundImageScenein excalidoc, whichcreateExcalidrawMarkupnow uses too). The labels, arrows and frames are ordinary, editable elements in Excalidraw's «Normal» font. The scene exports at scale 4 with a padding of 4 (exportPaddingis now part of excalidoc'sCustomData).original-annotated-<n>.webp: a fixed placeholder (blurred page, "open in the image editor, check and save"). The teacher opens each image in the image-markup editor, checks the labels and saves; the editor's WebP export replaces the placeholder. There is no CLI-rendered preview, so there is no second renderer of the layout and nosharp.How it works:
pdfjs-distandcanvasare already in yarn.lock throughreact-pdf.Artifact), and searched only for header/footer checks. Untagged PDFs fall back to the margins of the first section.Grading changes in this PR
These change what students see and are not part of the annotation prototype:
quote()); «» are kept for names of styles. Check ids derive from titles, so regenerating a spec changes the ids of section checks (e.g.-cc5c6d→-e4af02); no spec onmainis affected yet.Verified
@excalidraw/excalidraw(bundled from this repo, in headless Chromium) restored and exported the generated scenes (checked before the placeholder change; the scene format has since gained the typed element fieldsindex,startBinding,endBinding,lastCommittedPoint).assets/ex01-what-is-programming-annotated-1.webp.excalidraw, generated from the Word PDF inassets/, and next to it the image editor's export (.webp).Open / not verified
standardFontDataUrlwas not tested..excalidraw(about 550 KB per page for the example), which grows the repository.canvasis an optional dependency:yarn installdoesn't fail without it, and the CLI explains what's missing.Decisions
🤖 Generated with Claude Code