Skip to content

Commit 7ce415e

Browse files
committed
Adjust documentation
1 parent d9d7869 commit 7ce415e

10 files changed

+20
-27
lines changed

Sources/RichTextKit/Attributes/RichTextAttributeReader.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import Foundation
1010

1111
/**
1212
This protocol extends ``RichTextReader`` with functionality
13-
for reading attributes from the current ``richText``.
13+
for reading attributes from the ``RichTextReader/richText``.
1414

1515
The protocol is implemented by `NSAttributedString` as well
1616
as other types in the library.

Sources/RichTextKit/Attributes/RichTextAttributeWriter.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import Foundation
1010

1111
/**
1212
This protocol extends ``RichTextWriter`` with functionality
13-
for writing attributes to the current ``richText``.
13+
for writing attributes to the ``RichTextWriter/richText`.
1414

1515
This protocol is implemented by `NSMutableAttributedString`
1616
as well as other types in the library.

Sources/RichTextKit/Commands/RichTextCommandsFontSizeOptionsGroup.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ public struct RichTextCommandsFontSizeOptionsGroup: View {
2121
public var body: some View {
2222
RichTextCommandButtonGroup(
2323
actions: [
24-
.increaseFontSize,
25-
.decreaseFontSize
24+
.increaseFontSize(),
25+
.decreaseFontSize()
2626
]
2727
)
2828
}

Sources/RichTextKit/Commands/RichTextCommandsIndentOptionsGroup.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ public struct RichTextCommandsIndentOptionsGroup: View {
1919
public var body: some View {
2020
RichTextCommandButtonGroup(
2121
actions: [
22-
.increaseIndent,
23-
.decreaseIndent
22+
.increaseIndent(),
23+
.decreaseIndent()
2424
]
2525
)
2626
}

Sources/RichTextKit/Component/RichTextViewComponent+Styles.swift

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,7 @@ public extension RichTextViewComponent {
2020
return styles
2121
}
2222

23-
/**
24-
Set the current value of a certain rich text style.
25-
26-
> Note: When adding logic to the function, make sure to
27-
also adjust ``setRichTextStyle(_:to:at:)``.
28-
*/
23+
/// Set the current value of a certain rich text style.
2924
func setRichTextStyle(
3025
_ style: RichTextStyle,
3126
to newValue: Bool

Sources/RichTextKit/Data/UTType+RichText.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public extension UTType {
1919
.data
2020
]
2121

22-
/// The uniform type for ``RichTextFormat/archivedData``.
22+
/// The uniform type for ``RichTextDataFormat/archivedData``.
2323
static let archivedData = UTType(
2424
exportedAs: "com.richtextkit.archiveddata")
2525
}

Sources/RichTextKit/Fonts/RichTextFontSizePickerStack.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,15 +71,15 @@ private extension RichTextFontSizePickerStack {
7171

7272
var decreaseButton: some View {
7373
RichTextActionButton(
74-
action: .decreaseFontSize,
74+
action: .decreaseFontSize(),
7575
context: context,
7676
fillVertically: true
7777
)
7878
}
7979

8080
var increaseButton: some View {
8181
RichTextActionButton(
82-
action: .increaseFontSize,
82+
action: .increaseFontSize(),
8383
context: context,
8484
fillVertically: true
8585
)

Sources/RichTextKit/Format/RichTextFormatSheet.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ private extension RichTextFormatSheet {
127127
var indentButtons: some View {
128128
RichTextActionButtonGroup(
129129
context: context,
130-
actions: [.decreaseIndent, .increaseIndent],
130+
actions: [.decreaseIndent(), .increaseIndent()],
131131
greedy: false
132132
)
133133
}

Sources/RichTextKit/Format/RichTextFormatSidebar.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public struct RichTextFormatSidebar: View {
5858
.pickerStyle(.segmented)
5959
RichTextActionButtonGroup(
6060
context: context,
61-
actions: [.decreaseIndent, .increaseIndent]
61+
actions: [.decreaseIndent(), .increaseIndent()]
6262
)
6363
}
6464

Sources/RichTextKit/RichTextEditor.swift

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,13 @@ import SwiftUI
1414

1515
The view uses a platform-specific ``RichTextView`` together
1616
with a ``RichTextContext`` and a ``RichTextCoordinator`` to
17-
make view and context changes sync correctly. You will then
18-
be able to use the `richTextContext` to trigger and observe
19-
changes to the text editor.
20-
21-
Note that changing the value of the `text` binding from the
22-
outside will not (yet) update the editor. Until it is fixed,
23-
use ``RichTextContext/setAttributedString(to:)`` to set the
24-
string to another value.
17+
make view and context changes sync correctly.
18+
19+
You can use the provided context to trigger and observe any
20+
changes to the text editor. Note that changing the value of
21+
the `text` binding will not (yet) update this editor. Until
22+
it is fixed, use `setAttributedString(to:)` to set the rich
23+
text or plain string to another value.
2524

2625
Since the view wraps a native `UIKit` or `AppKit` text view,
2726
you can't apply `.toolbar` modifiers to it, like you can do
@@ -41,8 +40,7 @@ import SwiftUI
4140

4241
You may have noticed that `updateUIView/updateNSView` don't
4342
contain any code. This is because having updates there will
44-
update this view, which in turn makes typing very slow. Use
45-
the rich text context to modify the text instead.
43+
update this view, which in turn makes typing very slow.
4644
*/
4745
public struct RichTextEditor: ViewRepresentable {
4846

0 commit comments

Comments
 (0)