Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: Facets 3.0.6 Minor update available for module facets (3.0.6). Release: Facets 3.0.5 Minor update available for module facets (3.0.5). Release: Flag 5.1.0 Minor update available for module flag (5.1.0). Release: Block Layout Accordion 1.0.2 Minor update available for module block_layout_accordion (1.0.2). Release: Canvas interactive toggle 1.0.2 Minor update available for module canvas_interactive_toggle (1.0.2). Release: Views HTTP Client 1.0.2 Minor update available for module views_http_client (1.0.2). Release: Block Layout Accordion 1.0.1 Minor update available for module block_layout_accordion (1.0.1). Release: Canvas interactive toggle 1.0.1 Minor update available for module canvas_interactive_toggle (1.0.1). Usage Milestone: Simplify Module simplify crossed 10,000 active installs. Module Revived: Entityqueue Buttons 1.1.2 Module entityqueue_buttons updated after 8 months of inactivity (1.1.2).

Markdown Importer

2 sites No security coverage Drupal 10–11 Markdown ecosystem
View on drupal.org

This module imports Markdown files from GitHub, GitLab, or private repositories into Drupal nodes. It converts Markdown to HTML, allows configuration of target content types and fields, and supports recursive scanning of repositories.

Introduction

The Markdown Importer module is a powerful tool for importing Markdown files into Drupal nodes. It supports integration with both GitHub and GitLab or Private hosted public repositories, making it easy to fetch and transform Markdown files into Drupal content types.

This module utilizes the league/commonmark Markdown parser library for accurate Markdown-to-HTML conversion and provides configuration options for custom content types and fields.

Features

  • Import Markdown files from GitHub and GitLab or Private hosted public repositories.
  • Automatically convert Markdown into HTML using the league/commonmark library.
  • Support for custom content types and target fields.
  • Recursive repository scanning for Markdown files in subdirectories.
  • Validation and error handling for invalid URLs or unsupported platforms.

Requirements

  • Drupal 10/11.
  • Composer (for library dependency management).
  • PHP 8.2 or later.

Installation

  1. Install the module as you would normally install a contributed Drupal module. See Installing Modules for details.
  2. Use Composer to install required dependencies:
    composer require league/commonmark league/commonmark-ext-heading-permalinks league/commonmark-ext-attributes
    

Configuration

Automatic Configuration

  • Upon enabling the module, a default form is provided at /admin/config/services/import-markdown to configure the import process.

Steps to Import Markdown

  1. Navigate to the configuration page for the module.
  2. Enter the Repository URL and select the Platform (GitHub or GitLab or Private hosted git repository).
  3. Choose the Content Type where Markdown content should be imported.
  4. Select the Target Field to store the Markdown content (e.g., body).
  5. Click Import Markdown to start the process.

AJAX-Driven Dynamic Selection

  • The module provides dynamic AJAX-based field selection to ensure compatibility with the selected content type.

Advanced Configuration

  • Customize the Markdown parser settings (e.g., for anchors and attributes) using hook_markdown_importer_config_modify() in a custom module.
  • Utilize the MarkdownProcessor service for programmatic imports.
  • Enable additional features like heading permalinks and custom attributes by modifying the league/commonmark configuration.

Additional Information

  • The module uses html_input: strip and allow_unsafe_links: false for secure Markdown parsing by default. See CommonMark Security Documentation for details.
  • Recursive scanning is enabled to fetch Markdown files from subdirectories of the repository.

Known Limitations

  • This module is currently not compatible with Markdown files containing advanced JavaScript or custom HTML tags unless configured explicitly.
  • Ensure repositories are publicly accessible, as private repositories require additional authentication handling (not included in this version).

Documentation

  • Full documentation is available in the module repository.

Depends on

Dependencies of the latest stable release

  • filter Drupal core

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
3
Tracked since
Dec 2024
Latest release
1 year ago
Releases (12 mo)
0 ▼ from 3
Maintenance
Dormant

Release Timeline

Releases

Version Type Core Release date
1.0.1 Stable 10–11 Dec 11, 2024
1.x-dev Dev 10–11 Dec 10, 2024
1.0.0 Stable 10–11 Dec 10, 2024