Skip to content

Commit d51c618

Browse files
committed
Adjust indent
1 parent 8897878 commit d51c618

19 files changed

+174
-252
lines changed

Sources/RichTextKit/Colors/ColorRepresentable.swift

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,13 @@
99
#if macOS
1010
import AppKit
1111

12-
/**
13-
This typealias bridges platform-specific colors to simplify
14-
multi-platform support.
15-
*/
12+
/// This typealias bridges platform-specific colors.
1613
public typealias ColorRepresentable = NSColor
1714
#endif
1815

1916
#if iOS || os(tvOS) || os(watchOS) || os(visionOS)
2017
import UIKit
2118

22-
/**
23-
This typealias bridges platform-specific colors to simplify
24-
multi-platform support.
25-
*/
19+
/// This typealias bridges platform-specific colors.
2620
public typealias ColorRepresentable = UIColor
2721
#endif

Sources/RichTextKit/Colors/RichTextColor+Picker.swift

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,26 +10,19 @@ import SwiftUI
1010

1111
public extension RichTextColor {
1212

13-
/**
14-
This picker can be used to select a rich text color.
15-
16-
This picker renders an icon next to the color picker as
17-
well as an optional list of quick colors.
18-
19-
The quick color list is empty by default. You can add a
20-
custom set of colors, for instance `.quickPickerColors`.
21-
*/
13+
/// This picker can be used to select a rich text color.
14+
///
15+
/// This picker renders an icon next to the color picker
16+
/// as well as an optional list of custom quick colors.
2217
struct Picker: View {
2318

24-
/**
25-
Create a rich text color picker that binds to a color.
26-
27-
- Parameters:
28-
- type: The type of color to pick.
29-
- icon: The icon to show, if any, by default the `type` icon.
30-
- value: The value to bind to.
31-
- quickColors: Colors to show in the trailing list, by default no colors.
32-
*/
19+
/// Create a rich text color picker.
20+
///
21+
/// - Parameters:
22+
/// - type: The type of color to pick.
23+
/// - icon: The icon to show, if any, by default the `type` icon.
24+
/// - value: The value to bind to.
25+
/// - quickColors: Colors to show in the trailing list, by default no colors.
3326
public init(
3427
type: RichTextColor,
3528
icon: Image? = nil,

Sources/RichTextKit/Colors/RichTextColor.swift

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,7 @@
88

99
import SwiftUI
1010

11-
/**
12-
This enum defines supported rich text color types.
13-
14-
The enum makes the colors identifiable and diffable.
15-
*/
11+
/// This enum defines supported rich text color types.
1612
public enum RichTextColor: String, CaseIterable, Codable, Equatable, Identifiable {
1713

1814
/// Foreground color.

Sources/RichTextKit/Commands/RichTextCommand+ActionButton.swift

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,17 @@ import SwiftUI
1010

1111
public extension RichTextCommand {
1212

13-
/**
14-
This button can trigger any ``RichTextAction`` from the
15-
main menu.
16-
17-
This view requires that a ``RichTextContext`` is set as
18-
a focused value, otherwise it will be disabled.
19-
*/
13+
/// This button can trigger ``RichTextAction``s from the
14+
/// main menu.
15+
///
16+
/// This view requires that a ``RichTextContext`` is set
17+
/// as a focused value, otherwise it will be disabled.
2018
struct ActionButton: View {
2119

22-
/**
23-
Create a command button.
24-
25-
- Parameters:
26-
- action: The action to trigger.
27-
*/
20+
/// Create a command button.
21+
///
22+
/// - Parameters:
23+
/// - action: The action to trigger.
2824
public init(
2925
action: RichTextAction
3026
) {

Sources/RichTextKit/Commands/RichTextCommand+ActionButtonGroup.swift

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,11 @@ import SwiftUI
1010

1111
public extension RichTextCommand {
1212

13-
/**
14-
This view can add list of ``RichTextAction`` buttons to
15-
the main menu.
16-
17-
This view requires that a ``RichTextContext`` is set as
18-
a focused value, otherwise it will be disabled.
19-
*/
13+
/// This view can add list of ``RichTextAction`` buttons
14+
/// to the main menu.
15+
///
16+
/// This view requires that a ``RichTextContext`` is set
17+
/// as a focused value, otherwise it will be disabled.
2018
struct ActionButtonGroup: View {
2119

2220
/**

Sources/RichTextKit/Commands/RichTextCommand+FormatMenu.swift

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,13 @@ import SwiftUI
1111

1212
public extension RichTextCommand {
1313

14-
/**
15-
This menu adds standard rich text format options to the
16-
main menu, using `CommandGroup`.
17-
18-
You can apply this to a `WindowGroup` or `DocumentGroup`
19-
to make it appear in the app's main menu.
20-
21-
This menu requires that a ``RichTextContext`` is set as
22-
a focused value, otherwise it will be disabled.
23-
*/
14+
/// This menu adds format options to the main menu.
15+
///
16+
/// You can add it to a `WindowGroup` or `DocumentGroup`,
17+
/// to make it appear in the app's main menu.
18+
///
19+
/// This view requires that a ``RichTextContext`` is set
20+
/// as a focused value, otherwise it will be disabled.
2421
struct FormatMenu: Commands {
2522

2623
/// Create a rich text format command menu.

Sources/RichTextKit/Commands/RichTextCommand+ShareMenu.swift

Lines changed: 18 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -11,32 +11,26 @@ import SwiftUI
1111

1212
public extension RichTextCommand {
1313

14-
/**
15-
This menu view can add a list of sharing options to the
16-
main menu.
17-
18-
The menu will try to add options for share, export, and
19-
print, if applicable to the current platform. Selecting
20-
an option will trigger a corresponding, provided action.
21-
22-
The macOS exclusive `nsSharing` commands require you to
23-
return a share url, after which a command takes care of
24-
the sharing. Also note that the `formatNSSharingAction`
25-
and `pdfNSSharingAction` will only have effect on macOS,
26-
where they add ``RichTextNSSharingMenu`` options.
27-
28-
Note that a pdf action menu will only be included if it
29-
has a corresponding action. Also note that you must use
30-
`isEnabled: false` to disable the menu, since you can't
31-
add `.disabled` to the command menu.
32-
33-
Setting actions to `nil` removes the related menu items.
34-
*/
14+
/// This menu adds share options to the main menu.
15+
///
16+
/// This menu will attempt to add menu options for share,
17+
/// export, and print, if applicable to the platform.
18+
///
19+
/// The macOS exclusive `nsSharing` commands require you
20+
/// to return a share url, after which the command takes
21+
/// care of the sharing. The `formatNSSharingAction` and
22+
/// `pdfNSSharingAction` only works on macOS, where they
23+
/// add ``RichTextNSSharingMenu`` options.
24+
///
25+
/// Note that a pdf action menu will only be included if
26+
/// it has an action. You must use `isEnabled: false` to
27+
/// disable the menu, since you can't add `.disabled` to
28+
/// the command menu.
29+
///
30+
/// Setting an action to `nil` removes the related menu.
3531
struct ShareMenu: Commands {
3632

37-
/**
38-
Create a rich text share command menu.
39-
*/
33+
/// Create a rich text share command menu.
4034
public init(
4135
isEnabled: Bool = true,
4236
shareFormats: [RichTextDataFormat],

Sources/RichTextKit/Commands/RichTextCommand.swift

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,9 @@
88

99
import Foundation
1010

11-
/**
12-
This type is used as a namespace for command-specific types,
13-
like command menus and buttons.
14-
15-
> Important: Most rich text commands require that there's a
16-
``RichTextContext`` set as a focused value.
17-
*/
11+
/// This is a namespace for command-specific types like menu
12+
/// and buttons commands.
13+
///
14+
/// > Important: The rich text-related commands require that
15+
/// there's a ``RichTextContext`` set as a focused value.
1816
public struct RichTextCommand {}

Sources/RichTextKit/Data/NSAttributedString+Init.swift

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,11 @@ import Foundation
1010

1111
public extension NSAttributedString {
1212

13-
/**
14-
Try to parse ``RichTextDataFormat`` formatted data.
15-
16-
- Parameters:
17-
- data: The data to initialize the string with.
18-
- format: The data format to use.
19-
*/
13+
/// Try to parse ``RichTextDataFormat`` formatted data.
14+
///
15+
/// - Parameters:
16+
/// - data: The data to initialize the string with.
17+
/// - format: The data format to use.
2018
convenience init(
2119
data: Data,
2220
format: RichTextDataFormat

Sources/RichTextKit/Data/RichTextDataError.swift

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@
88

99
import Foundation
1010

11-
/**
12-
This enum represents rich text data-related errors.
13-
*/
11+
/// This enum represents rich text data-related errors.
1412
public enum RichTextDataError: Error {
1513

1614
case invalidArchivedData(in: Data)

Sources/RichTextKit/Data/RichTextDataFormat+Menu.swift

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,13 @@ import SwiftUI
1111

1212
public extension RichTextDataFormat {
1313

14-
/**
15-
This menu can be used to trigger custom actions for any
16-
list of ``RichTextDataFormat`` values.
17-
18-
The menu uses customizable actions, which means that it
19-
can be used in toolbars, menu bar commands etc. It also
20-
has an optional `pdf` action, which for instance can be
21-
used when exporting or sharing rich text.
22-
*/
14+
/// This menu can be used to trigger a custom action for
15+
/// any list of ``RichTextDataFormat`` values.
16+
///
17+
/// The menu uses customizable actions, which means that
18+
/// it can be used in toolbars, menubar commands etc. It
19+
/// also has an optional `pdf` action, which can be used
20+
/// when exporting or sharing rich text.
2321
struct Menu: View {
2422

2523
public init(

Sources/RichTextKit/Data/RichTextDataFormat.swift

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,25 +9,22 @@
99
import Foundation
1010
import UniformTypeIdentifiers
1111

12-
/**
13-
This enum specifies rich text data formats.
14-
15-
Different formats have different capabilities. For instance,
16-
``rtf`` supports rich text, styles, etc., while ``plainText``
17-
only handles text. ``archivedData`` can archive text, image
18-
data and attachments in binary archives. This is convenient
19-
when only targeting Apple platforms, but restricts how data
20-
can be used elsewhere.
21-
22-
``archivedData`` uses an `rtk` file extension, as well as a
23-
`UTType.archivedData` uniform type. You can create a custom
24-
``vendorArchivedData(id:fileExtension:fileFormatText:uniformType:)``
25-
value to specify a custom data format.
26-
27-
Remember to configure your app for handling the UTTypes you
28-
want to support, as well as the file extensions you want to
29-
open with the app. Take a look at the demo app for examples.
30-
*/
12+
/// This enum specifies rich text data formats.
13+
///
14+
/// For instance, ``rtf`` supports styles, colors etc. while
15+
/// ``plainText`` only handles text. ``archivedData`` can be
16+
/// used to archive texts, images and various attachments in
17+
/// binary archives. This is convenient when targeting Apple
18+
/// platforms, but restricts how data can be used elsewhere.
19+
///
20+
/// ``archivedData`` uses an `rtk` file extension as well as
21+
/// a `UTType.archivedData` uniform type. You can define any
22+
/// custom ``vendorArchivedData(id:fileExtension:fileFormatText:uniformType:)``
23+
/// value to specify a custom data format.
24+
///
25+
/// Remember to configure your app to handle the UTTypes you
26+
/// want to support, as well as the file extensions you want
27+
/// to open with it. Check out the demo app for examples.
3128
public enum RichTextDataFormat: Equatable, Identifiable {
3229

3330
/// Archived data that's persisted with a keyed archiver.

Sources/RichTextKit/Data/RichTextDataReader.swift

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,21 @@
88

99
import Foundation
1010

11-
/**
12-
This protocol extends ``RichTextReader`` with functionality
13-
for reading rich text data for the current rich text.
14-
15-
The protocol is implemented by `NSAttributedString` as well
16-
as other types in the library.
17-
*/
11+
/// This protocol extends the ``RichTextReader`` protocol to
12+
/// support reading rich text data for the current rich text.
13+
///
14+
/// This protocol is implemented by `NSAttributedString` and
15+
/// other types in the library.
1816
public protocol RichTextDataReader: RichTextReader {}
1917

2018
extension NSAttributedString: RichTextDataReader {}
2119

2220
public extension RichTextDataReader {
2321

24-
/**
25-
Generate rich text data from the current rich text.
26-
27-
- Parameters:
28-
- format: The data format to use.
29-
*/
22+
/// Generate rich text data from the current rich text.
23+
///
24+
/// - Parameters:
25+
/// - format: The data format to use.
3026
func richTextData(
3127
for format: RichTextDataFormat
3228
) throws -> Data {

Sources/RichTextKit/Export/RichTextExportError.swift

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,8 @@
88

99
import Foundation
1010

11-
/**
12-
This enum defines errors that can be thrown when failing to
13-
export rich text.
14-
*/
11+
/// This enum defines errors that can be thrown when failing
12+
/// to export rich text.
1513
public enum RichTextExportError: Error {
1614

1715
/// This error occurs when no file could be generated at a certain url.

Sources/RichTextKit/Export/RichTextExportMenu.swift

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,8 @@
99
#if iOS || macOS || os(visionOS)
1010
import SwiftUI
1111

12-
/**
13-
This menu can be used to trigger various export actions for
14-
a list of ``RichTextDataFormat`` values.
15-
16-
This menu uses a ``RichTextDataFormat/Menu`` configured for
17-
exporting, with customizable actions and data formats.
18-
*/
12+
/// This menu can be used to call various export actions for
13+
/// a list of ``RichTextDataFormat`` values.
1914
public struct RichTextExportMenu: View {
2015

2116
public init(

0 commit comments

Comments
 (0)