file_to_images
Convert markdown or text files into image cards for Xiaohongshu by extracting titles from headings, cleaning formatting, and offering themes, ratios, and AI covers.
Instructions
Convert a local markdown or text file to a series of images. Supports .md, .txt, .text files. Automatically extracts title from the first # heading in markdown files. Cleans up markdown formatting for cleaner text display.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ratio | No | Image aspect ratio | 3:4 |
| theme | No | Visual theme for the images | minimal |
| title | No | Override the auto-extracted title | |
| filePath | Yes | Absolute path to the markdown or text file | |
| fontSize | No | Font size for content | medium |
| outputDir | No | Directory path to save generated images. If provided, images will be saved as PNG files. | |
| showCover | No | Whether to generate a cover page (defaults to true for files) | |
| charsPerPage | No | Custom characters per page | |
| generateAiCover | No | Generate AI cover image using Gemini. Defaults to true if GEMINI_API_KEY is set. Set to false to disable. |