jsdoc / jsdoc

An API documentation generator for JavaScript.
https://jsdoc.app/
Apache License 2.0
15.02k stars 1.45k forks source link

JSDoc should have an option to generate documentation in markdown format #756

Open mrjoelkemp opened 10 years ago

mrjoelkemp commented 10 years ago

Just an issue for record sake. Still working on this one.

mrjoelkemp commented 10 years ago

@hegemonic I originally thought the best approach for this was to mimic the html output generation with a heavy use of underscore templating logic. However, the Haruki template does exactly what JSdox (a project I contribute to) is doing: transforming a file's JSDoc AST into a form that aggregates methods and classes about a file and then piping it into a templating engine.

Would you be opposed to me exporting the graft function of Haruki, extending it (possibly calling graft within another function that adds on whatever else I need), and using underscore to render the markdown output?

Also would Haruki ever be removed from jsdoc proper? If it was removed, markdown generation would break if I require in haruki/graft.

Thanks in advance for the insight.

hegemonic commented 10 years ago

I'm not sure I understand the distinction between "mimicking the HTML output generation" and "piping the AST into a templating engine." It seems to me that JSDoc already generates HTML output by piping the AST into a templating engine. (It's true, though, that the current default template does not cleanly separate AST mangling and output generation.)

It'd probably be safer to fork Haruki's graft function rather than exporting it.

mrjoelkemp commented 10 years ago

It'd probably be safer to fork Haruki's graft function rather than exporting it.

Got it. Thanks for the insight.

mahnunchik commented 8 years ago

+1