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

Generate as markdown #57

Open
adam-lynch opened this Issue Jun 26, 2014 · 2 comments

Comments

Projects
None yet
3 participants
@adam-lynch
Contributor

adam-lynch commented Jun 26, 2014

It would be cool if markdown docs were supported. So for example if I'm working on a module with just a index.coffee with one class in it, then I could generate the doc for that class and link to it from my readme. Or even better, I could actually append it to my readme with gulp-biscotto (& other Gulp plugins).

@adam-lynch

This comment has been minimized.

Contributor

adam-lynch commented Jun 26, 2014

I've played around trying to get this working with other Gulp plugins and I've gotten somewhat there. It's not perfect. It could be tweaked and improved but really it would be nice if biscotto supported it.

Example file

# Public: Parser
module.exports = class Parser

    ### Public ###

    # Get number of unique things
    # stuff - {String}
    # Returns a {Number}
    getNumberOfThings: (stuff) =>
        return 0

My gulp task

Depends on:

gulp.task 'docs', =>
    $.biscotto()
        .pipe($.filter (file) =>
            return path.basename(file.path) is 'Parser.html'
        )
        .pipe($.hammerdown
            type: 'gfm'
        )
        .pipe(es.map (file, cb) =>
            lines = file.contents.toString().split('\n')
            lines = lines.splice(65)
            file.contents = new Buffer lines.join('\n')

            cb null, file
        )
        .pipe(gulp.dest('./docs'));

The output (Parser.md)

(below the line)


Overview

Parser

Instance Method Summary

Instance Method Details

  ::**getNumberOfThings**(stuff)
  (bound)
  [Source][9]

Get number of unique things stuff - String Returns a Number
Generated on
Thu Jun 26 2014 12:36:57 GMT+0100 (GMT Summer Time)
by
Biscotto
v2.1.4
(Node.js v0.10.20).

Press Ctrl-h to see the keyboard shortcuts

/blob/master/src\index.coffee#L9

@gjtorikian

This comment has been minimized.

Owner

gjtorikian commented Jul 1, 2014

That's neat. Definitely not against this. The whole point of Biscotto's intermediate format--JSON--is to allow different generators to create different output. Obviously right now there's just one Generator, HTML.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment