Skip to content

Commit 3606fdb

Browse files
committed
Use mdoc:silent liberally in docs
1 parent 1213307 commit 3606fdb

1 file changed

Lines changed: 30 additions & 2 deletions

File tree

docs/index.md

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ import cats.effect.unsafe.implicits.global
3737

3838
Then some basic operations
3939

40-
```scala mdoc
40+
```scala mdoc:silent
4141
case class Bar(a: String, b: Int, c: Long)
4242

4343
// Creating keys are effects, but interacting with the vault
@@ -50,9 +50,13 @@ val basicLookup = for {
5050
.insert(key, Bar("", 1, 2L))
5151
.lookup(key)
5252
}
53+
```
5354

55+
```scala mdoc
5456
basicLookup.unsafeRunSync
57+
```
5558

59+
```scala mdoc:silent
5660
val lookupValuesOfDifferentTypes = for {
5761
key1 <- Key.newKey[IO, Bar]
5862
key2 <- Key.newKey[IO, String]
@@ -66,18 +70,26 @@ val lookupValuesOfDifferentTypes = for {
6670
(myvault.lookup(key1), myvault.lookup(key2), myvault.lookup(key3))
6771
.mapN((_,_,_))
6872
}
73+
```
6974

75+
```scala mdoc
7076
lookupValuesOfDifferentTypes.unsafeRunSync
77+
```
7178

79+
```scala mdoc:silent
7280
val emptyLookup = for {
7381
key <- Key.newKey[IO, Bar]
7482
} yield {
7583
Vault.empty
7684
.lookup(key)
7785
}
86+
```
7887

88+
```scala mdoc
7989
emptyLookup.unsafeRunSync
90+
```
8091

92+
```scala mdoc:silent
8193
val doubleInsertTakesMostRecent = for {
8294
key <- Key.newKey[IO, Bar]
8395
} yield {
@@ -86,9 +98,13 @@ val doubleInsertTakesMostRecent = for {
8698
.insert(key, Bar("Monkey", 7, 5L))
8799
.lookup(key)
88100
}
101+
```
89102

103+
```scala mdoc
90104
doubleInsertTakesMostRecent.unsafeRunSync
105+
```
91106

107+
```scala mdoc:silent
92108
val mergedVaultsTakesLatter = for {
93109
key <- Key.newKey[IO, Bar]
94110
} yield {
@@ -97,9 +113,13 @@ val mergedVaultsTakesLatter = for {
97113
Vault.empty.insert(key, Bar("Monkey", 7, 5L))
98114
).lookup(key)
99115
}
116+
```
100117

118+
```scala mdoc
101119
mergedVaultsTakesLatter.unsafeRunSync
120+
```
102121

122+
```scala mdoc:silent
103123
val deletedKeyIsMissing = for {
104124
key <- Key.newKey[IO, Bar]
105125
} yield {
@@ -108,30 +128,38 @@ val deletedKeyIsMissing = for {
108128
.delete(key)
109129
.lookup(key)
110130
}
131+
```
111132

133+
```scala mdoc
112134
deletedKeyIsMissing.unsafeRunSync
113135
```
114136

115137
We can also interact with a single value `locker` instead of the
116138
larger datastructure that a `vault` enables.
117139

118-
```scala mdoc
140+
```scala mdoc:silent
119141
val lockerExample = for {
120142
key <- Key.newKey[IO, Bar]
121143
} yield {
122144
Locker(key, Bar("", 1, 2L))
123145
.unlock(key)
124146
}
147+
```
125148

149+
```scala mdoc
126150
lockerExample.unsafeRunSync
151+
```
127152

153+
```scala mdoc:silent
128154
val wrongLockerExample = for {
129155
key <- Key.newKey[IO, Bar]
130156
key2 <- Key.newKey[IO, Bar]
131157
} yield {
132158
Locker(key, Bar("", 1, 2L))
133159
.unlock(key2)
134160
}
161+
```
135162

163+
```scala mdoc
136164
wrongLockerExample.unsafeRunSync
137165
```

0 commit comments

Comments
 (0)