How to Generate Social Media Presentation Formats (Xiaohongshu, WeChat Moments, Stories) with PPT Master
PPT Master generates social media-ready presentations by treating every output slide as a canvas with predefined dimensions, allowing you to initialize projects with specific aspect ratios like 3:4 for Xiaohongshu, 1:1 for WeChat Moments, or 9:16 for Stories using the --format flag in project_manager.py.
PPT Master (hugohe3/ppt-master) is an open-source automation toolkit that converts Markdown content into professionally designed PowerPoint decks. Unlike traditional generators that default to standard 16:9 layouts, the repository supports social media presentation formats through a flexible canvas architecture that locks SVG viewBoxes to platform-specific dimensions from the start.
Understanding the Canvas Architecture
PPT Master treats every output slide as a canvas whose size and aspect ratio are defined at project initialization. According to references/canvas-formats.md (line 11), each social media format maps to a specific SVG viewBox and dimension set. For example, Xiaohongshu uses a portrait viewBox of 0 0 1242 1660 (line 13), while WeChat Moments employs a square format and Stories use vertical 9:16 dimensions.
When you initialize a project, the project_manager.py script accepts a --format flag (line 467) that fixes the canvas for all generated pages. This global setting propagates through the entire pipeline, ensuring that every SVG created by the Executor role conforms to the target platform's specifications (line 110).
Supported Social Media Formats
The system maintains canonical specifications in references/canvas-formats.md. The current implementation includes presets optimized for mobile viewing:
- Xiaohongshu (xhs): 3:4 portrait canvas designed for image-text sharing on RED
- WeChat Moments (wechat): 1:1 square format optimized for feed posts
- Stories (story): 9:16 vertical video-style layout for Instagram, TikTok, and similar platforms
Each entry defines the exact viewBox, pixel dimensions, and typical use cases, allowing the layout engine to make intelligent decisions about image placement and text flow.
Initializing a Project with Social Media Canvas
To generate presentation formats for specific platforms, use the --format parameter when creating your project. The project_manager.py script validates the canvas name against the reference specifications and configures the project structure accordingly.
# Xiaohongshu (3:4 portrait)
python3 skills/ppt-master/scripts/project_manager.py init my_xhs_project --format xhs
# WeChat Moments (1:1 square)
python3 skills/ppt-master/scripts/project_manager.py init my_wechat_project --format wechat
# Instagram/Story (9:16 vertical)
python3 skills/ppt-master/scripts/project_manager.py init my_story_project --format story
Once initialized, the canvas selection locks the global design context, preventing accidental aspect ratio mismatches during multi-page generation.
Layout Adaptation for Portrait and Square Ratios
When working with social media presentation formats, the layout engine automatically adapts to non-standard aspect ratios. According to references/image-layout-spec.md (lines 121-124), the system switches from the default left-right split to a top-bottom split for portrait canvases where height exceeds width.
This adaptation preserves readability on tall mobile screens. The image-layout-spec rules calculate optimal positioning zones based on the canvas orientation, ensuring that text overlays and image focal points remain within safe margins for mobile viewing.
Optimizing Images for Specific Canvases
Before generating slides, analyze source images to compute optimal placement for the selected canvas. The analyze_images.py utility accepts a --canvas argument that references the same format presets used during project initialization.
# Analyze images for Xiaohongshu layout
python3 skills/ppt-master/scripts/analyze_images.py projects/my_xhs_project/images --canvas xiaohongshu
This tool emits a Markdown table (line 229) detailing calculated image and text zones based on the portrait canvas rules. You can paste this analysis directly into your project's image resource list to guide the automated layout decisions.
Executing the Full Generation Pipeline
After preparing your content and analysis, run the standard three-step post-processing pipeline. As documented in AGENTS.md (line 91), these sequential steps convert your configured project into a platform-ready PPTX file:
# Split source Markdown into per-page files
python3 skills/ppt-master/scripts/total_md_split.py projects/my_xhs_project
# Finalize SVGs (ensures viewBox matches selected canvas)
python3 skills/ppt-master/scripts/finalize_svg.py projects/my_xhs_project
# Export to PPTX using the "final" SVG set
python3 skills/ppt-master/scripts/svg_to_pptx.py projects/my_xhs_project -s final
The resulting file opens in Microsoft PowerPoint with slide dimensions matching your selected social media format, ready for direct export or upload to the target platform.
Summary
- PPT Master generates social media presentation formats through a canvas-based architecture that defines aspect ratios at project initialization.
- Use the
--formatflag inproject_manager.pyto select Xiaohongshu (xhs), WeChat Moments (wechat), or Stories (story) presets. - The system automatically adapts layout rules from horizontal to vertical splits when using portrait canvases, as defined in
image-layout-spec.md. - Run
analyze_images.pywith the--canvasargument to pre-calculate optimal image zones for mobile formats. - The standard three-script pipeline (
total_md_split.py,finalize_svg.py,svg_to_pptx.py) outputs a PPTX file matching your target platform's exact dimensions.
Frequently Asked Questions
What canvas formats does PPT Master support for social media?
PPT Master supports Xiaohongshu (3:4 portrait), WeChat Moments (1:1 square), and Stories (9:16 vertical) through presets defined in references/canvas-formats.md. Each preset specifies the exact SVG viewBox and pixel dimensions required by the target platform. You can initialize any of these formats using the --format flag followed by the preset code (xhs, wechat, or story).
How does the layout adapt to portrait formats like Xiaohongshu?
When generating content for portrait canvases, PPT Master automatically switches from the default left-right image-text split to a top-bottom layout, as implemented in references/image-layout-spec.md (lines 121-124). This ensures content remains readable on mobile screens where the height significantly exceeds the width. The Executor role maintains this design context throughout the generation process.
Can I change the canvas format after creating a project?
No, the canvas format locks at project initialization when project_manager.py sets the global design context. To use a different social media format, you must create a new project with the desired --format parameter. This constraint ensures that all SVG files in a project maintain consistent viewBox dimensions, preventing layout errors during the final PPTX export.
Do I need special steps to export to social media platforms?
No special export steps are required. After running the standard post-processing pipeline (total_md_split.py, finalize_svg.py, and svg_to_pptx.py), the resulting PPTX file automatically uses the canvas dimensions specified at initialization. Open the file in PowerPoint to make final adjustments, then export as images or video depending on the target platform's requirements.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →