asciidoctor / asciidoclet

:clipboard: A Javadoc Doclet based on Asciidoctor that lets you write Javadoc in the AsciiDoc syntax.
https://github.com/asciidoctor/asciidoclet
Apache License 2.0
133 stars 40 forks source link

Any way for Asciidoclet to be lenient towards html ? #40

Closed gjoseph closed 9 years ago

gjoseph commented 9 years ago

I am on the verge of using Asciidoclet on a relatively large codebase, that has a lot of old-ish Javadoc written with html. I'd like to progressively enhance the docs, but I can't realistically go and convert all of the existing doc. Is there any way to make Asciidoclet more lenient ? Perhaps something along the lines of "if there is html in the doc, let it be processed by the default doclet" ?

I am not familiar with how doclets work (i.e what input they get from the Javadoc tool), so this is perhaps more trouble than it's worth. I'd give it a shot though, if one of the devs of Asciidoc would indicate this is something they'd agree is useful. (although this might be quite tricky, since one might want html in their asciidoc, e.g code samples)

Alternatively, perhaps there are tools to help converting existing Javadoc ?

johncarl81 commented 9 years ago

Is there a way to specify which files are processed with which doclet? If so, then you could just specify the files that are processed with Asciidoclet as you convert them.

You could also escape all the files that you need to convert using the ++++ directive (http://asciidoctor.org/docs/user-manual/#built-in-blocks-summary). An easy way to do this is to perform a global replace with something like /** -> /**\n *++++ and *\n*/ -> *++++\n*/

It would be difficult to detect if HTML was used or not, I'd rather not complicate things if we can.

gjoseph commented 9 years ago

Thanks John, these are really good suggestions, both make a lot of sense and I'll probably end up using a combination of both !

johncarl81 commented 9 years ago

Great @gjoseph! I'd love to hear about your experience with Asciidoclet. Email me directly or the Asciidoctor mailing list if you feel inclined.