Generates illustrations for articles
This skill automatically generates relevant illustrations for a text article using the Gemini Image API and converts it into a visually appealing HTML file.
API Key Check:
Input Analysis:
Image Generation:
google.genai SDK to generate images.gemini-2.5-flash-image (default, or user specified).aspect_ratio="16:9" or 4:3 for article images.HTML Construction:
assets/template.html ("故都的秋" style).This skill includes reference files in the references/ directory:
references/template.html: The HTML/CSS template with serif fonts and clean layout. Use this as the base for the output file.references/api_guide.md: Detailed documentation for the Nano Banana Pro (Gemini 3 Pro Image) API, which can be used for advanced image generation needs.references/script_template.py: A Python script template containing the API calling logic.When invoked, the agent should:
Check API Key Configuration:
echo $GOOGLE_API_KEY (Linux/Mac) or echo %GOOGLE_API_KEY% (Windows).Read the target article provided by the user.
Plan the image insertion points.
Execute the Python script (scripts/article_to_html.py) with appropriate parameters:
python scripts/article_to_html.py <article_file> <api_key>python scripts/article_to_html.py <article_file>--images N, --model MODEL, --ratio RATIO, --size SIZEVerify the result and inform the user of the output location.