Skip to content

Latest commit

 

History

History
66 lines (46 loc) · 1.83 KB

AGENTS.md

File metadata and controls

66 lines (46 loc) · 1.83 KB

Agent Guide

What this repo does

noteframe is a Rust CLI tool that converts Markdown notes into Instagram-ready 1080×1080px PNG images. Write a short .md file, run just post, get an image.

Build & test

just build   # cargo build --release
just test    # cargo test

Always run just build after making changes to confirm it compiles cleanly before considering a task done.

Key commands

just post notes/my-note.md     # generate image(s) from a note
just new "My Title"            # scaffold a new note in notes/
just new "My Title" --layout carousel

Source layout

File Responsibility
src/main.rs CLI entrypoint (post and new subcommands via clap)
src/note.rs YAML frontmatter parsing + markdown → slides
src/render.rs Image generation: layout, font sizing, text rendering
src/fonts.rs Font resolution by script (Latin → Merriweather, Persian → Noto Sans Arabic UI)

Note format

---
title: "Post title"
layout: post        # post (single image) | carousel (one image per ## section)
bg: "#FAFAF8"
text: "#1A1A1A"
accent: "#AAAAAA"
hashtags: []
---

Body text. Supports **bold**, *italic*, and ***bold italic***.

Layouts

  • post — single 1080×1080 PNG; title + body vertically centered
  • carousel — one PNG per ## heading; output named stem-01.png, stem-02.png, …

Font & language behaviour

  • Script is auto-detected from content — no config needed
  • Latin/English → Merriweather (regular/italic) + New York Large (bold)
  • Persian → Noto Sans Arabic UI Medium; text is right-aligned
  • Font size auto-scales based on word count — shorter text renders larger

Output

Generated PNGs are saved alongside the source .md file.

Dependencies

Managed via mise.toml (Rust stable) and Cargo.toml.