Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    kevinwright
    @kevinwright
    I know it’ll be in central soon enough
    kevinwright
    @kevinwright
    That worked - I only needed the 2.13.0 JVM version anyhow
    Li Haoyi
    @lihaoyi
    I think I managed to get 0.7.0 out for scala 2.13
    might take some time to sync
    Bjørn Madsen
    @aeons
    thanks!
    Bjørn Madsen
    @aeons
    was 2.11 dropped on purpose, or did it just disappear in the switch to mill?
    Bjørn Madsen
    @aeons
    @lihaoyi
    Li Haoyi
    @lihaoyi
    dropped on purpose
    feel free to publish it yourself if you need it
    Li Haoyi
    @lihaoyi
    or use the last version
    Bjørn Madsen
    @aeons
    yeah, we just stay on 0.6.8 for 2.11
    Aaron Pritzlaff
    @aaronp
    Thought I'd just pop in, as my google-foo hasn't led me to find character entities. I'm sure there's an easy way to use e.g.  , ×, etc w/o having them rendered literally in e.g. span(" ")
    Anthony Cerruti
    @srnb_gitlab
    How easy would it be to adapt Scalatags for use in TTML?
    I would have to write val tt = tag("tt") and etc, right? As well as define my own attributes.
    nafg
    @nafg
    What's the reason for case class TypedTag[+Output <: String]
    Literal types don't make much sense here so what's <: String? Why the type parameter?
    nafg
    @nafg
    Is there a way to get the equivalent of the , in CSS selectors?
    Specifically, in a nested (cascading) selector
    nafg
    @nafg
    What about :not(...)
    etc.
    Lior Liviev
    @liorl00
    What is the alternative to nav tag in Scalatags ?
    nafg
    @nafg
    This message was deleted
    Paul Cleary
    @pauljamescleary
    is there a way with TypedTag to navigate the structure that comes out of the box with scalatags? For example html(head(body(div))) can I navigate somehow like "html / head / body / div" to pull the nested TypedTag?
    Li Haoyi
    @lihaoyi
    nope
    scalatags frags are designed to be write only
    you migjt be able to hack something together, but it’s not one of the use cases scalatags was meant to support
    Paul Cleary
    @pauljamescleary
    Thanks
    Robert Maxton
    @robertmaxton42
    So I know this isn't quite a Scalatags question, but did Scalafiddle withdraw support for Scalatags or vice versa at some point?
    anything that tries to import scalatags in Scalafiddle throws No suitable compiler
    Kirill A. Korinsky
    @catap

    Hey! I do have one question about scalatags: is it possibly to inject some real tag inside text string? For example I'd like to do:

    p("Some <b>bold</b> text")

    Right now it escape < and >, and at result I see string as I wrote it down.

    Li Haoyi
    @lihaoyi
    raw(...)
    Kirill A. Korinsky
    @catap
    Thanks!
    Kirill A. Korinsky
    @catap
    but any way to use modifier inside raw?
    Li Haoyi
    @lihaoyi
    build up a frag, call .render, put the string inside raw
    Kirill A. Korinsky
    @catap
    sad, very sad
    the code that I'm trying to hack looks like:
    case Success(text) =>
              val newHolder = document.createTextNode(text.string)
              t.replaceChild(
                newHolder,
                holder
              )
              holder = newHolder
    ah, it is just inner html
    good
    Grant
    @gavares
    I’m trying to write a Scala.js based Mithril equivilent allowing users to write using scalatags. In attempting to get a basic prototype working my first step was to attempt to bind to eventhandlers like onclick. My first thought was to define an implicit which inspects TypedTags for AttrPair instance that are onclick handlers and to simply try to wrap the provided handler with a function of my own that will invoke a redraw operation after the supplied function completes. I’m fairly certain this isnt a great approach and I’m wondering if anyone here has any suggestions.
    Marc Grue
    @marcgrue

    Switching from scalatags 0.8.3 to 0.8.4 (or higher) seems to conflict with the utest test method that shows "'Any' does not take parameters" (although it still compiles oddly enough). Could the culprit be that scalatags >= 0.8.4 has a dependency on ScalaJS 0.6.31 and not 0.6.32 (just guessing)?

    Here's a minimal test project where changing scalatags to 0.8.3 makes the error message go away: https://github.com/marcgrue/scalajs-shared-test-pure/blob/master/foo/src/test/scala/TestFoo.scala#L7

    Emmanuel Sarsah
    @small-petit_gitlab

    Hello, everyone. I just started web development with Scalajs and scalatags. I have this code:

    val e = html(
          head(
            script(src:= "./target/scala-2.13/sampleone-fastopt.js")
          ),
          body(
            h1("This is my title"),
            p("Hello")
          )
        )

    I want it rendered on my index.html page. I tried something like this, and it is not working. I have tried various methods to no avail. Please any help?? Thank you.

    dom.document.doctype.appendChild(e.render)
    scalway
    @scalway
    you have script with scalajs in this document then I assume you are rendering it on backend... I'm sure?
    If so HOW You want to edit dom object using scalajs code? Short answer in such case: e.render should be appended into body for example.
    Emmanuel Sarsah
    @small-petit_gitlab
    @scalway
    Yes I want to render it on backend.
    Your answer is well noted. Thanks for the assist.
    Sergey Torgashov
    @satorg

    Hey everyone,
    Is it possible for scalatags to create a stylesheet like:

    th, td { color: red; }

    I mean that comma combiner which applies style color: red to both th and td
    I cannot find it neither in the docs nor sources.

    Sergey Torgashov
    @satorg

    I managed to achieve this with my custom Selector extension method:

     implicit final class StylesheetSelectorOps(private val self: Selector) extends AnyVal {
        def |(that: Selector): Selector = new Selector(self.built ++ Seq(",") ++ that.built)
      }

    which allows to do something like the following:

    val myCls = cls (
      (th | td) (
        color := "red"
      )
    )

    but shouldn't such combiner exist in the library itself?

    @lihaoyi , WDYT? if you find it useful, I can file a PR which adds the comma combiner to the stylesheet Selector class.
    scalway
    @scalway
    @satorg Scalatags is not inteded to create css. It can style particular elements, but to create "<style>" tag better use https://github.com/japgolly/scalacss, use plain css or saass/less. You can also do something like that:
    //on server
    import scalatags.Text.all._
    import scalatags.Text.tags2.style
    println(style(""" th, td { color: red; } """).render) //<style> th, td { color: red; } </style>
    //or in scalajs
    import scalatags.JsDom.all._
    import scalatags.JsDom.tags2.style
    println(style(""" th, td { color: red; } """).render.outerHTML) //<style> th, td { color: red; } </style>
    Sergey Torgashov
    @satorg
    @scalway what is it for if not for creating css?
    http://www.lihaoyi.com/scalatags/#CSSStylesheets
    it basically works, btw, although misses some features which is quite easy to add