Skip to content

Commit

Permalink
Merge pull request #563 from iheartradio/javakky/use-markdown-generator
Browse files Browse the repository at this point in the history
fix: Use MarkdownGenerator
  • Loading branch information
Javakky-pxv authored Jun 5, 2023
2 parents 12a7379 + 3cac568 commit 68ff619
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ import com.github.takezoe.scaladoc.Scaladoc
import com.iheart.playSwagger.Domain.{CustomMappings, Definition, GenSwaggerParameter, SwaggerParameter}
import com.iheart.playSwagger.SwaggerParameterMapper.mapParam
import net.steppschuh.markdowngenerator.MarkdownElement
import net.steppschuh.markdowngenerator.link.Link
import net.steppschuh.markdowngenerator.table.Table
import net.steppschuh.markdowngenerator.text.Text
import net.steppschuh.markdowngenerator.text.code.CodeBlock
import net.steppschuh.markdowngenerator.text.code.{Code, CodeBlock}
import net.steppschuh.markdowngenerator.text.heading.Heading
import play.routes.compiler.Parameter

Expand Down Expand Up @@ -43,9 +44,9 @@ final case class DefinitionGenerator(
private def scalaDocToMarkdown: PartialFunction[iScaladoc.Term, MarkdownElement] = {
case value: iScaladoc.Text =>
new Text(value.parts.map {
case word: iScaladoc.Word => word.value
case link: iScaladoc.Link => s"[${link.anchor.mkString(" ")}](${link.ref})}"
case code: iScaladoc.CodeExpr => s"`${code.code}`"
case word: iScaladoc.Word => new Text(word.value)
case link: iScaladoc.Link => new Link(link.anchor.mkString(" "), link.ref)
case code: iScaladoc.CodeExpr => new Code(code.code)
}.mkString(" "))
case code: iScaladoc.CodeBlock => new CodeBlock(code, "scala")
case code: iScaladoc.MdCodeBlock =>
Expand Down

0 comments on commit 68ff619

Please sign in to comment.