Swiftpack.co - DoccZz/DocCArchive as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
DoccZz/DocCArchive
Swift package to read and process "DocC" archives
.package(url: "https://github.com/DoccZz/DocCArchive.git", from: "0.2.10")

DocCArchive

Swift package to read and process "DocC" archives, a format to document Swift frameworks and packages: Documenting a Swift Framework or Package.

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

Status

The module can import all documents created in the SlothCreator example.

It should be pretty complete.

If you find an issue (usually signalled by an assertion or fatalError), please let us know, we'll fix missing cases ASAP (PRs are welcome too).

TODO:

  • ☐ Add DocC documentation! 🤦‍♀️
  • ☑ Add a testsuite (existing one not added for sizing concerns).

Usage in a Swift Package

Example Package.swift:

// swift-tools-version:5.0

import PackageDescription

let package = Package(
  name         : "hackdocc",
  products     : [ .executable(name: "hackdocc", targets: [ "hackdocc" ]) ],
  dependencies : [
    .package(url: "https://github.com/DoccZz/DocCArchive.git", from: "0.1.1")
  ],
  targets: [ .target(name: "hackdocc", dependencies: [ "DocCArchive" ]) ]
)

Using the Code

DocCArchive has three main types:

  • DocCArchive, represents the whole archive structure
  • DocumentFolder , represents a documentation folder within that structure
  • Document, represents a a documentation page (topics, types, tutorials, etc, the "JSON files")

Open the archive, access the documentation folder (tutorials is the other one), then Document's can be opened in the folder.

let url     = URL(fileURLWithPath: "~/Downloads/SlothCreator.doccarchive")
let archive = try DocCArchive(contentsOf: url)

if let docs = archive.documentationFolder() {
  ... work it ...
}

Who

servedocc 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.

GitHub

link
Stars: 3
Last commit: 2 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.

Submit a free job ad (while I'm testing this). The analytics numbers for this website are here.

Release Notes

Syntactically Strong
2 weeks ago

Fixed issues with parsing double-star strong quotes and made the "syntax" field on code sections optional. Fixes for #2 and #3, many thanks go to @edudnyk!

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