Swift DocC

DocC works at different levels and lets you write references, articles and tutorials pretty much on the fly.

Aside of the inline source code documentation (which can be previewed via Assistant -> Documentation Preview) you can add a Documentation Catalog in order to store tutorials and theme your documentation.

The documentation is based on markdown but was extended with Directives that allow you to style and organize the content or to add metadata. The WWDC23 video provides a good overview!

One example for those directives are rows and columns

Row {
   @Column(size: 2){
      @Image(source: "icon-power-icon", alt: "A blue square containing a snowflake.") {
         Ice power
      }
   }


   @Column {
      @Image(source: "fire-power-icon", alt: "A red square containing a flame.") {
         Fire power
      }
   }
 }
}

Or tabs

@TabNavigator {
   @Tab("Powers") {
      ![A diagram with the five sloth power types.](sloth-powers)
   }


   @Tab("Exercise routines") {
      ![A sloth relaxing and enjoying a good book.](sloth-exercise)
   }
 }

as well as special links

@Links(visualStyle: compactGrid) {
   - <doc:get-started-preparing-sloth-food>
   - <doc:feeding-your-sloth-in-winter>
   - <doc:ordering-food-delivery>
}

There are a lot of metadata directives that modify stuff like PageColor, PageKind, …, SupportedLanguages.

Sources