Skip to content

Instantly share code, notes, and snippets.

@jpsim
Last active July 3, 2020 20:26
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jpsim/eed98cc50f9c979ebfbce7616bb4e161 to your computer and use it in GitHub Desktop.
Save jpsim/eed98cc50f9c979ebfbce7616bb4e161 to your computer and use it in GitHub Desktop.
Jazzy Linux

Running jazzy from a fresh Ubuntu machine:

Create a brand new Ubuntu machine

$ doctl compute droplet create jazzy --size 16gb \
    --image ubuntu-16-10-x64 --region sfo1
$ doctl compute ssh jazzy

Install Swift

$ apt-get update
$ apt-get install -y clang libblocksruntime0 libcurl4-openssl-dev
$ curl https://swift.org/builds/swift-4.0-release/ubuntu1610/swift-4.0-RELEASE/swift-4.0-RELEASE-ubuntu16.10.tar.gz \
    | tar xz --directory / --strip-components=1

Build & Install SourceKitten

$ git clone https://github.com/jpsim/SourceKitten.git
$ cd SourceKitten
$ swift build -c release --static-swift-stdlib
$ mv .build/x86_64-unknown-linux/release/sourcekitten /usr/local/bin/

Clean up

$ cd ..
$ rm -rf SourceKitten

Install jazzy

$ apt-get install -y ruby-full make gcc libsqlite3-dev
$ gem install jazzy

Generate docs for a SwiftPM Package (e.g. Commander)

$ git clone https://github.com/kylef/Commander
$ cd Commander
$ git checkout 0.8.0
$ swift build
$ sourcekitten doc --spm-module Commander > Commander.json
Parsing ArgumentConvertible.swift (1/9)
Parsing ArgumentDescription.swift (2/9)
Parsing ArgumentParser.swift (3/9)
Parsing Command.swift (4/9)
Parsing CommandRunner.swift (5/9)
Parsing Commands.swift (6/9)
Parsing CommandType.swift (7/9)
Parsing Error.swift (8/9)
Parsing Group.swift (9/9)
$ jazzy \
  --clean \
  --sourcekitten-sourcefile Commander.json \
  --author "Kyle Fuller" \
  --author_url https://fuller.li \
  --github_url https://github.com/kylef/Commander \
  --github-file-prefix https://github.com/kylef/Commander/tree/0.8.0 \
  --module-version 0.8.0 \
  --module Commander
66% documentation coverage with 61 undocumented symbols
included 182 public or open symbols
skipped 13 private, fileprivate, or internal symbols (use `--min-acl` to specify a different minimum ACL)
building site
building search index
jam out ♪♫ to your fresh new docs in `docs`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment