Skip to content

Commit c1f504e

Browse files
committed
1. apply migration script
1 parent d8d6f8f commit c1f504e

16 files changed

+288
-295
lines changed

docs/cfg/buildprofiles.xml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
32
<buildprofiles>
4-
<variables>
5-
<enable-browser-edits>true</enable-browser-edits>
6-
<browser-edits-url>https://github.com/Kotlin/kotlinx.coroutines/edit/master/docs/</browser-edits-url>
7-
<allow-indexable-eaps>true</allow-indexable-eaps>
8-
</variables>
9-
<build-profile product="kc"/>
10-
</buildprofiles>
3+
<variables>
4+
<enable-browser-edits>true</enable-browser-edits>
5+
<browser-edits-url>https://github.com/Kotlin/kotlinx.coroutines/edit/master/docs/</browser-edits-url>
6+
<allow-indexable-eaps>true</allow-indexable-eaps>
7+
</variables>
8+
<build-profile instance="kc"/>
9+
</buildprofiles>

docs/kc.tree

Lines changed: 19 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,19 @@
1-
<?xml version="1.0" encoding="UTF-8"?>
2-
3-
<!DOCTYPE product-profile
4-
SYSTEM "https://resources.jetbrains.com/stardust/product-profile.dtd">
5-
6-
<product-profile id="kc"
7-
name="Kotlin coroutines"
8-
start-page="coroutines-guide.md">
9-
10-
<chunk include-id="coroutines">
11-
<toc-element id="coroutines-guide.md"/>
12-
<toc-element id="coroutines-basics.md" accepts-web-file-names="basics.html,coroutines-basic-jvm.html"/>
13-
<toc-element id="coroutines-and-channels.md"/>
14-
<toc-element id="cancellation-and-timeouts.md"/>
15-
<toc-element id="composing-suspending-functions.md"/>
16-
<toc-element id="coroutine-context-and-dispatchers.md"/>
17-
<toc-element id="flow.md"/>
18-
<toc-element id="channels.md"/>
19-
<toc-element id="exception-handling.md"/>
20-
<toc-element id="shared-mutable-state-and-concurrency.md"/>
21-
<toc-element id="select-expression.md"/>
22-
<toc-element id="debug-coroutines-with-idea.md"/>
23-
<toc-element id="debug-flow-with-idea.md"/>
24-
</chunk>
25-
</product-profile>
1+
<?xml version='1.0' encoding='utf-8'?>
2+
<!DOCTYPE instance-profile SYSTEM "https://resources.jetbrains.com/writerside/1.0/product-profile.dtd">
3+
<instance-profile id="kc" name="Kotlin coroutines" start-page="coroutines-guide.md">
4+
<snippet id="coroutines">
5+
<toc-element topic="coroutines-guide.md"/>
6+
<toc-element accepts-web-file-names="basics.html,coroutines-basic-jvm.html" topic="coroutines-basics.md"/>
7+
<toc-element topic="coroutines-and-channels.md"/>
8+
<toc-element topic="cancellation-and-timeouts.md"/>
9+
<toc-element topic="composing-suspending-functions.md"/>
10+
<toc-element topic="coroutine-context-and-dispatchers.md"/>
11+
<toc-element topic="flow.md"/>
12+
<toc-element topic="channels.md"/>
13+
<toc-element topic="exception-handling.md"/>
14+
<toc-element topic="shared-mutable-state-and-concurrency.md"/>
15+
<toc-element topic="select-expression.md"/>
16+
<toc-element topic="debug-coroutines-with-idea.md"/>
17+
<toc-element topic="debug-flow-with-idea.md"/>
18+
</snippet>
19+
</instance-profile>

docs/project.ihp

Lines changed: 0 additions & 14 deletions
This file was deleted.

docs/topics/cancellation-and-timeouts.md

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ fun main() = runBlocking {
3232
```
3333
{kotlin-runnable="true" kotlin-min-compiler-version="1.3"}
3434

35-
> You can get the full code [here](../../kotlinx-coroutines-core/jvm/test/guide/example-cancel-01.kt).
35+
> You can get the full code [here](https://github.com/Kotlin/kotlinx.coroutines/blob/master/kotlinx-coroutines-core/jvm/test/guide/example-cancel-01.kt).
3636
>
37-
{type="note"}
37+
{style="note"}
3838

3939
It produces the following output:
4040

@@ -86,9 +86,9 @@ fun main() = runBlocking {
8686
```
8787
{kotlin-runnable="true" kotlin-min-compiler-version="1.3"}
8888

89-
> You can get the full code [here](../../kotlinx-coroutines-core/jvm/test/guide/example-cancel-02.kt).
89+
> You can get the full code [here](https://github.com/Kotlin/kotlinx.coroutines/blob/master/kotlinx-coroutines-core/jvm/test/guide/example-cancel-02.kt).
9090
>
91-
{type="note"}
91+
{style="note"}
9292

9393
Run it to see that it continues to print "I'm sleeping" even after cancellation
9494
until the job completes by itself after five iterations.
@@ -131,9 +131,9 @@ fun main() = runBlocking {
131131
```
132132
{kotlin-runnable="true" kotlin-min-compiler-version="1.3"}
133133

134-
> You can get the full code [here](../../kotlinx-coroutines-core/jvm/test/guide/example-cancel-03.kt).
134+
> You can get the full code [here](https://github.com/Kotlin/kotlinx.coroutines/blob/master/kotlinx-coroutines-core/jvm/test/guide/example-cancel-03.kt).
135135
>
136-
{type="note"}
136+
{style="note"}
137137

138138
While catching `Exception` is an anti-pattern, this issue may surface in more subtle ways, like when using the
139139
[`runCatching`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/run-catching.html) function,
@@ -173,9 +173,9 @@ fun main() = runBlocking {
173173
```
174174
{kotlin-runnable="true" kotlin-min-compiler-version="1.3"}
175175

176-
> You can get the full code [here](../../kotlinx-coroutines-core/jvm/test/guide/example-cancel-04.kt).
176+
> You can get the full code [here](https://github.com/Kotlin/kotlinx.coroutines/blob/master/kotlinx-coroutines-core/jvm/test/guide/example-cancel-04.kt).
177177
>
178-
{type="note"}
178+
{style="note"}
179179

180180
As you can see, now this loop is cancelled. [isActive] is an extension property
181181
available inside the coroutine via the [CoroutineScope] object.
@@ -218,9 +218,9 @@ fun main() = runBlocking {
218218
```
219219
{kotlin-runnable="true" kotlin-min-compiler-version="1.3"}
220220

221-
> You can get the full code [here](../../kotlinx-coroutines-core/jvm/test/guide/example-cancel-05.kt).
221+
> You can get the full code [here](https://github.com/Kotlin/kotlinx.coroutines/blob/master/kotlinx-coroutines-core/jvm/test/guide/example-cancel-05.kt).
222222
>
223-
{type="note"}
223+
{style="note"}
224224

225225
Both [join][Job.join] and [cancelAndJoin] wait for all finalization actions to complete,
226226
so the example above produces the following output:
@@ -273,9 +273,9 @@ fun main() = runBlocking {
273273
```
274274
{kotlin-runnable="true" kotlin-min-compiler-version="1.3"}
275275

276-
> You can get the full code [here](../../kotlinx-coroutines-core/jvm/test/guide/example-cancel-06.kt).
276+
> You can get the full code [here](https://github.com/Kotlin/kotlinx.coroutines/blob/master/kotlinx-coroutines-core/jvm/test/guide/example-cancel-06.kt).
277277
>
278-
{type="note"}
278+
{style="note"}
279279

280280
<!--- TEST
281281
job: I'm sleeping 0 ...
@@ -311,9 +311,9 @@ fun main() = runBlocking {
311311
```
312312
{kotlin-runnable="true" kotlin-min-compiler-version="1.3"}
313313

314-
> You can get the full code [here](../../kotlinx-coroutines-core/jvm/test/guide/example-cancel-07.kt).
314+
> You can get the full code [here](https://github.com/Kotlin/kotlinx.coroutines/blob/master/kotlinx-coroutines-core/jvm/test/guide/example-cancel-07.kt).
315315
>
316-
{type="note"}
316+
{style="note"}
317317

318318
It produces the following output:
319319

@@ -354,9 +354,9 @@ fun main() = runBlocking {
354354
```
355355
{kotlin-runnable="true" kotlin-min-compiler-version="1.3"}
356356

357-
> You can get the full code [here](../../kotlinx-coroutines-core/jvm/test/guide/example-cancel-08.kt).
357+
> You can get the full code [here](https://github.com/Kotlin/kotlinx.coroutines/blob/master/kotlinx-coroutines-core/jvm/test/guide/example-cancel-08.kt).
358358
>
359-
{type="note"}
359+
{style="note"}
360360

361361
There is no longer an exception when running this code:
362362

@@ -415,9 +415,9 @@ fun main() {
415415
```
416416
{kotlin-runnable="true" kotlin-min-compiler-version="1.3"}
417417

418-
> You can get the full code [here](../../kotlinx-coroutines-core/jvm/test/guide/example-cancel-09.kt).
418+
> You can get the full code [here](https://github.com/Kotlin/kotlinx.coroutines/blob/master/kotlinx-coroutines-core/jvm/test/guide/example-cancel-09.kt).
419419
>
420-
{type="note"}
420+
{style="note"}
421421

422422
<!--- CLEAR -->
423423

@@ -428,7 +428,7 @@ of your machine. You may need to tweak the timeout in this example to actually s
428428
> since it always happens from the same thread, the one used by `runBlocking`.
429429
> More on that will be explained in the chapter on coroutine context.
430430
>
431-
{type="note"}
431+
{style="note"}
432432

433433
To work around this problem you can store a reference to the resource in a variable instead of returning it
434434
from the `withTimeout` block.
@@ -468,9 +468,9 @@ fun main() {
468468
```
469469
{kotlin-runnable="true" kotlin-min-compiler-version="1.3"}
470470

471-
> You can get the full code [here](../../kotlinx-coroutines-core/jvm/test/guide/example-cancel-10.kt).
471+
> You can get the full code [here](https://github.com/Kotlin/kotlinx.coroutines/blob/master/kotlinx-coroutines-core/jvm/test/guide/example-cancel-10.kt).
472472
>
473-
{type="note"}
473+
{style="note"}
474474

475475
This example always prints zero. Resources do not leak.
476476

docs/topics/channels.md

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ fun main() = runBlocking {
3131
```
3232
{kotlin-runnable="true" kotlin-min-compiler-version="1.3"}
3333

34-
> You can get the full code [here](../../kotlinx-coroutines-core/jvm/test/guide/example-channel-01.kt).
34+
> You can get the full code [here](https://github.com/Kotlin/kotlinx.coroutines/blob/master/kotlinx-coroutines-core/jvm/test/guide/example-channel-01.kt).
3535
>
36-
{type="note"}
36+
{style="note"}
3737

3838
The output of this code is:
3939

@@ -77,9 +77,9 @@ fun main() = runBlocking {
7777
```
7878
{kotlin-runnable="true" kotlin-min-compiler-version="1.3"}
7979

80-
> You can get the full code [here](../../kotlinx-coroutines-core/jvm/test/guide/example-channel-02.kt).
80+
> You can get the full code [here](https://github.com/Kotlin/kotlinx.coroutines/blob/master/kotlinx-coroutines-core/jvm/test/guide/example-channel-02.kt).
8181
>
82-
{type="note"}
82+
{style="note"}
8383

8484
<!--- TEST
8585
1
@@ -118,9 +118,9 @@ fun main() = runBlocking {
118118
```
119119
{kotlin-runnable="true" kotlin-min-compiler-version="1.3"}
120120

121-
> You can get the full code [here](../../kotlinx-coroutines-core/jvm/test/guide/example-channel-03.kt).
121+
> You can get the full code [here](https://github.com/Kotlin/kotlinx.coroutines/blob/master/kotlinx-coroutines-core/jvm/test/guide/example-channel-03.kt).
122122
>
123-
{type="note"}
123+
{style="note"}
124124

125125
<!--- TEST
126126
1
@@ -182,9 +182,9 @@ fun CoroutineScope.square(numbers: ReceiveChannel<Int>): ReceiveChannel<Int> = p
182182
```
183183
{kotlin-runnable="true" kotlin-min-compiler-version="1.3"}
184184

185-
> You can get the full code [here](../../kotlinx-coroutines-core/jvm/test/guide/example-channel-04.kt).
185+
> You can get the full code [here](https://github.com/Kotlin/kotlinx.coroutines/blob/master/kotlinx-coroutines-core/jvm/test/guide/example-channel-04.kt).
186186
>
187-
{type="note"}
187+
{style="note"}
188188

189189
<!--- TEST
190190
1
@@ -199,7 +199,7 @@ Done!
199199
> so that we can rely on [structured concurrency](composing-suspending-functions.md#structured-concurrency-with-async) to make
200200
> sure that we don't have lingering global coroutines in our application.
201201
>
202-
{type="note"}
202+
{style="note"}
203203

204204
## Prime numbers with pipeline
205205

@@ -266,9 +266,9 @@ fun CoroutineScope.filter(numbers: ReceiveChannel<Int>, prime: Int) = produce<In
266266
```
267267
{kotlin-runnable="true" kotlin-min-compiler-version="1.3"}
268268

269-
> You can get the full code [here](../../kotlinx-coroutines-core/jvm/test/guide/example-channel-05.kt).
269+
> You can get the full code [here](https://github.com/Kotlin/kotlinx.coroutines/blob/master/kotlinx-coroutines-core/jvm/test/guide/example-channel-05.kt).
270270
>
271-
{type="note"}
271+
{style="note"}
272272

273273
The output of this code is:
274274

@@ -360,9 +360,9 @@ fun CoroutineScope.launchProcessor(id: Int, channel: ReceiveChannel<Int>) = laun
360360
```
361361
{kotlin-runnable="true" kotlin-min-compiler-version="1.3"}
362362

363-
> You can get the full code [here](../../kotlinx-coroutines-core/jvm/test/guide/example-channel-06.kt).
363+
> You can get the full code [here](https://github.com/Kotlin/kotlinx.coroutines/blob/master/kotlinx-coroutines-core/jvm/test/guide/example-channel-06.kt).
364364
>
365-
{type="note"}
365+
{style="note"}
366366

367367
The output will be similar to the following one, albeit the processor ids that receive
368368
each specific integer may be different:
@@ -435,9 +435,9 @@ suspend fun sendString(channel: SendChannel<String>, s: String, time: Long) {
435435
```
436436
{kotlin-runnable="true" kotlin-min-compiler-version="1.3"}
437437

438-
> You can get the full code [here](../../kotlinx-coroutines-core/jvm/test/guide/example-channel-07.kt).
438+
> You can get the full code [here](https://github.com/Kotlin/kotlinx.coroutines/blob/master/kotlinx-coroutines-core/jvm/test/guide/example-channel-07.kt).
439439
>
440-
{type="note"}
440+
{style="note"}
441441

442442
The output is:
443443

@@ -485,9 +485,9 @@ fun main() = runBlocking<Unit> {
485485
```
486486
{kotlin-runnable="true" kotlin-min-compiler-version="1.3"}
487487

488-
> You can get the full code [here](../../kotlinx-coroutines-core/jvm/test/guide/example-channel-08.kt).
488+
> You can get the full code [here](https://github.com/Kotlin/kotlinx.coroutines/blob/master/kotlinx-coroutines-core/jvm/test/guide/example-channel-08.kt).
489489
>
490-
{type="note"}
490+
{style="note"}
491491

492492
It prints "sending" _five_ times using a buffered channel with capacity of _four_:
493493

@@ -538,9 +538,9 @@ suspend fun player(name: String, table: Channel<Ball>) {
538538
```
539539
{kotlin-runnable="true" kotlin-min-compiler-version="1.3"}
540540

541-
> You can get the full code [here](../../kotlinx-coroutines-core/jvm/test/guide/example-channel-09.kt).
541+
> You can get the full code [here](https://github.com/Kotlin/kotlinx.coroutines/blob/master/kotlinx-coroutines-core/jvm/test/guide/example-channel-09.kt).
542542
>
543-
{type="note"}
543+
{style="note"}
544544

545545
The "ping" coroutine is started first, so it is the first one to receive the ball. Even though "ping"
546546
coroutine immediately starts receiving the ball again after sending it back to the table, the ball gets
@@ -602,9 +602,9 @@ fun main() = runBlocking<Unit> {
602602
```
603603
{kotlin-runnable="true" kotlin-min-compiler-version="1.3"}
604604

605-
> You can get the full code [here](../../kotlinx-coroutines-core/jvm/test/guide/example-channel-10.kt).
605+
> You can get the full code [here](https://github.com/Kotlin/kotlinx.coroutines/blob/master/kotlinx-coroutines-core/jvm/test/guide/example-channel-10.kt).
606606
>
607-
{type="note"}
607+
{style="note"}
608608

609609
It prints following lines:
610610

0 commit comments

Comments
 (0)