Swiftpack.co -  DoccZz/docc2html as Swift Package
Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
A static site generator for DocC documentation archives
.package(url: "https://github.com/DoccZz/docc2html.git", from: "0.4.2")


Tool to convert "DocC" archives, a format to document Swift frameworks and packages: Documenting a Swift Framework or Package, to a static HTML site.

Blog entry on the topic: DocC 📚 Archived and Analyzed.


First grab the package:

$ git clone https://github.com/DoccZz/docc2html.git
$ cd docc2html

Then run it on your .doccarchive:

$ swift run docc2html ~/Downloads/SlothCreator.doccarchive /tmp/SlothCreator/docs

This will create the static site in /tmp/SlothCreatorSite. The root documentation can be directly opened in the browser, e.g.

open file:/tmp/SlothCreatorSite/documentation/slothcreator/index.html



I think it is somewhat reasonable now. Templates (and Site.css) can be customized using external files. If willing to ajust the CSS to your own liking, it might be reasonable to use docc2html for something real.


Well, it's getting closer and the source code starts to be quite reasonable as well. Though you can still tell it started as a quick hack.


It's not ready for production yet, needs some more work.

This is a very quick hack/PoC full of quirks, and pretty incomplete. But it has working parts and we invite everyone to improve it and provide PRs. Or ignore it and come up with an own exporter base on the ideas (and possibly DocCArchive).

The tool is, as of today, just tested against the SlothCreator example.

It does not export tutorials yet, only the documents in the documentation folder.

It's not much yet, but a pretty good starting point.


  • ☐ better API doc templates
  • ☐ improve tutorial templates
  • ☐ better CSS
  • ☑ refactor code into a proper type and module for easier reuse
  • ☑ drop dependency on Macro
  • ☑ support Mustache templates in the filesystem! (for customization & faster testing)
  • ☑ generate proper index.html

Using it on GitHub

We didn't try yet 🥸 But hope to be able to move the SwiftBlocksUI Documentation to that. Going to take some time until it's possible.

The GH action would need to:

  • patch the Package.swift version to 5.5
  • run the xcodebuild -doc thing to produce the DocC archives
  • use docc2html on each of the archives
  • publish the result to GH Pages


docc2html is brought to you by the Always Right Institute and ZeeZide. We like feedback, GitHub stars, cool contract work, presumably any form of praise you can think of.


Stars: 28
Last commit: 1 week 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.

Release Notes

3 weeks ago

Adds support for loading the Mustache templates and site.css from a directory in the filesystem (specify using -t/--templates). Allows customisation of the output at will.

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