Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example creates Hello in a scalatex package #13

Open
dwalend opened this issue Apr 8, 2015 · 2 comments
Open

Example creates Hello in a scalatex package #13

dwalend opened this issue Apr 8, 2015 · 2 comments

Comments

@dwalend
Copy link

dwalend commented Apr 8, 2015

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>
@lihaoyi
Copy link
Owner

lihaoyi commented Apr 8, 2015

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

@dwalend
Copy link
Author

dwalend commented Apr 8, 2015

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants