Swiftpack.co - john-mueller/HyphenationPublishPlugin as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by john-mueller.
john-mueller/HyphenationPublishPlugin v0.1.0
A Publish plugin to hyphenate text
⭐️ 2
🕓 4 years ago
.package(url: "https://github.com/john-mueller/HyphenationPublishPlugin.git", from: "v0.1.0")

Hyphenation plugin for Publish

A Publish plugin that automatically hyphenates the text of your website using Hyphenation.

Installation

To install the plugin, add it as a dependency within your Package.swift manifest:

let package = Package(
    ...
    dependencies: [
        ...
        .package(url: "https://github.com/john-mueller/HyphenationPublishPlugin", from: "0.1.0")
    ],
    targets: [
        .target(
            ...
            dependencies: [
                ...
                "HyphenationPublishPlugin"
            ]
        )
    ]
    ...
)

Then import HyphenationPublishPlugin where you'd like to use it.

Usage

The hyphenate(using:) plugin can be installed in a publishing pipeline using the installPlugin(_:) step. The default separator character is U+00AD (soft hyphen) if the parameter is omitted.

import HyphenationPublishPlugin
...
try DeliciousRecipes().publish(using: [
    .installPlugin(.hyphenate())
    ...
])

You can create the Modifers for Ink's MarkdownParser directly using the global makeHyphenationModifiers(using:) method.

import HyphenationPublishPlugin
import Ink

let parser = MarkdownParser(modifiers: makeHyphenationModifiers(using: "-"))
print(parser.html(from: "hyphenate")) // prints "<p>hy-phen-ate</p>"

GitHub

link
Stars: 2
Last commit: 4 years ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

Release Notes

Version 0.1.0
4 years ago

Initial release of the Hyphenation Publish step

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