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

how do i run for all my files? #20

Closed
nrser opened this issue Jul 8, 2016 · 6 comments
Closed

how do i run for all my files? #20

nrser opened this issue Jul 8, 2016 · 6 comments

Comments

@nrser
Copy link

nrser commented Jul 8, 2016

hey, i'm just getting started with documentation.js (and gulp). the README gives examples of generating docs for a single file, but i'd like to generate docs for all my files.

i'm trying

gulp.task('doc', () => {
  gulp.src('./meteor/imports/**/*.js')
    .pipe(debug())
    .pipe(documentation({shallow: true, format: 'md'}))
    .pipe(gulp.dest('./doc'));
});

and i can see all the files going through from the debug output but the result seems to be a single API.md for a single file.

i'm using Meteor which has weird imports so the dependency following thing doesn't work (hence this shallow: true part).

thanks.

@tmcw
Copy link
Member

tmcw commented Nov 10, 2016

Sure, I'm updating this module to documentation v4 and updating the readme with a multi-file example.

@tmcw tmcw closed this as completed in #24 Nov 10, 2016
@rwam
Copy link

rwam commented Nov 25, 2016

It seems your documentation should be updated. When I use

gulp.task('documentation', function() {
    gulp.src('app/js/**/*.js')
        .pipe(gulpDocumentation({
            format: 'html'
        }))
        .pipe(gulp.dest('docs/api'));
});

I get the following error:

[10:59:38] Error: invalid format given: valid options are html, md, remark, json
    at module.exports (/…/…/Workspace/pm-wg-angular/node_modules/gulp-documentation/index.js:82:11)
    …

@rwam
Copy link

rwam commented Nov 25, 2016

And it works only, when the task returns the stream. Otherwise no output is generated ;(

@tmcw
Copy link
Member

tmcw commented Nov 26, 2016

Hi @rwam - the recent version bump to 3.0.0 included a breaking change, along with updated examples. To update to 3.0.0, your code would look like:

gulp.task('documentation', function() {
    gulp.src('app/js/**/*.js')
        .pipe(gulpDocumentation('html'))
        .pipe(gulp.dest('docs/api'));
});

That that modified version out and let me know if it still doesn't work with the change.

@rwam
Copy link

rwam commented Nov 28, 2016

Hi @tmcw – I use version 3.0.0 and yes I tried it as described. But it only write it on the output directory when I use a return statement:

gulp.task('documentation', function() {
    return gulp.src('app/js/**/*.js')
        .pipe(gulpDocumentation('html'))
        .pipe(gulp.dest('docs/api'));
});

Ok I see the info on the 3.0.0 tag is actual, but it's a little weird ;) There is a missing character:

bildschirmfoto 2016-11-28 um 13 32 46

tmcw added a commit that referenced this issue Nov 28, 2016
@tmcw
Copy link
Member

tmcw commented Nov 28, 2016

Thanks for spotting that! I've updated the code examples so they should be functional.

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