mdx icon

mdx

gzhmd Node

Actions3

md2card → md转图片

AI-generated

Overview

This node converts Markdown content into an image card. It is useful for scenarios where you want to visually present Markdown text as styled images, such as generating social media posts, creating visual notes, or sharing formatted content in a graphical format. For example, you can input a Markdown snippet describing a meeting agenda and output a themed image card that can be easily shared on messaging platforms or embedded in presentations.

Properties

Name Meaning
markdown The Markdown content to convert into an image card. Example: "## Title\n\nContent".
主题 (theme) The visual theme/style of the card. Options include Apple Notes, Instagram style, Coil Notebook, Pop Art, ByteDance style, Alibaba orange, Art Deco, Glassmorphism, Warm, Minimal gray, Minimalist black & white, Dreamy gradient, Nature, Xiaohongshu purple, Notebook, Business, Japanese magazine, Dark tech, Typewriter, Watercolor, Traditional Chinese, Fairytale, Cyberpunk, Meadow dawn.
主题模式 (themeMode) The mode variant of the selected theme. This depends on the chosen theme and provides different stylistic modes within that theme. Same options as theme.
宽度 (width) Width of the output image card in pixels. Default is 540.
卡片高度 (heigth) Height of the output image card in pixels. Default is 960.
拆分模式 (splitMode) How to split the Markdown content into multiple cards/images: "长图文" (noSplit) for one long image, "自动拆分" (autoSplit) for automatic splitting, "横线拆分" (hrSplit) to split by horizontal lines.
mdx模式 (mdxMode) Boolean flag to enable MDX mode (Markdown with JSX support). Default true.
高度超出隐藏 (overHiddenMode) In long image mode (noSplit), whether to hide content that exceeds the height limit. Default false.
字体 (font) Font style used in the card. Many Chinese and popular fonts are available, e.g., Alibaba PuHuiTi variants, DingTalk Jinbu Ti, Xiaomi MiSans variants, Source Song font, various handwriting and decorative fonts.
输出参数 (output) Output parameter name for the generated image data. Used when splitMode is not "autoSplit". Default "data".
输出路径 (outputPath) Output path for the generated images when splitMode is "autoSplit". Default "data".

Output

The node outputs JSON data containing the generated image(s) from the Markdown content rendered according to the selected theme and options. The output field (named by the output or outputPath property) contains the image data, typically as base64-encoded strings or URLs referencing the generated images.

If the split mode is set to auto-split, multiple images may be output, each representing a segment of the original Markdown content.

Binary data output is not explicitly detailed but can be assumed to represent the image files corresponding to the rendered cards.

Dependencies

  • The node relies on an internal resource factory to obtain the implementation function for the given resource and operation.
  • It uses a bundled configuration defining themes and their modes.
  • No external API keys or services are explicitly required based on the provided code.
  • The node expects the environment to have access to the necessary fonts and rendering capabilities for Markdown to image conversion.

Troubleshooting

  • Error: "未实现方法: md2card.md转图片"
    This indicates the requested resource-operation pair is not implemented. Verify that the resource and operation names are correct and supported.

  • Rendering issues or blank images
    Check that the Markdown content is valid and that the selected theme and font are supported. Also, verify width and height settings are appropriate.

  • Output missing or empty
    Ensure the output property is correctly set and matches the expected output field in downstream nodes.

  • Splitting mode confusion
    When using autoSplit, output paths differ from noSplit mode. Make sure to handle these differences in subsequent workflow steps.

Links and References

Discussion