New swift-documentation-extract tool available

not sure if there’s a better place to announce this, but i’ve just published a small SPM plugin called swift-documentation-extract, which vends a plugin command called catalog.

$ swift package catalog > catalog.json

It only does two things:

  • it requests symbolgraphs from the SPM for the modules you specify (or all targets, by default).
  • it locates the .docc archives in each of the modules you specify.

it emits this information in the form of JSON objects which are easy for other tooling to digest.

swift-documentation-extract is not a replacement for swift-docc-plugin, but it makes it easier for other tooling like swift-biome to reuse the parts of the stack they have in common with DocC.

see swift-json for a rough example of how to use swift-documentation-extract to integrate multiple documentation tools.

3 Likes