Skip to content

Commit f092f10

Browse files
authored
docs: migrated Jazzy to SPM (#375)
1 parent 0765cbe commit f092f10

File tree

2 files changed

+80
-16
lines changed

2 files changed

+80
-16
lines changed

.github/workflows/documentation.yml

+19-3
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,14 @@ name: Documentation
33
on:
44
release:
55
types: [published]
6+
pull_request:
7+
branches:
8+
- main
69
workflow_dispatch:
710

811
jobs:
912
deploy_docs:
13+
name: Generate Documentation
1014
runs-on: macos-latest
1115
steps:
1216
- # Checkout the repository
@@ -17,9 +21,19 @@ jobs:
1721
with:
1822
bundler-cache: true
1923

20-
- # Generate Docs
21-
name: Generate Documentation
22-
run: bundle exec jazzy --config .jazzy.yaml
24+
- # Adapt the default title by adding the reference name from GitHub
25+
name: Patch Title
26+
run: |
27+
ESCAPED_REF_NAME=$(echo "${{ github.ref }}" | sed 's/[\/&]/\\&/g')
28+
sed -i.bak "s/title:\(.*\)/title:\1 ($ESCAPED_REF_NAME)/g" .jazzy.yaml
29+
30+
- # Generate Documentation
31+
name: Generate
32+
run: |
33+
SDK_PATH=`xcrun --sdk iphonesimulator --show-sdk-path`
34+
SDK_VERSION=`xcrun --sdk iphonesimulator --show-sdk-version`
35+
bundle exec jazzy \
36+
--build-tool-arguments "--sdk,${SDK_PATH},-Xswiftc,-sdk,-Xswiftc,$SDK_PATH,-Xswiftc,-target,-Xswiftc,arm64-apple-ios${SDK_VERSION}-simulator"
2337
2438
- # Small Jazzy fixes for GitHub Pages
2539
name: Fix Invalid URLs
@@ -29,6 +43,7 @@ jobs:
2943
3044
- # Commit newly generated docs
3145
name: Commit Documentation Files
46+
if: github.event_name != 'pull_request'
3247
run: |
3348
cd docs
3449
git init
@@ -40,6 +55,7 @@ jobs:
4055
- # Publish generated docs to the GitHub pages branch
4156
name: Push changes
4257
uses: ad-m/github-push-action@master
58+
if: github.event_name != 'pull_request'
4359
with:
4460
directory: docs
4561
github_token: ${{ secrets.GITHUB_TOKEN }}

.jazzy.yaml

+61-13
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,64 @@
1-
author: Philip Niedertscheider
2-
author_url: https://www.github.com/philprime
3-
github_url: https://www.github.com/techprimate/TPPDF
4-
root_url: https://techprimate.github.io/TPPDF/
1+
# Name of module being documented.
52
module: TPPDF
3+
# Folder to output the HTML docs to
64
output: docs
5+
6+
# Name of author to attribute in docs
7+
author: Philip Niedertscheider
8+
# Author URL of this project
9+
author_url: https://github.com/philprime
10+
# Copyright markdown rendered at the bottom of the docs pages
11+
copyright: "© 2024 [techprimate GmbH](https://techprimate.com). All rights reserved."
12+
# URL to link from the source host's logo.
13+
source_host_url: https://github.com/techprimate/TPPDF
14+
github_url: https://github.com/techprimate/TPPDF
15+
root_url: https://techprimate.github.io/TPPDF/
16+
17+
# Which theme to use. Specify either 'apple' (default), one of the other built-in theme names, or the
18+
# path to your mustache templates and other assets for a custom theme.
719
theme: fullwidth
8-
xcodebuild_arguments:
9-
[
10-
-workspace,
11-
"Examples.xcworkspace",
12-
-scheme,
13-
"Example iOS (SPM)",
14-
-sdk,
15-
"iphonesimulator",
16-
]
20+
# Title to display at the top of each page, overriding the default generated from module name and version.
21+
title: TPPDF
22+
23+
# The SDK for which your code should be built.
24+
sdk: iphonesimulator
25+
# Source file pathnames to be included in documentation. Supports wildcards.
26+
include: Source/**
27+
# Control whether Jazzy uses Swift Package Manager, xcodebuild, or swift-symbolgraph to build the module to be documented.
28+
# By default it uses xcodebuild if there is a .xcodeproj file in the source directory.
29+
swift_build_tool: spm
30+
31+
# Arguments to forward to xcodebuild, swift build, or sourcekitten.
32+
#
33+
# THESE ARE PROBABLY OUTDATED BUT ARE OVERWRITTEN IN THE CI
34+
#
35+
# You can find the SDK path using:
36+
#
37+
# xcrun --sdk iphonesimulator --show-sdk-path
38+
build_tool_arguments:
39+
- --sdk
40+
- /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk
41+
- -Xswiftc
42+
- -target
43+
- -Xswiftc
44+
- arm64-apple-ios17.4-simulator
45+
- -Xswiftc
46+
- -sdk
47+
- -Xswiftc
48+
- /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk
49+
50+
# The base URL on the source host of the project's files, to link from individual declarations.
51+
# For example https://github.com/realm/realm-cocoa/tree/v0.87.1
52+
# source_host_files_url: ''
53+
# minimum access control level to document
54+
min_acl: public
55+
# Don't document declarations that have no documentation comments.
56+
skip_undocumented: false
57+
# Default text for undocumented symbols. The default is "Undocumented", put "" if no text is required
58+
undocumented_text: Undocumented
59+
# Replace unsafe characters in filenames with an encoded representation.
60+
# This will reduce human readability of some URLs, but may be necessary for projects that
61+
# expose filename-unfriendly functions such as /(_:_:)
62+
use_safe_filenames: true
63+
# Create separate pages for all global declarations (classes, structures, enums etc.) even if they don't have children.
64+
separate_global_declarations: true

0 commit comments

Comments
 (0)