Notion Markdown icon

Notion Markdown

Node to transform markdown and notion blocks

Overview

This node, named "Notion Markdown," is designed to transform data between Markdown format and Notion blocks. It supports three main operations:

  • Markdown to Notion: Converts Markdown text into Notion block structures.
  • Notion to Markdown: Converts Notion blocks back into Markdown text, with an option to convert images to base64 encoding to avoid expiration issues with Notion URLs.
  • Notion to Notion: Transforms Notion blocks into a different Notion block format (likely for normalization or restructuring).

This node is useful in scenarios where users want to integrate content editing workflows between Markdown editors and Notion databases or pages. For example, a user might write content in Markdown and then import it as structured Notion blocks, or export Notion content as Markdown for use in other tools.

Properties

Name Meaning
Output Key The key under which the transformed output will be stored in the JSON output object.

Note: Although the node supports additional properties internally (like operation type, input markdown, input notion blocks, and image conversion), only the "Output Key" property was provided for this summary.

Output

The node outputs a JSON object containing the transformed data under the specified output key. Depending on the operation:

  • For Markdown to Notion, the output is an array of Notion block objects representing the parsed Markdown content.
  • For Notion to Markdown, the output is a Markdown string generated from the input Notion blocks. If enabled, images within the Markdown are converted to base64 strings to prevent link expiration.
  • For Notion to Notion, the output is a transformed array of Notion blocks, potentially normalized or restructured.

No binary data output is indicated by the source code.

Dependencies

  • Uses the external package @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.
  • Requires no explicit API keys or external service credentials based on the provided code.

Troubleshooting

  • Common Issues:
    • Invalid or malformed Markdown or Notion block input may cause errors during transformation.
    • Enabling image base64 conversion may increase processing time or memory usage.
  • Error Messages:
    • Errors include item index information and descriptive messages about what failed during processing.
    • To handle errors gracefully, the node supports continuing on failure, appending error details to the output.

Links and References

Discussion