Instantly share code, notes, and snippets.

@jpsim /README.md
Last active Jan 18, 2018

Embed
What would you like to do?
Generate Swift docs on Linux with Jazzy and SourceKitten

Here are Commandant's docs built on Linux with Jazzy and SourceKitten: https://static.realm.io/jazzy_demo/Commandant

The rough steps are:

  1. Have libsourcekitdInProc.so and Swift 3 available.
  2. Install the jazzy ruby gem.
  3. Build SourceKitten.
  4. Build Swift Package Manager module.
  5. Generate JSON docs for SwiftPM module using SourceKitten.
  6. Generate HTML docs using jazzy and JSON from step 5.
$ docker run -it norionomura/sourcekit:301 bash
> $ apt-get update && apt-get install -y git ruby2.0 ruby2.0-dev make gcc libsqlite3-dev
> $ gem2.0 install jazzy
> $ git clone https://github.com/jpsim/SourceKitten.git
> $ cd SourceKitten
> $ swift build
> $ .build/debug/sourcekitten doc --spm-module Commandant > commandant.json
> $ jazzy -s commandant.json --readme Packages/Commandant-0.11.3/README.md --author Carthage --github_url https://github.com/Carthage/Commandant --github-file-prefix https://github.com/Carthage/Commandant/tree/0.11.3 --module-version 0.11.3 --module Commandant --root-url https://static.realm.io/jazzy_demo/Commandant/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment