Skip to content

Commit

Permalink
jazzy doc generation
Browse files Browse the repository at this point in the history
  • Loading branch information
watt committed Aug 29, 2020
1 parent db5fba1 commit 987e681
Show file tree
Hide file tree
Showing 5 changed files with 121 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@ gen/
xcuserdata/

# Cocoapods

Pods/
*.xcworkspace

# SPM
.swiftpm/

# jazzy
.docs/
73 changes: 73 additions & 0 deletions .jazzy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
module: Blueprint
title: Blueprint
github_url: https://github.com/square/Blueprint
skip_undocumented: false
output: .docs
theme: fullwidth
# TODO: to enable this, first rename docs whose names conflict with symbols
# documentation: Documentation/**/*.md
custom_categories:
# - name: Getting Started
# children:
# - HelloWorld
# - ElementHierarchy
# - CustomElements
# - Layout
# - name: Reference
# children:
# - Element
# - BlueprintView
# - ViewDescription
# - Transitions
# - name: Tutorials
# children:
# - Setup
# - Tutorial1
# - Tutorial2
- name: Creating Custom Elements
children:
- Element
- ProxyElement
- ElementContent
- ViewDescription
- LayoutTransition
- VisibilityTransition
- name: Displaying Elements
children:
- BlueprintView
- ElementPreview
- name: Common Elements
children:
- AccessibilityBlocker
- AccessibilityContainer
- AccessibilityElement
- AdaptedEnvironment
- EnvironmentReader
- Aligned
- AttributedLabel
- Box
- Button
- Centered
- Column
- ConstrainedAspectRatio
- ConstrainedSize
- Empty
- EqualStack
- GeometryReader
- Image
- Inset
- Label
- Overlay
- Row
- Rule
- ScrollView
- SegmentedControl
- Spacer
- Tappable
- TextField
- TransitionContainer
- name: Environment
children:
- Environment
- EnvironmentKey
custom_categories_unlisted_prefix: ''
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ source 'https://rubygems.org'

gem 'cocoapods', '~> 1.9'
gem 'cocoapods-generate', '~> 1.0'
gem 'jazzy', '~> 0.13'
20 changes: 20 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -64,18 +64,37 @@ GEM
httpclient (2.8.3)
i18n (0.9.5)
concurrent-ruby (~> 1.0)
jazzy (0.13.5)
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)
liferaft (0.0.6)
minitest (5.14.1)
molinillo (0.6.6)
mustache (1.1.1)
nanaimo (0.2.6)
nap (1.1.0)
netrc (0.11.0)
open4 (1.3.4)
redcarpet (3.5.0)
rouge (3.22.0)
ruby-macho (1.4.0)
sassc (2.4.0)
ffi (~> 1.9)
sqlite3 (1.4.2)
thread_safe (0.3.6)
typhoeus (1.4.0)
ethon (>= 0.9.0)
tzinfo (1.2.7)
thread_safe (~> 0.1)
xcinvoke (0.3.0)
liferaft (~> 0.0.6)
xcodeproj (1.16.0)
CFPropertyList (>= 2.3.3, < 4.0)
atomos (~> 0.1.3)
Expand All @@ -89,6 +108,7 @@ PLATFORMS
DEPENDENCIES
cocoapods (~> 1.9)
cocoapods-generate (~> 1.0)
jazzy (~> 0.13)

BUNDLED WITH
2.1.4
24 changes: 24 additions & 0 deletions generate_docs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash

set -euxo pipefail

# Find the sourcekitten binary embedded in jazzy
sourcekitten=`gem contents jazzy | grep 'bin/sourcekitten$' | head -1`

platform="iOS Simulator"
device=`instruments -s -devices | grep -oE 'iPhone.*?[^\(]+' | head -1 | awk '{$1=$1;print}'`
destination="platform=$platform,name=$device"

$sourcekitten doc \
--module-name BlueprintUI \
-- \
-scheme "BlueprintUI-Package" -destination "$destination" \
> BlueprintUI.json

$sourcekitten doc \
--module-name BlueprintUICommonControls \
-- \
-scheme "BlueprintUI-Package" -destination "$destination" \
> BlueprintUICommonControls.json

jazzy --sourcekitten-sourcefile BlueprintUI.json,BlueprintUICommonControls.json

0 comments on commit 987e681

Please sign in to comment.