Skip to content
This repository has been archived by the owner on Mar 25, 2019. It is now read-only.

Generate as markdown #57

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

Generate as markdown #57

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

Comments

@adam-lynch
Copy link
Contributor

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
Copy link
Contributor Author

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
Copy link
Owner

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants