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

use within other scripts #22

Open
svnlto opened this issue Feb 10, 2012 · 4 comments
Open

use within other scripts #22

svnlto opened this issue Feb 10, 2012 · 4 comments

Comments

@svnlto
Copy link

svnlto commented Feb 10, 2012

hey there,

I'm writing a grunt task that generates docs and I was thinking of using groc. I was wondering if it's possible to use groc within another script as opposed to on the CLI.

@nevir
Copy link
Owner

nevir commented Feb 10, 2012

I have a very rough API that you could use, though it's definitely going to be a moving target for a while. (I'm totally happy to work with you to solidify it over time though)

Take a look at where the CLI code builds a Project object for the low level API.

Alternatively, you can fake a command line call w/o the shell as an intermediary by including the CLI module directly, and calling it similar to the bin file - this interface is less likely to change, but is definitely more awkward.

@nevir
Copy link
Owner

nevir commented Feb 10, 2012

Thinking further on this, a better and probably relatively stable API would be to decouple the argument parsing, and have a call that takes the resultant options hash - easy to configure, and also plays nicely with the.groc.json file

@gersongoulart
Copy link

I was trying to create a GrunJS taks as well: https://gist.github.com/4552595 . But can't get it to work without the .groc.json file (and using the grunt initConfig instead). Any suggestions what I could do to accomplish that?

@gersongoulart
Copy link

Actually I just got it to work by converting the grunt options (same structure as the .groc.json file) to a list of CLI commands. Please check the https://gist.github.com/4552595 gist again, I just updated it.

@nevir , if you think that is a good solution, perhaps we could have that integrated with Groc so it plays nice with Grunt builds?

Cheers!

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

3 participants