write_on_page
Add handwriting ink, highlights, shapes, and diagrams to an existing notebook page at specified coordinates.
Instructions
Copy a notebook and draw on an existing page (1-based) in handwriting ink.
items is a list of objects, coordinates in page units (A4 = 1091 x 1543, origin top-left):
{"type":"text","text":"...","x":100,"y":300,"width":800,"color":"red","size":11,"font":"patrick",
"hand":"natural","pen":"ballpoint"}
(y = first baseline; wraps inside width)
{"type":"markdown","text":"...","x":100,"y":300,"width":800}
{"type":"line"|"arrow","from":[x,y],"to":[x,y],"color":"blue"}
{"type":"rect","x":..,"y":..,"w":..,"h":..,"color":"green","radius":0}
{"type":"ellipse","cx":..,"cy":..,"rx":..,"ry":..,"color":"red"}
{"type":"underline","x0":..,"x1":..,"y":..,"double":false}
{"type":"check"|"star","x":..,"y":..,"size":18}
{"type":"tape","x":..,"y":..,"w":230,"h":40,"angle":0.05,"palette":"mint","pattern":"stripes|dots|grid"}
{"type":"highlight","x":..,"y":..,"w":..,"h":24,"color":"yellow"} covers a box (e.g. a line
of existing writing: y = top of the letters, h ~ 24 per line)
{"type":"highlight_line","from":[x,y],"to":[x,y],"width":24,"color":"pink"}
highlighter colours: yellow, pink, mint, lavender, peach, blue (Turkish names work) or #hex.
These are real Noteful highlighter strokes, drawn translucent under the ink.
{"type":"drawing","svg":"<svg viewBox=...>...</svg>","x":..,"y":..,"width":400}
a diagram drawn by you; see the drawing notes below.
Aim with page_layout: it numbers the handwriting on the page and gives each item's bbox, so
a tick goes at x1 + 30, a circle around the bbox, the right answer gets a highlight. To grade
a quiz: render_page to read the answers, page_layout to find the options, then one
write_on_page call with every mark (and a score near the title).
The result is opened in Noteful for Mac when it is installed; the reply says which option to
pick in Noteful's dialog. Notebooks of the live library are never modified.
Drawings (organs, cells, models, circuits, graphs): write a plain SVG with a viewBox 400-650 wide. It is scaled to the width given ('!draw 480' = 480 page units, the page is 1091 wide; inside '!columns' it is capped by the column), so labels need font-size 18-22 in that viewBox to stay readable. Outlines: stroke="#1f2233" stroke-width="2" become hand-drawn ink. Fills become pastel highlighter colouring, even dark ones, so separate stacked parts with outlines, not with darker fills; later shapes cover earlier ones (draw the organ, then its parts). Labels: <text x y font-size text-anchor> become handwriting, placed outside the drawing and joined to the part with a <line>. Use curves (C/Q/A) for organic shapes; keep it schematic like a textbook sketch. See the drawing examples.Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| page | Yes | ||
| path | Yes | ||
| items | Yes | ||
| open_in_noteful | No |