NekoPaw Render
Use this skill when the user wants to turn content into display-ready bitmap files for a NekoPaw device.
Environment and setup:
- Install runtime packages with
pip install -r skill/render/requirements.txt - Install the browser binary with
python -m playwright install chromium - Install
flowText/pretextJavaScript dependencies withnpm install
Agent workflow:
- Decide whether the input is
Markdownorscene json. - Render a preview PNG first so the layout can be inspected.
- Convert that preview into a raw
1bpp bitmapfile. - If the user wants to show it on a device, hand the bitmap file to
python skill/bridge_cli.py display bitmap --input ...
Examples:
python skill/render_cli.py markdown --input note.md --preview out/note.png --bitmap out/note.bin
python skill/render_cli.py scene --input scene.json --preview out/scene.png --bitmap out/scene.bin
python skill/render_cli.py scene --input skill/render/examples/scene_news_card.json --preview out/news_card.png --bitmap out/news_card.bin
python skill/render_cli.py scene --input skill/render/examples/scene_poster_card.json --preview out/poster_card.png --bitmap out/poster_card.bin
python skill/render_cli.py scene --input skill/render/examples/scene_pet_companion.json --preview out/pet_companion.png --bitmap out/pet_companion.bin --bw-preview out/pet_companion_bw.png
python skill/render_cli.py bitmap --input out/scene.png --output out/scene.bin --dither floyd-steinberg
python skill/render_cli.py confirm-assets \
--title "Smart Home" \
--body "Turn on the fan?" \
--output-dir out/confirm
Notes:
markdownsupports regular text flow and the first image block as a figure sidebar.sceneis the free-layout path for absolute-positioned text and image blocks.scenesupportsflowTextfor boxed key text that usespretext, avoids wrapping image rectangles, and reports overflow throughlayoutReport.scenenow supports stablezstacking within each visual layer, plus imageanchorplacement forcover/contain/fill.- On the current
296x128low-res black-and-white target,scenetext blocks now render into the final bitmap on the target pixel grid instead of only relying on browser text downscaling. - On that same low-res target, text blocks are rasterized in their own block canvas before being composited back, so block clipping, centering, and invert badges stay more stable than the old whole-page white overlay path.
- The low-res text path still accepts
NEKOPAW_RENDER_FONT_REGULARandNEKOPAW_RENDER_FONT_BOLDas font overrides; without them, ASCII-heavy blocks preferVerdana/Tahoma, while blocks with Chinese or other non-ASCII text preferMicrosoft YaHei/Yu Gothic. - See
docs/SCENE_JSON.mdfor the current scene schema andskill/render/examples/for ready-to-render examples. confirm-assetsemitspending/confirmed/cancelled/timeoutpreview and bitmap files together.- Those
confirm-assetsoutputs can be sent to the device withpython skill/bridge_cli.py display confirm create --assets-dir out/confirm. - Successful commands print JSON to stdout and exit
0. Local validation, dependency, file, or rendering errors print local JSON and exit2.
Source: TruElysia02/NekoPaw — distributed by TomeVault.