Swiftpack.co - finestructure/ImageAttributesPublishPlugin as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by finestructure.
finestructure/ImageAttributesPublishPlugin 0.1.1
A Publish plugin to add support for image attributes
⭐️ 8
🕓 4 years ago
.package(url: "https://github.com/finestructure/ImageAttributesPublishPlugin.git", from: "0.1.1")

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 style="max-width:100%;" 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: 8
Last commit: 4 years ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

Dependencies

Release Notes

4 years ago
  • escape html entities in titles

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics