Skip to content

Commit 6883e3e

Browse files
authored
Specify code listings are in Swift (#84)
Did a quick check, and it looks like these were the only code listings missing their syntax highlighting. Before: ``` % cmark --to xml **.md | grep --only-matching '<code_block[^>]*>' | sort -u <code_block info="swift" xml:space="preserve"> <code_block xml:space="preserve"> ``` After: ``` % cmark --to xml **.md | grep --only-matching '<code_block[^>]*>' | sort -u <code_block info="swift" xml:space="preserve"> ``` Fixes rdar://103217537
2 parents 92daf28 + ec3f5f1 commit 6883e3e

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

Sources/TSPL/TSPL.docc/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<key>CFBundleIdentifier</key>
1010
<string>org.swift.tspl</string>
1111
<key>CDDefaultCodeListingLanguage</key>
12-
<string>markdown</string>
12+
<string>swift</string>
1313
<key>CFBundleDevelopmentRegion</key>
1414
<string>en</string>
1515
<key>CFBundleIconFile</key>

Sources/TSPL/TSPL.docc/LanguageGuide/Concurrency.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,7 @@ the explicit parent-child relationships between tasks
557557
let Swift handle some behaviors like propagating cancellation for you,
558558
and lets Swift detect some errors at compile time.
559559

560-
```
560+
```swift
561561
await withTaskGroup(of: Data.self) { taskGroup in
562562
let photoNames = await listPhotos(inGallery: "Summer Vacation")
563563
for name in photoNames {
@@ -706,7 +706,7 @@ call the [`Task.detached(priority:operation:)`](https://developer.apple.com/docu
706706
Both of these operations return a task that you can interact with ---
707707
for example, to wait for its result or to cancel it.
708708

709-
```
709+
```swift
710710
let newPhoto = // ... some photo data ...
711711
let handle = Task {
712712
return await add(newPhoto, toGalleryNamed: "Spring Adventures")
@@ -840,7 +840,7 @@ When you access a property or method of an actor,
840840
you use `await` to mark the potential suspension point.
841841
For example:
842842

843-
```
843+
```swift
844844
let logger = TemperatureLogger(label: "Outdoors", measurement: 25)
845845
print(await logger.max)
846846
// Prints "25"
@@ -858,7 +858,7 @@ when accessing the actor's properties.
858858
For example,
859859
here's a method that updates a `TemperatureLogger` with a new temperature:
860860

861-
```
861+
```swift
862862
extension TemperatureLogger {
863863
func update(with measurement: Int) {
864864
measurements.append(measurement)
@@ -906,7 +906,7 @@ like you would with an instance of a class,
906906
you'll get a compile-time error.
907907
For example:
908908

909-
```
909+
```swift
910910
print(logger.max) // Error
911911
```
912912

0 commit comments

Comments
 (0)