Swift Package Index


An HTML tidying step for the Publish static site generator


  • The latest stable release is v0.1.1. Released 11 months ago.
  • The last commit to master was 11 months ago.

Swift Version Compatibility

  • v0.1.1 and master
    5.3
    5.2
    5.1
    5.0
    4.2
Full build results

Platform Compatibility

  • v0.1.1
    iOS
    macOS(Intel)
    macOS(ARM)
    Linux
    tvOS
    watchOS
  • master
    iOS
    macOS(Intel)
    macOS(ARM)
    Linux
    tvOS
    watchOS
Full build results

Tidy HTML step for Publish

A PublishingStep for Publish that nicely formats your website's HTML using SwiftSoup.

Installation

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

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

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

Usage

The tidyHTML(withIndentation:) step should be inserted into your publishing pipeline after your HTML is generated. The default indentation is one space, if the parameter is omitted.

import TidyHTMLPublishStep
...
try DeliciousRecipes().publish(using: [
    ...
    .generateHTML(withTheme: .foundation),
    ...
    .tidyHTML(indentedBy: .spaces(4))
    ...
])

This package also provides an alternate convenience API to the Website.publish(withTheme:...:additionalSteps:...) method, replacing additionalSteps with preGenerationSteps and postGenerationSteps. The tidyHTML step should be passed to the postGenerationSteps parameter:

import TidyHTMLPublishStep
...
try DeliciousRecipes().publish(
    withTheme: theme,
    postGenerationSteps: [
        .tidyHTML()
    ]
)