This project is not covered by Drupal’s security advisory policy.

The Output Format API module provides a robust framework for content negotiation and format transformation, enabling seamless conversion of Drupal entity output into multiple formats (e.g., Markdown, PDF). This module is ideal for developers and site builders aiming to deliver diverse content formats to their audience with minimal setup.


Features

The Output Format API offers:

  • Standards-Based Format Negotiation: Supports HTTP content negotiation via the Accept header (e.g., Accept: text/plain) and complies with IANA media type standards.
  • Flexible Content Transformation: Converts HTML or other entity-rendered outputs into formats like Markdown or PDF.
  • Extensible Framework: Allows developers to define custom converters for new formats. Extend the module to support additional formats by implementing the OutputFormatConverterBase plugin class.
  • Entity-Specific Formatting: Generate format-specific representations for individual entities or bundles, enabling granular control.

Use cases include:

  • Providing alternative format downloads for articles, reports, or documentation.
  • Simplifying workflows for static site generation.
  • Enhancing API output compatibility with diverse client applications.

Post-Installation

After installation:

  1. Configuration: Visit the module's configuration page under Admin > Configuration > Output Format API > Manage IANA Media Types to:

    • Enable or disable format converters.
    • Assign media types to entity types or bundles.
  2. IANA Media type formats: Adjust settings for specific media type formats to enable or disable certain converters.

  3. Entity Links: Check enabled entities for new links in their canonical page menus, offering formatted versions.

Additional Information

  • Extensibility: Developers can extend the module to support additional formats by implementing the OutputFormatConverterBase plugin class.
  • Use Case Examples: Generate Markdown documentation, provide PDF invoices, or deliver alternate formats for API consumers.

Project information

Releases