Skip to content

Commit 4ed7afe

Browse files
authored
Merge pull request #16 from davdroman/update-docs
Update README
2 parents 813a651 + 734b648 commit 4ed7afe

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ TextBuilder leverages the power of Swift [Result Builders](https://github.com/ap
1414

1515
TextBuilder offers 3 ready-made builders out of the box, depending on which text separator you need.
1616

17-
### Unspaced Text
17+
### Default (unspaced)
1818

1919
```swift
20-
@BasicTextBuilder
20+
@TextBuilder
2121
var loremIpsum: Text {
2222
Text("Lorem").underline().foregroundColor(.blue)
2323
Text("ipsum dolor")
@@ -28,10 +28,10 @@ var loremIpsum: Text {
2828

2929
![](https://github.com/davdroman/TextBuilder/blob/bd991543b123eebf60417b8567f68064655a9151/Tests/TextBuilderTests/__Snapshots__/TextBuilderTests/testBasicTextBuilder.iOS.png?raw=true)
3030

31-
### Spaced Text
31+
### With Spaces
3232

3333
```swift
34-
@SpacedTextBuilder
34+
@TextBuilderWithSpaces
3535
var loremIpsum: Text {
3636
Text("Lorem").underline().foregroundColor(.blue)
3737
Text("ipsum dolor")
@@ -42,10 +42,10 @@ var loremIpsum: Text {
4242

4343
![](https://github.com/davdroman/TextBuilder/blob/bd991543b123eebf60417b8567f68064655a9151/Tests/TextBuilderTests/__Snapshots__/TextBuilderTests/testSpacedTextBuilder.iOS.png?raw=true)
4444

45-
### Multiline Text
45+
### Multiline
4646

4747
```swift
48-
@MultilineTextBuilder
48+
@TextBuilderWithNewlines
4949
var loremIpsum: Text {
5050
Text("Lorem").underline().foregroundColor(.blue)
5151
Text("ipsum dolor")
@@ -61,7 +61,7 @@ var loremIpsum: Text {
6161
TextBuilder accepts `String` types directly as if they were plain `Text`, and also provides a `String.text` computed var to remove unwanted code noise when `Text` is explicitly needed.
6262

6363
```swift
64-
@MultilineTextBuilder
64+
@TextBuilderWithNewlines
6565
var loremIpsum: Text {
6666
"Lorem".text.underline().foregroundColor(.blue)
6767
"ipsum dolor"
@@ -91,10 +91,10 @@ But if you prefer to keep using a result builder, you can:
9191

9292
```swift
9393
struct EggplantSeparator: TextBuilderSeparator {
94-
static var separator: String { " 🍆 " }
94+
static var separator: String? { " 🍆 " }
9595
}
9696

97-
@TextBuilder<EggplantSeparator>
97+
@TextBuilderWith<EggplantSeparator>
9898
var loremIpsum: Text {
9999
"Lorem".text.underline().foregroundColor(.blue)
100100
"ipsum dolor"
@@ -116,6 +116,6 @@ $ swift run -c release Benchmarks
116116
117117
name time std iterations
118118
------------------------------------------------
119-
Result Builder 1667.000 ns ± 34.69 % 796036
120-
Initializer 2333.000 ns ± 25.30 % 585724
119+
Result Builder 1875.000 ns ± 26.15 % 729940
120+
Initializer 2542.000 ns ± 16.88 % 540826
121121
```

0 commit comments

Comments
 (0)