Skip to content

Commit

Permalink
Referenced examples in stdlib documentation page
Browse files Browse the repository at this point in the history
  • Loading branch information
hnaderi committed Feb 18, 2023
1 parent 9357277 commit 96d51d1
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 10 deletions.
6 changes: 4 additions & 2 deletions docs/standard-library.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ def worker(con: Connection[IO]) = con.channel
)
```

see @:source(example.WorkPool) for a complete working example

## RPCChannel

@:api(lepus.std.RPCChannel) implements an async RPC communication channel topology.
Expand Down Expand Up @@ -128,10 +130,10 @@ def consumer2(con: Connection[IO]) = for {
evt <- bus.events
_ <- eval(IO.println(s"consumer 2: $evt"))
} yield ()


```

see @:source(example.PubSub) for a complete working example

## Helpers

### ShortString constructors
Expand Down
2 changes: 0 additions & 2 deletions example/src/main/scala/Main.scala
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
* limitations under the License.
*/

package com.example

import cats.effect.IO
import cats.effect.IOApp
import com.comcast.ip4s.*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package com.example
package example

import cats.effect.*
import cats.syntax.all.*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package com.example
package example

import cats.effect.*
import cats.syntax.all.*
Expand Down
17 changes: 13 additions & 4 deletions project/LepusSitePlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import laika.config.LaikaKeys
import laika.helium.Helium
import laika.helium.config._
import laika.rewrite.link.ApiLinks
import laika.rewrite.link.SourceLinks
import laika.rewrite.link.LinkConfig
import laika.theme._
import laika.theme.config.Color
Expand Down Expand Up @@ -119,11 +120,19 @@ object LepusSitePlugin extends AutoPlugin {
.disabled

},
laikaConfig := LaikaConfig.defaults.withConfigValue(
LinkConfig(apiLinks =
tlSiteApiUrl.value.toSeq.map(_.toString()).map(ApiLinks(_, "lepus"))
laikaConfig := {
val apiDoc = tlSiteApiUrl.value.toSeq.map(_.toString())
val repo = scmInfo.value.toSeq
.map(_.browseUrl.toString())
.map(url => s"$url/tree/main/example/src/main/scala/")

LaikaConfig.defaults.withConfigValue(
LinkConfig(
apiLinks = apiDoc.map(ApiLinks(_, "lepus")),
sourceLinks = repo.map(SourceLinks(_, "scala"))
)
)
),
},
laikaIncludeAPI := true
)
}

0 comments on commit 96d51d1

Please sign in to comment.