diff --git a/.spi.yml b/.spi.yml new file mode 100644 index 0000000..c3decf3 --- /dev/null +++ b/.spi.yml @@ -0,0 +1,4 @@ +version: 1 +builder: + configs: + - documentation_targets: [Target] diff --git a/Package.swift b/Package.swift index 12db291..49e0130 100644 --- a/Package.swift +++ b/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:5.0 +// swift-tools-version:5.3 // The swift-tools-version declares the minimum version of Swift required to build this package. import PackageDescription @@ -14,7 +14,8 @@ let package = Package( targets: [ .target( name: "SwiftSummarize", - exclude: ["ExampleSwiftUI.swift"] + exclude: ["ExampleSwiftUI.swift"], + resources: [.process("Documentation.docc")] ), .testTarget( name: "SwiftSummarizeTests", diff --git a/Sources/SwiftSummarize/Documentation.docc/SwiftSummarize.md b/Sources/SwiftSummarize/Documentation.docc/SwiftSummarize.md new file mode 100644 index 0000000..65f18a5 --- /dev/null +++ b/Sources/SwiftSummarize/Documentation.docc/SwiftSummarize.md @@ -0,0 +1,23 @@ +# ``SwiftSummarize`` + +SwiftSummarize is the easiest way to create a summary from a String. Internally it's a simple wrapper around CoreServices [SKSummary](https://developer.apple.com/documentation/coreservices/1446229-sksummarycreatewithstring) + +## Overview + +**Before** +> Here's to the crazy ones. The misfits. The rebels. The troublemakers. The round pegs in the square holes. The ones who see things differently. They're not fond of rules. And they have no respect for the status quo. You can quote them, disagree with them, glorify or vilify them. About the only thing you can't do is ignore them. Because they change things. They push the human race forward. And while some may see them as the crazy ones, we see genius. Because the people who are crazy enough to think they can change the world, are the ones who do. + +**After** +> Because the people who are crazy enough to think they can change the world, are the ones who do + + +## Topics + +### Summary struct + +- ``Summary`` + +### String Extensions + +- ``summarize(numberOfSentences: Int)`` +- ``summarize(percent: CGFloat)``