All Downloads are FREE. Search and download functionalities are using the official Maven repository.

dotty.tools.scaladoc.QuickLink.scala Maven / Gradle / Ivy

There is a newer version: 3.6.0-RC1-bin-20240917-6e852d2-NIGHTLY
Show newest version
package dotty.tools.scaladoc

case class QuickLink(text: String, url: String)

object QuickLink:
  lazy val delimiter = "::"
  def usage: String =
    """List of quick links that is displayed in the header of documentation.
      |The setting accepts list of quick links in format: text::url
      |The first `::` occurrence is taken as the delimiter.""".stripMargin
  def parse(s: String): Either[String, QuickLink] =
    s.split(delimiter, 2).toList match
      case text :: url :: Nil => Right(QuickLink(text, url))
      case _ => Left(s"""Invalid syntax of quick link.
                    |$usage""".stripMargin)




© 2015 - 2024 Weber Informatics LLC | Privacy Policy