Swiftpack.co -  loopwerk/SagaSwimRenderer as Swift Package
Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
A renderer for Saga that uses Swim to turn a RenderingContext into a String
.package(url: "https://github.com/loopwerk/SagaSwimRenderer.git", from: "0.4.0")


A renderer for Saga that uses Swim to turn a RenderingContext into a String.

It comes with a free function named swim which takes a function that goes from RenderingContext to Node, and turns it into a function that goes from RenderingContext to String, which can then be plugged into Saga's writers — which take functions of signature (RenderingContext) -> String.


The best example is Saga's Example project.



// swift-tools-version:5.2

import PackageDescription

let package = Package(
  name: "Example",
  platforms: [
  dependencies: [
    .package(url: "https://github.com/loopwerk/Saga", from: "0.19.0"),
    .package(url: "https://github.com/loopwerk/SagaParsleyMarkdownReader", from: "0.4.0"),
    .package(url: "https://github.com/loopwerk/SagaSwimRenderer", from: "0.4.0")
  targets: [
      name: "Example",
      dependencies: [


import Saga
import SagaParsleyMarkdownReader
import SagaSwimRenderer

try Saga(input: "content", output: "deploy", siteMetadata: EmptyMetadata())
    metadata: EmptyMetadata.self,
    readers: [.parsleyMarkdownReader()],
    writers: [

And your renderItem template:

func renderItem(context: ItemRenderingContext<EmptyMetadata, SiteMetadata>) -> Node {
  html(lang: "en-US") {
    body {
      div(id: "item") {
        h1 { context.item.title }


Stars: 1
Last commit: 15 weeks ago

Ad: Job Offers

iOS Software Engineer @ Perry Street Software
Perry Street Software is Jack’d and SCRUFF. We are two of the world’s largest gay, bi, trans and queer social dating apps on iOS and Android. Our brands reach more than 20 million members worldwide so members can connect, meet and express themselves on a platform that prioritizes privacy and security. We invest heavily into SwiftUI and using Swift Packages to modularize the codebase.


Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API