The Swift Package Index logo.Swift Package Index

Customising the DocC documentation theme


An interesting conversation on the Swift Package Index Discord server this weekend led a group of us to dig into whether DocC’s support for customised themes worked with our automatic package documentation hosting system.

The good news is that we do support it! We do very little processing of the generated DocC code after we build it, so we support everything that DocC generates.

This all came up as Cihat Gündüz wanted to customise the header for his HandySwift package. Here’s the result:

The HandySwift documentation showing a customised theme with a gradient background and a logo image.

We think you’ll agree this is an improvement over the default look and feel. You can check out the live version of this documentation on the site, and if you’d like to spruce up your package’s documentation, head over to the DocC documentation on appearance customisation to learn how it’s done.

Drop us a note via our Mastodon account if you take advantage of this theme customisation, and we’ll boost your reply.

Note: If you decide to customise the theme for your package’s documentation, the best way to test it out is not live on the SPI site. We coalesce commits from the default branch for a package and only build documentation a maximum of once every 24 hours for that branch (we always build tagged releases immediately). The best way to test theme customisation is to generate your web documentation locally with the DocC preview command, get it looking how you like it locally, and then push it so we can build it for you.


About this blog

The Swift Package Index is a search engine and metadata index for Swift packages. Our main goal is to help you make better decisions about the dependencies you include in your apps and projects. If you're new here, the best place to get started is by searching for packages.