Skip to content

Commit

Permalink
docs: document extenstions
Browse files Browse the repository at this point in the history
  • Loading branch information
rhwood committed Jul 2, 2023
1 parent baf3fba commit 74f3018
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ jobs:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: macos-12
# change to macos-latest once macos-13 becomes the latest
runs-on: macos-13
steps:
- name: Checkout 🛎️
uses: actions/checkout@v3
Expand All @@ -30,14 +31,15 @@ jobs:
export DOCC_JSON_PRETTYPRINT="YES"
swift package generate-documentation \
--target WMATAUI \
--include-extended-types \
--disable-indexing \
--transform-for-static-hosting \
--hosting-base-path WMATAUI.swift
- name: Upload artifact 📜
uses: actions/upload-pages-artifact@v1
with:
# Upload docs directory
path: .build/plugins/Swift-DocC/outputs/WMATAUI.docarchive
path: .build/plugins/Swift-DocC/outputs/WMATAUI.doccarchive
- name: Deploy to GitHub Pages 🐙
id: deployment
uses: actions/deploy-pages@v1
1 change: 1 addition & 0 deletions Sources/WMATAUI/WMATAUI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import SwiftUI
import WMATA

/// Static functions to create WMATA branded roundels.
public struct WMATAUI {

/// Get a color dot sized for the given text style.
Expand Down
4 changes: 3 additions & 1 deletion Sources/WMATAUI/WMATAUIFont.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,14 @@ public typealias WMATAUIFont = UIFont
#endif
import SwiftUI

/// Helper function to deal with fonts.
@available(macOS 11.0, *)
public extension WMATAUIFont.TextStyle {

// rule triggered by tvOS macro, so disabling
// swiftlint:disable cyclomatic_complexity
/// Convert a Font.TextStyle to a UIFont.TextStyle
/// Convert a Font.TextStyle to a NSFont.TextStyle (if using AppKit) or UIFont.TextStyle (if using UIKit))
/// Note that on tvOS, this converts Font.TextStyle.largeTitle the same as Font.TextStyle.title
static func with(textStyle: Font.TextStyle) -> WMATAUIFont.TextStyle {
let style: WMATAUIFont.TextStyle

Expand Down

0 comments on commit 74f3018

Please sign in to comment.