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

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.
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 ImageAttributesPublishPluginFor more information on how to use the Swift Package Manager, check out this article, or its official documentation.
The plugin can then be used within any publishing pipeline like this:
import ImageAttributesPublishPlugin
...
try DeliciousRecipes().publish(using: [
.installPlugin(.imageAttributes())
...
])