Open mrjoelkemp opened 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.
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.
It'd probably be safer to fork Haruki's graft function rather than exporting it.
Got it. Thanks for the insight.
+1
Just an issue for record sake. Still working on this one.