Skip to content

Commit 0c090ed

Browse files
committed
Fixed knit warnings (unresolved refs) and guide typos
1 parent 1f74a2d commit 0c090ed

File tree

4 files changed

+24
-13
lines changed

4 files changed

+24
-13
lines changed

coroutines-guide.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1664,7 +1664,7 @@ The first four elements are added to the buffer and the sender suspends when try
16641664

16651665
Ticker channel is a special rendezvous channel that produces `Unit` every time given delay passes since last consumption from this channel.
16661666
Though it may seem to be useless standalone, it is a useful building block to create complex time-based [produce]
1667-
pipelines and operators that do windowing and other time-dependend processing.
1667+
pipelines and operators that do windowing and other time-dependent processing.
16681668
Ticker channel can be used in [select] to perform "on tick" action.
16691669

16701670
To create such channel use a factory method [ticker].
@@ -1716,7 +1716,7 @@ Next element is ready in 50ms after consumer pause in 150ms: kotlin.Unit
17161716
Note that [ticker] is aware of possible consumer pauses and, by default, adjusts next produced element
17171717
delay if a pause occurs, trying to maintain a fixed rate of produced elements.
17181718

1719-
Optionally, a `mode` parameters equal to [TickerMode.FIXED_DELAY] can be specified to maintain a fixed
1719+
Optionally, a `mode` parameter equal to [TickerMode.FIXED_DELAY] can be specified to maintain a fixed
17201720
delay between elements.
17211721

17221722
### Channels are fair
@@ -2499,6 +2499,7 @@ Channel was closed
24992499
[Channel()]: https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.experimental.channels/-channel.html
25002500
[ticker]: https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.experimental.channels/ticker.html
25012501
[ReceiveChannel.cancel]: https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.experimental.channels/-receive-channel/cancel.html
2502+
[TickerMode.FIXED_DELAY]: https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.experimental.channels/-ticker-mode/-f-i-x-e-d_-d-e-l-a-y.html
25022503
[actor]: https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.experimental.channels/actor.html
25032504
[ReceiveChannel.onReceive]: https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.experimental.channels/-receive-channel/on-receive.html
25042505
[ReceiveChannel.onReceiveOrNull]: https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.experimental.channels/-receive-channel/on-receive-or-null.html

integration/kotlinx-coroutines-jdk8/README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# Module kotlinx-coroutines-jdk8
22

3-
Integration with JDK8 [`CompletableFuture`][java.util.concurrent.CompletableFuture] (Android API level 24).
3+
Integration with JDK8 [CompletableFuture] (Android API level 24).
44

55
Coroutine builders:
66

7-
| **Name** | **Result** | **Scope** | **Description**
8-
| -------- | ---------- | ---------- | ---------------
9-
| [future] | [CompletableFuture][java.util.concurrent.CompletableFuture] | [CoroutineScope] | Returns a single value with the future result
7+
| **Name** | **Result** | **Scope** | **Description**
8+
| -------- | ------------------- | ---------------- | ---------------
9+
| [future] | [CompletableFuture] | [CoroutineScope] | Returns a single value with the future result
1010

1111
Extension functions:
1212

@@ -47,7 +47,9 @@ that makes it especially bad choice for coroutine-based Kotlin code.
4747

4848
# Package kotlinx.coroutines.experimental.future
4949

50-
Integration with JDK8 [`CompletableFuture`][java.util.concurrent.CompletableFuture] (Android API level 24).
50+
Integration with JDK8 [CompletableFuture] (Android API level 24).
51+
52+
[CompletableFuture]: https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/CompletableFuture.html
5153

5254
<!--- MODULE kotlinx-coroutines-core -->
5355
<!--- INDEX kotlinx.coroutines.experimental -->

knit/src/Knit.kt

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ const val LINES_START_UNORDERED_PREDICATE = "LINES_START_UNORDERED"
5252
const val LINES_START_PREDICATE = "LINES_START"
5353

5454
val API_REF_REGEX = Regex("(^|[ \\]])\\[([A-Za-z0-9_().]+)\\]($|[^\\[\\(])")
55+
val LINK_DEF_REGEX = Regex("^\\[([A-Za-z0-9_().]+)\\]: .*")
5556

5657
fun main(args: Array<String>) {
5758
if (args.isEmpty()) {
@@ -187,10 +188,16 @@ fun knit(markdownFileName: String): Boolean {
187188
tocLines += " ".repeat(i - 2) + "* [$name](#${makeSectionRef(name)})"
188189
continue@mainLoop
189190
}
190-
for (match in API_REF_REGEX.findAll(inLine)) {
191-
val apiRef = ApiRef(lineNumber, match.groups[2]!!.value)
192-
allApiRefs += apiRef
193-
remainingApiRefNames += apiRef.name
191+
val linkDefMatch = LINK_DEF_REGEX.matchEntire(inLine)
192+
if (linkDefMatch != null) {
193+
val name = linkDefMatch.groups[1]!!.value
194+
remainingApiRefNames -= name
195+
} else {
196+
for (match in API_REF_REGEX.findAll(inLine)) {
197+
val apiRef = ApiRef(lineNumber, match.groups[2]!!.value)
198+
allApiRefs += apiRef
199+
remainingApiRefNames += apiRef.name
200+
}
194201
}
195202
knitRegex?.find(inLine)?.let { knitMatch ->
196203
val fileName = knitMatch.groups[1]!!.value
@@ -409,7 +416,7 @@ data class ApiIndexKey(
409416

410417
val apiIndexCache: MutableMap<ApiIndexKey, Map<String, List<String>>> = HashMap()
411418

412-
val REF_LINE_REGEX = Regex("<a href=\"([a-z/.\\-]+)\">([a-zA-z.]+)</a>")
419+
val REF_LINE_REGEX = Regex("<a href=\"([a-z_/.\\-]+)\">([a-zA-z.]+)</a>")
413420
val INDEX_HTML = "/index.html"
414421
val INDEX_MD = "/index.md"
415422
val FUNCTIONS_SECTION_HEADER = "### Functions"

reactive/coroutines-guide-reactive.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ Finally
261261

262262
<!--- TEST -->
263263

264-
With an explicit `openSubscription` we should [cancel][SubscriptionReceiveChannel.cancel] the corresponding
264+
With an explicit `openSubscription` we should [cancel][ReceiveChannel.cancel] the corresponding
265265
subscription to unsubscribe from the source. There is no need to invoke `cancel` explicitly -- under the hood
266266
`consume` does that for us.
267267
The installed
@@ -1067,6 +1067,7 @@ coroutines for complex pipelines with fan-in and fan-out between multiple worker
10671067
[produce]: https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.experimental.channels/produce.html
10681068
[consumeEach]: https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.experimental.channels/consume-each.html
10691069
[ReceiveChannel]: https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.experimental.channels/-receive-channel/index.html
1070+
[ReceiveChannel.cancel]: https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.experimental.channels/-receive-channel/cancel.html
10701071
[SendChannel.send]: https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.experimental.channels/-send-channel/send.html
10711072
[BroadcastChannel]: https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.experimental.channels/-broadcast-channel/index.html
10721073
[ConflatedBroadcastChannel]: https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.experimental.channels/-conflated-broadcast-channel/index.html

0 commit comments

Comments
 (0)