Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/john-mueller/HyphenationPublishPlugin
A Publish plugin to hyphenate text
https://github.com/john-mueller/HyphenationPublishPlugin
publish-plugin
Last synced: 2 months ago
JSON representation
A Publish plugin to hyphenate text
- Host: GitHub
- URL: https://github.com/john-mueller/HyphenationPublishPlugin
- Owner: john-mueller
- License: mit
- Created: 2020-03-10T02:16:35.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2020-03-10T02:19:58.000Z (almost 5 years ago)
- Last Synced: 2024-10-28T22:36:46.680Z (3 months ago)
- Topics: publish-plugin
- Language: Swift
- Size: 3.91 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
- awesome-publish - Hyphenation
README
# Hyphenation plugin for Publish
A [Publish](https://github.com/JohnSundell/Publish) plugin that automatically hyphenates the text of your website using [Hyphenation](https://github.com/john-mueller/Hyphenation).
## Installation
To install the plugin, add it as a dependency within your `Package.swift` manifest:
```swift
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.
```swift
import HyphenationPublishPlugin
...
try DeliciousRecipes().publish(using: [
.installPlugin(.hyphenate())
...
])
```You can create the `Modifer`s for [Ink's](https://github.com/JohnSundell/Ink) `MarkdownParser` directly using the global `makeHyphenationModifiers(using:)` method.
```swift
import HyphenationPublishPlugin
import Inklet parser = MarkdownParser(modifiers: makeHyphenationModifiers(using: "-"))
print(parser.html(from: "hyphenate")) // prints "hy-phen-ate
"
```