md2card → md转html
AI-generatedOverview
This node converts Markdown content into HTML cards with customizable visual themes and theme modes. It is useful for transforming raw Markdown text into styled HTML snippets that can be embedded in websites, blogs, or applications requiring rich text presentation. For example, a user can input Markdown notes and output visually appealing HTML cards themed like Instagram posts, vintage typewriter style, or watercolor art.
Properties
| Name | Meaning |
|---|---|
| markdown | The Markdown content to convert. Supports multi-line input. Example default: "## 标题\n\n内容" (a heading and some content). |
| 主题 (theme) | The visual theme style of the output card. Options include Instagram风格, 线圈笔记本, 波普艺术, 字节范, 阿里橙, 艺术装饰, 玻璃拟态, 温暖柔和, 简约高级灰, 极简黑白, 梦幻渐变, 清新自然, 紫色小红书, 笔记本, 商务简报, 日本杂志, 暗黑科技, 复古打字机, 水彩艺术, 中国传统, 儿童童话, 赛博朋克, 青野晨光. |
| 主题模式 (themeMode) | The mode variant of the selected theme, dynamically loaded based on the chosen theme. Options overlap with themes but may differ in styling details, e.g., 苹果备忘录, Instagram风格, etc. |
Output
The node outputs an array of JSON objects where each object corresponds to one input item processed. Each output JSON contains the HTML representation of the Markdown content styled according to the selected theme and theme mode. The exact structure of the output JSON is not explicitly shown in the source, but it typically includes fields representing the generated HTML card.
No binary data output is indicated.
Dependencies
- This node depends on an internal resource factory (
ResourceFactory) that provides implementations for different resource-operation pairs. - It uses a help plugin module for configuration data, specifically for loading theme modes dynamically.
- No external API keys or services are required based on the provided code.
- Requires n8n environment with access to the bundled resource definitions and theme configurations.
Troubleshooting
Error: 未实现方法: md2card.md转html
This error occurs if the requested resource-operation pair is not implemented or registered. Ensure the resource "md2card" and operation "md转html" are correctly configured and available.Call function error
If the conversion function throws an error, it will be logged with details. Users can enable "Continue On Fail" to skip problematic items instead of stopping execution.Theme or Theme Mode Loading Issues
If theme modes fail to load, verify that the theme ID matches one in the configuration and that thegetThemeModemethod returns valid options.
Links and References
- No direct external links are provided in the source code.
- For Markdown syntax reference: https://www.markdownguide.org/basic-syntax/
- For n8n custom node development: https://docs.n8n.io/integrations/creating-nodes/
