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

Multifile compilation support and tinier output with --js option #100

Open
wants to merge 20 commits into
base: master
Choose a base branch
from

Conversation

mnichols
Copy link

Hi this patch does the following:

UPDATE : I just added namespacing for templates, based on the directory structure.
So you can have this structure:

  • templates
    myTempl.coffee => this.templates["myTempl"] = ...
    • myModule
      mySpecificTempl.coffee => this.templates["myModule"]["mySpecificTempl"] = ...
  • Allows compilation of all files in a directory producing a single file with only one instance of the skeleton boilerplate code. So you can do this coffeekup --js ./templates which yields a single 'templates.js' . The output file name is coming from the namespace option.
  1. Watching is supported on all the contributing files.
  2. Extract method refactoring on compiler ops inside coffeekup.coffee to eliminate duplication (and size)
  3. Split internal method calls in cli.coffee to simplify

4a. Updated README to give examples of using the extended CLI and also added ./browser/examples/sugar to give you an idea the improvements

  1. Had to fix the optsparser path from coffee-script to get it going...it's on the other pull requests too.

@mnichols
Copy link
Author

I just appended this request with support for hardcoded helpers from the CLI.
You can pass an -i path/to/helpers/directory and it will read in the file contents to include as 'hardcode' inside each template.
Check out the 'sugar' example. I updated docs to demonstrate this as well.

@lorensr
Copy link

lorensr commented Dec 13, 2011

I was just about to open an issue for adding this. Beautiful, thank you so much.

@ghost
Copy link

ghost commented Dec 13, 2011

Glad I could help! Let me know if you need help

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

Successfully merging this pull request may close these issues.

2 participants