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

com.malliina.html.HtmlImplicits.scala Maven / Gradle / Ivy

There is a newer version: 6.9.4
Show newest version
package com.malliina.html

import com.malliina.http.FullUrl
import scalatags.Text.all.{Attr, AttrValue}
import scalatags.text.Builder

object HtmlImplicits extends HtmlImplicits

trait HtmlImplicits:
  given AttrValue[FullUrl] = attrType[FullUrl](_.url)

  def attrType[T](stringify: T => String): AttrValue[T] = (t: Builder, a: Attr, v: T) =>
    t.setAttr(a.name, Builder.GenericAttrValueSource(stringify(v)))




© 2015 - 2024 Weber Informatics LLC | Privacy Policy