Skip to content

Commit

Permalink
[Docs] Build docs using jazzy
Browse files Browse the repository at this point in the history
* Add `.jazzy.yaml` configuration file
* Update `swiftlint generate-docs` to write docs to a directory rather
  than a single file
* Add jazzy to the Gemfile
* Run `bundle update`
* Add GitHub Actions workflow to run jazzy automatically and publish to
  GitHub Pages
  • Loading branch information
jpsim committed Jan 6, 2020
1 parent 805b9ab commit 146aec5
Show file tree
Hide file tree
Showing 16 changed files with 256 additions and 27,053 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/jazzy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Jazzy

on: [push, pull_request]

jobs:
Jazzy:
runs-on: ubuntu-latest
container:
image: norionomura/jazzy:0.13.0_swift-5.1.3
steps:
- uses: actions/checkout@v1
- name: Run swiftlint generate-docs
run: swift run swiftlint generate-docs
- name: Bundle install
run: bundle install --path vendor/bundle
- name: Run jazzy
run: bundle exec jazzy
- name: Upload Artifact
uses: actions/upload-artifact@v1
with:
name: API Docs
path: docs
- name: Push to gh-pages
if: github.event_name == 'push'
run: |
git config --global user.email "${GITHUB_ACTOR}"
git config --global user.name "${GITHUB_ACTOR}@users.noreply.github.com"
git clone "https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" out
cd out
git checkout gh-pages
git rm -rf .
cd ..
cp -a docs/. out/.
cd out
git add -A
git commit -m "Automated deployment to GitHub Pages: ${GITHUB_SHA}" --allow-empty
git push origin gh-pages
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ SwiftLintFramework.framework.zip
benchmark_*
portable_swiftlint.zip
osscheck/
docs/
rule_docs/

# Swift Package Manager
#
Expand Down
19 changes: 19 additions & 0 deletions .jazzy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
module: SwiftLintFramework
author: JP Simard
author_url: https://jpsim.com
root_url: https://jpsim.com/SwiftLint/
github_url: https://github.com/realm/SwiftLint
github_file_prefix: https://github.com/realm/SwiftLint/tree/master
swift_build_tool: spm
theme: fullwidth
clean: true
copyright: '© 2020 [JP Simard](https://jpsim.com) under MIT.'

