Skip to content

tgymnich/PygmentsPublishPlugin

Repository files navigation

PygmentsPublishPlugin

A work in progress implemntation of a pygments plugin for use with Publish.

Install

Install pygments on your machine.

pip3 install pygments

In your Package.swift add:

.package(url: "https://github.com/tgymnich/PygmentsPublishPlugin.git", from: "0.0.4")

Setup

To load the plugin simply add these lines:

import PygmentsPublishPlugin

...

try MyWebsite().publish(
    ...
    plugins: [.pygmentize(withClassPrefix: "")]
])

CSS

You'll also need to add some CSS. Check out these examples