itafroma/drupal-markdown_image

Provides shorthand to allow easy use of image fields in Markdown.

dev-7.x-1.x 2013-09-03 21:02 UTC

README

Provides shorthand to allow easy use of image fields in Markdown.

Motivation

The Markdown syntax for images is the following:

![image title](image url)

In Drupal, knowing the image URL is a difficult prospect because many different things can act on the image before it's displayed. One example is image styles: while you might know the original URL, finding out what the image style URL is can be difficult. Moreover, hard-linking to an image can cause problems if the image style changes.

Requirements

  • Drupal 7
  • The Markdown module
  • An entity that has an image field and a text field with the Markdown text format enabled

Downloading and installation

Using Composer via Packagist

Add itafroma/drupal-markdown_image to your composer.json:

{
    "require": {
        "itafroma/drupal-markdown_image": "dev-7.x-1.x"
    }
}

Composer's Drupal installer assumes composer.json is in your modules folder. If it isn't and you want to install the module somewhere else, use a custom install path in your composer.json:

{
    "extra": {
        "installer-paths": {
            "sites/all/modules/{$name}/": ["type:drupal-module"]
        }
    }
}

More information can be found in the README for Composer's installers package.

Using Git

Clone the repository into one of your modules folders:

git clone -b 7.x-1.x git@github.com:itafroma/drupal-markdown_image.git markdown_image

Once downloaded, install Markdown Image as you would any other module.

Usage

Use the standard Markdown syntax for images, replacing the URL with the name of the image field followed by the index of the image:

![Image tite](field_image:1)

Copyright and license

Contributors to Markdown Image hold copyright to their respective contributions. It is licensed via the GPLv2 only: if you contribute code, you agree to license your contributions via the same license.

GPLv2-compatible cross-licensing will be considered: please create an issue! Due to its reliance on the Drupal API (which is GPLv2+), it cannot be cross-licensed with a less restrictive, non-GPL-compatible license.

The full license can be found in the LICENSE file.