Notion Markdown icon

Notion Markdown

Node to transform markdown and notion blocks

Overview

This node, named "Notion Markdown," provides transformations between Notion blocks and Markdown formats. It supports three operations:

  • Markdown to Notion: Converts Markdown text into Notion block structures.
  • Notion to Markdown: Converts Notion blocks into Markdown text.
  • Notion to Notion: Transforms Notion blocks into a different Notion block format (likely normalized or filtered).

This node is useful when integrating Notion content with other systems that use Markdown or when manipulating Notion data programmatically. For example, you can export Notion pages as Markdown for static site generators or convert Markdown notes into Notion pages.

Properties

Name Meaning
Operation Choose the transformation operation: "Markdown to Notion", "Notion to Markdown", or "Notion to Notion".
Input Markdown The Markdown text to be converted into Notion blocks (used only if Operation is "Markdown to Notion").
Input Notion Blocks The Notion blocks JSON string to be transformed (used if Operation is "Notion to Markdown" or "Notion to Notion").
Output Key The key name under which the output result will be stored in the item’s JSON object.
Convert Images to Base64 Whether to convert images in Notion blocks to base64 encoding to avoid URL expiration (only applies to "Notion to Markdown" operation).

Output

The node outputs the transformed data under the specified output key in each item's JSON object:

  • For Markdown to Notion, the output is an array of Notion block objects representing the input Markdown.
  • For Notion to Markdown, the output is a Markdown string generated from the input Notion blocks. If image conversion is enabled, images are embedded as base64 strings.
  • For Notion to Notion, the output is a transformed array of Notion blocks.

No binary data output is produced by this node.

Dependencies

  • Uses the external library @tryfabric/martian for converting Markdown to Notion blocks.
  • Uses local modules blocks-to-markdown and blocks-to-blocks for converting Notion blocks to Markdown and transforming Notion blocks respectively.
  • No explicit API keys or external service credentials are required.

Troubleshooting

  • Invalid Input Format: Providing malformed Markdown or Notion blocks JSON may cause errors. Ensure inputs are correctly formatted strings.
  • Image Conversion Issues: When enabling image base64 conversion, large images might increase processing time or memory usage.
  • Operation Mismatch: Using properties not relevant to the selected operation (e.g., providing Markdown input when operation is "Notion to Notion") will have no effect.
  • Error Messages: Errors during processing include the item index and message. Check the input data at the indicated item for issues.

Links and References

Discussion