Swift Package Index

ReadingTimePublishPlugin

https://github.com/alexito4/ReadingTimePublishPlugin.git

Reading time estimation plugin for Publish.


Compatibility

  • 0.2.0 and master
    5.3
    5.2
    5.1
    5.0
    4.2
  • 0.2.0 and master
    iOS
    macOS(Intel)
    macOS(ARM)
    Linux
    tvOS
    watchOS

PublishReadingTime

Swift 5.1 Mac & Linux

Reading time estimation plugin for Publish.

Installation

Usage

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

import PublishReadingTime
...
try DeliciousRecipes().publish(using: [
    ...
    .addMarkdownFiles(),
    .installPlugin(.readingTime()),
    ...
])

Note that it must be installed after the Items are created (in this case by addMarkdownFiles() ).

Then you can add the information on your Theme:

HTML(...
.p("\(item.readingTime.minutes) minutes"),
...

Author

Alejandro Martinez | http://alejandromp.com | @alexito4