Skip to content

Include example run command from node#136

Open
dominicbosch wants to merge 1 commit intonevir:masterfrom
dominicbosch:patch-1
Open

Include example run command from node#136
dominicbosch wants to merge 1 commit intonevir:masterfrom
dominicbosch:patch-1

Conversation

@dominicbosch
Copy link
Copy Markdown

I love the tool, it helps me in a great way to do my stuff!

But I want to run it from node and not the terminal. I have groc in my package.json dependencies which makes it instantly available and runnable for everybody in the project scope.
I had quite a hassle to find the exact syntax on how to do this with certain options.

It was easy when the options were only the files to be used for the documentation, but as soon as I wanted to switch to a different output folder, it got a bit difficult to figure that out.
I also tried it with the .groc.json config file, but that wasn't possible when calling groc.CLI(...).

I still have the feeling I might use the wrong entry point (groc.CLI(...)) for my approach...?

I love the tool, it helps me in a great way to do my stuff!

But I want to run it from node and not the terminal. I have groc in my package.json dependencies which makes it instantly available and runnable for everybody in the project scope.
I had quite a hassle to find the exact syntax on how to do this with certain options.

It was easy when the options were only the files to be used for the documentation, but as soon as I wanted to switch to a different output folder, it got a bit difficult to figure that out.
I also tried it with the .groc.json config file, but that wasn't possible when calling groc.CLI(...).

I still have the feeling I might use the wrong entry point (groc.CLI(...)) for my approach...?
@kmdavis
Copy link
Copy Markdown
Collaborator

kmdavis commented Dec 20, 2013

Interesting. I came up with a completely different method when we were integrating groc into our documentation server. Here's a simplified version of what we did:

     var groc = require('groc');
     var project = new groc.Project('/web/myProject', 'docs');
     project.options.requireWhitespaceAfterToken = true;
     project.index = 'INDEX.md';
     project.files = ['file1.js', 'file2.js', 'INDEX.md'];
     project.generate({ style: groc.styles.Gilt }, function (err) {});

@dominicbosch
Copy link
Copy Markdown
Author

looks nice and easy for my task. But through CLI you'd have more options if required.
I still vote for an example that shows groc usage directly from node executed js code and not only the command line.

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