cbou / markdox

Markdox is a documentation generator based on Dox and Markdown. It parse Javascript and even Coffeescript.
http://cbou.github.com/markdox
230 stars 27 forks source link

Updated markdox.js to not double format when custom formatter is provided #6

Closed heff closed 10 years ago

heff commented 11 years ago

Currently when a custom formatter is provided, the docfile is first passed through the default formatter, and then through the custom formatter.

There might be a benefit in doing this that I'm missing, but I was assuming a formatter would have direct access to the dox output, which it doesn't right now. I also assumed that I could make a direct copy of formatter.js to create my own formatter, but this also doesn't work.

PS. Great project. Dox -> Markdown is exactly what I was looking for, and the templates/formatters makes this really flexible.

heff commented 11 years ago

I just saw the raw: javadoc piece in the docfile output, so there is actually access to the dox output.

It's possible there just needs to be some clarification between what formatter.js is and what a custom formatter is.

cbou commented 10 years ago

Sorry for being late to respond.

The formatter.js is the basic formatter. With a custom formatter you can override some part of the result. Or, as you noticed, with the raw object of docfile you can override the basic formatter completely.

cbou commented 10 years ago

I actually modify formatter so that they work exactly like compiler. It's explained in the README.md.