Swiftpack.co - Package - finestructure/ImageAttributesPublishPlugin

ImageAttributes plugin for Publish

A Publish plugin that allows you to specify image attributes. The following image markdown

![](https://example/image.png width=400)

is transformed into

<img src="https://example/image.png" width="400"/>

This is helpful for markdown editors like Ulysses that support image attributes like width and height to control rendering.

The ImageAttributes plugin is attribute agnostic, i.e. it will render any foo=bar pair into foo="bar" HTML markup, regardless of whether the attribute is an actual HTML attribute or not.

Installation

To install it into your Publish package, add it as a dependency within your Package.swift manifest:

let package = Package(
    ...
    dependencies: [
        ...
        .package(url: "https://github.com/finestructure/ImageAttributesPublishPlugin", from: "0.1.0")
    ],
    targets: [
        .target(
            ...
            dependencies: [
                ...
                "ImageAttributesPublishPlugin"
            ]
        )
    ]
    ...
)

Then import to use it:

import ImageAttributesPublishPlugin

For more information on how to use the Swift Package Manager, check out this article, or its official documentation.

Usage

The plugin can then be used within any publishing pipeline like this:

import ImageAttributesPublishPlugin
...
try DeliciousRecipes().publish(using: [
    .installPlugin(.imageAttributes())
    ...
])

Github

link
Stars: 2

Dependencies

Used By

Total: 0

Releases

- 2020-03-14 17:15:05

  • escape html entities in titles

- 2020-02-29 13:02:10