diff --git a/akka-docs/src/main/paradox/stream/operators/index.md b/akka-docs/src/main/paradox/stream/operators/index.md index 79721ca8c6..d7a4e8b970 100644 --- a/akka-docs/src/main/paradox/stream/operators/index.md +++ b/akka-docs/src/main/paradox/stream/operators/index.md @@ -101,8 +101,8 @@ For example, following snippet will fall with timeout exception: ```scala ... .toMat(StreamConverters.asInputStream().mapMaterializedValue { inputStream => - inputStream.read() // this could block forever - ... + inputStream.read() // this could block forever + ... }).run() ``` @@ -514,6 +514,7 @@ For more background see the @ref[Error Handling in Streams](../stream-error.md) * [orElse](Source-or-Flow/orElse.md) * [Partition](Partition.md) * [prefixAndTail](Source-or-Flow/prefixAndTail.md) +* [preMaterialize](Source-or-Flow/preMaterialize.md) * [preMaterialize](Sink/preMaterialize.md) * [prepend](Source-or-Flow/prepend.md) * [prependLazy](Source-or-Flow/prependLazy.md) diff --git a/project/StreamOperatorsIndexGenerator.scala b/project/StreamOperatorsIndexGenerator.scala index dbe894c2b0..ae90f1ea50 100644 --- a/project/StreamOperatorsIndexGenerator.scala +++ b/project/StreamOperatorsIndexGenerator.scala @@ -248,9 +248,15 @@ object StreamOperatorsIndexGenerator extends AutoPlugin { s"There must be at least 5 lines in $file, including the title, description, category link and an empty line between each two of them") // This forces the short description to be on a single line. We could make this smarter, // but 'forcing' the short description to be really short seems nice as well. - val description = lines(2) - .replaceAll("ref:?\\[(.*?)\\]\\(", "ref[$1](" + file.getAbsolutePath.replaceFirst(".*/([^/]+/).*", "$1")) - require(!description.isEmpty, s"description in $file must be non-empty, single-line description at the 3rd line") + val separator = java.io.File.separatorChar + val path = + if (separator != '/') + file.getAbsolutePath.replace(separator, '/') + else + file.getAbsolutePath + val description = + lines(2).replaceAll("ref:?\\[(.*?)\\]\\(", "ref[$1](" + path.replaceFirst(".*/([^/]+/).*", "$1")) + require(description.nonEmpty, s"description in $file must be non-empty, single-line description at the 3rd line") val categoryLink = lines(4) require( categoryLink.startsWith("@ref"),