documentation: rule_docs/*.md
# TODO: Upstream support for these settings
# hide_unlisted_documentation: true
# custom_categories_unlisted_prefix: ''
custom_categories:
- name: Rules
children:
- Rule Directory
3 changes: 2 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
source 'https://rubygems.org'

gem 'cocoapods', '~> 1.7.0'
gem 'cocoapods'
gem 'danger'
gem 'jazzy'
64 changes: 46 additions & 18 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,50 +1,55 @@
GEM
remote: https://rubygems.org/
specs:
CFPropertyList (3.0.0)
CFPropertyList (3.0.2)
activesupport (4.2.11.1)
i18n (~> 0.7)
minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
addressable (2.7.0)
public_suffix (>= 2.0.2, < 5.0)
algoliasearch (1.27.1)
httpclient (~> 2.8, >= 2.8.3)
json (>= 1.5.1)
atomos (0.1.3)
claide (1.0.3)
claide-plugins (0.9.2)
cork
nap
open4 (~> 1.3)
cocoapods (1.7.0)
cocoapods (1.8.4)
activesupport (>= 4.0.2, < 5)
claide (>= 1.0.2, < 2.0)
cocoapods-core (= 1.7.0)
cocoapods-core (= 1.8.4)
cocoapods-deintegrate (>= 1.0.3, < 2.0)
cocoapods-downloader (>= 1.2.2, < 2.0)
cocoapods-plugins (>= 1.0.0, < 2.0)
cocoapods-search (>= 1.0.0, < 2.0)
cocoapods-stats (>= 1.0.0, < 2.0)
cocoapods-trunk (>= 1.3.1, < 2.0)
cocoapods-trunk (>= 1.4.0, < 2.0)
cocoapods-try (>= 1.1.0, < 2.0)
colored2 (~> 3.1)
escape (~> 0.0.4)
fourflusher (>= 2.2.0, < 3.0)
fourflusher (>= 2.3.0, < 3.0)
gh_inspector (~> 1.0)
molinillo (~> 0.6.6)
nap (~> 1.0)
ruby-macho (~> 1.4)
xcodeproj (>= 1.8.2, < 2.0)
cocoapods-core (1.7.0)
xcodeproj (>= 1.11.1, < 2.0)
cocoapods-core (1.8.4)
activesupport (>= 4.0.2, < 6)
algoliasearch (~> 1.0)
concurrent-ruby (~> 1.1)
fuzzy_match (~> 2.0.4)
nap (~> 1.0)
cocoapods-deintegrate (1.0.4)
cocoapods-downloader (1.2.2)
cocoapods-downloader (1.3.0)
cocoapods-plugins (1.0.0)
nap
cocoapods-search (1.0.0)
cocoapods-stats (1.1.0)
cocoapods-trunk (1.3.1)
cocoapods-trunk (1.4.1)
nap (>= 0.8, < 2.0)
netrc (~> 0.11)
cocoapods-try (1.1.0)
Expand All @@ -66,41 +71,63 @@ GEM
octokit (~> 4.7)
terminal-table (~> 1)
escape (0.0.4)
faraday (0.17.0)
faraday (0.17.3)
multipart-post (>= 1.2, < 3)
faraday-http-cache (2.0.0)
faraday (~> 0.8)
fourflusher (2.2.0)
ffi (1.11.3)
fourflusher (2.3.1)
fuzzy_match (2.0.4)
gh_inspector (1.1.3)
git (1.5.0)
httpclient (2.8.3)
i18n (0.9.5)
concurrent-ruby (~> 1.0)
jazzy (0.13.0)
cocoapods (~> 1.5)
mustache (~> 1.1)
open4
redcarpet (~> 3.4)
rouge (>= 2.0.6, < 4.0)
sassc (~> 2.1)
sqlite3 (~> 1.3)
xcinvoke (~> 0.3.0)
json (2.3.0)
kramdown (2.1.0)
kramdown-parser-gfm (1.1.0)
kramdown (~> 2.0)
minitest (5.11.3)
liferaft (0.0.6)
minitest (5.13.0)
molinillo (0.6.6)
multipart-post (2.1.1)
mustache (1.1.1)
nanaimo (0.2.6)
nap (1.1.0)
netrc (0.11.0)
no_proxy_fix (0.1.2)
octokit (4.14.0)
octokit (4.15.0)
faraday (>= 0.9)
sawyer (~> 0.8.0, >= 0.5.3)
open4 (1.3.4)
public_suffix (4.0.1)
public_suffix (4.0.3)
redcarpet (3.5.0)
rouge (3.14.0)
ruby-macho (1.4.0)
sassc (2.2.1)
ffi (~> 1.9)
sawyer (0.8.2)
addressable (>= 2.3.5)
faraday (> 0.8, < 2.0)
sqlite3 (1.4.2)
terminal-table (1.8.0)
unicode-display_width (~> 1.1, >= 1.1.1)
thread_safe (0.3.6)
tzinfo (1.2.5)
tzinfo (1.2.6)
thread_safe (~> 0.1)
unicode-display_width (1.6.0)
xcodeproj (1.9.0)
xcinvoke (0.3.0)
liferaft (~> 0.0.6)
xcodeproj (1.14.0)
CFPropertyList (>= 2.3.3, < 4.0)
atomos (~> 0.1.3)
claide (>= 1.0.2, < 2.0)
Expand All @@ -111,8 +138,9 @@ PLATFORMS
ruby

DEPENDENCIES
cocoapods (~> 1.7.0)
cocoapods
danger
jazzy

BUNDLED WITH
2.0.1
2.0.2
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2015 Realm Inc.
Copyright (c) 2020 Realm Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,11 @@ publish:
pod trunk push SwiftLintFramework.podspec
pod trunk push SwiftLint.podspec

docs:
swift run swiftlint generate-docs
bundle install --path vendor/bundle
bundle exec jazzy

get_version:
@echo $(VERSION_STRING)

Expand Down
Loading

0 comments on commit 146aec5

Please sign in to comment.