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

Some additional docs on starting you amber app #12

Open
psvensson opened this issue Sep 13, 2014 · 3 comments
Open

Some additional docs on starting you amber app #12

psvensson opened this issue Sep 13, 2014 · 3 comments

Comments

@psvensson
Copy link

Sorry to put this at the wrong place; Here goes again ->

It would be great with a small example on what to write in the index.html to start/create/init your own packages. It is mentioned at the bottom of

http://docs.amber-lang.net/overview/creating-packages.html

But it's quite hard to figure out the right way to do it. Require makes sure they'e there, but how to I call an init method on my main class, for example?

@ghost
Copy link

ghost commented Sep 13, 2014

Every class' init is called when Amber is initialized. For other code you want to run at startup, there's the callback function.

Could you point out where it's hard to understand / provide a better wording (all the docs pages are here in the repo)?

@ghost
Copy link

ghost commented Sep 13, 2014

Ah, I see now. It is just mentioned, but no example of how to do it. OTOH, amber init-created projects already have one production and one test package included in loader - so you can just add new ones to the same place where they are. In 0.12, it is an array in require call in index.html, with newest 0.13 prerelease, it's array in define call in deploy.js and devel.js.

You are true that doc is suboptimal. We know it, just there is no one who would take it and improve it radically. Plus, things in 0.13 prerelease are still in the flux, so the question is - write docs for 0.12 or for 0.13?

@psvensson
Copy link
Author

OK, got it. I think that just writing one line about how to create something of your choice (other than default) and call any method on it would be great. Hopefully not changing between versions much either.

@ghost ghost added the enhancement label Sep 14, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant