Scalatex icon indicating copy to clipboard operation
Scalatex copied to clipboard

Example creates Hello in a scalatex package

Open dwalend opened this issue 9 years ago • 2 comments

I'm not sure if this is intentional or not, but the example instructions at http://lihaoyi.github.io/Scalatex/ put the Hello classes in a scalatex package. Is that intentional?

scala> Hello().render :8: error: not found: value Hello Hello().render ^ scala> scalatex.Hello().render res1: String =

<div>
  Hello World

  <h1>
    I am a cow!</h1></div>

dwalend avatar Apr 08 '15 02:04 dwalend

This is intentional but undocumented, as of yet. Will document it eventually.

The root cause is to let you put stuff inside the root folder, rather than having to always pick your own folder.

I'll close this issue when i fix the readme

lihaoyi avatar Apr 08 '15 04:04 lihaoyi

Thanks. Sounds good for now.


For posterity -- I was able to put a

{package somepackage}

at the top of a HelloFromPackage.scalatex file, and then

scala> import scalatex.somepackage.HelloFromPackage import scalatex.somepackage.HelloFromPackage

So you could build a hierarchy under the top-level scalatex package if you need one. Not quite picking your own package, but very close.

dwalend avatar Apr 08 '15 20:04 dwalend