GitXplorerGitXplorer
j

TidyHTMLPublishStep

public
4 stars
1 forks
1 issues

Commits

List of commits on branch master.
Verified
35621b3f047200abf9789f21174626c15ea9c66a

Merge pull request #2 from john-mueller/documentation

jjohn-mueller committed 5 years ago
Verified
83e9118baf09e5de19c8562f19ccb58452532508

Merge pull request #1 from john-mueller/github-actions

jjohn-mueller committed 5 years ago
Unverified
e21bf252270f0d1b63b0fea0ba09f88c46e7ef58

Added GitHub Actions for testing and linting

jjohn-mueller committed 5 years ago
Unverified
51963b2b1903511d1217600095821ff8793db93e

Added documentation comment

jjohn-mueller committed 5 years ago
Unverified
ffc9c4fc33d8a4cc744739def0c6a334cdd84c19

Changed copyright format

jjohn-mueller committed 5 years ago
Unverified
603286c0882bc7562d23215d3b7c99378c875615

Initial Commit

jjohn-mueller committed 5 years ago

README

The README file for this repository.

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()
    ]
)