-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrate to jdk.javadoc.doclet API for Java 9 and later #71
Comments
Trying to build Asciidoclet under JDK 9 (or 10), results in the following error message:
|
Yeah, from what I've seen it's a non-trivial migration. I hope it would be backwards compatible with < Java 9. I would love to see the dependency on tools.jar to go away. |
I don't think it is backwards compatible in terms of compiling or running on pre-Java 9. In other words the api is The old (current) Asciidoclet should continue to run on newer JDKs until (This is why I propose two "phases" to Java 9 support in Issue #76) |
I've been tinkering around with the new Javadoclet api. Bad news is that we won't have the (hack) ability to override the default comment text. But, this might mean we should take a more direct approach... maybe proxying the elements api everywhere a javadoc is accessed via the HtmlDoclet? |
What do you mean by that? |
I mean, I don't know if the original intention of a javadoc doclet was to give the ability to swap in a different rendering engine for javadocs as we have. The API feels like it wasn't designed for this, as we replace the raw javadoc text with our rendered text and then pass it on to the default javadoc renderer. We would have to find a similar technique in the new javadoc API and the examples I've seen don't cover this sort of functionality. |
Well worst case we could take the code for the Standard Doclet and modify it, right? |
Yeah, I think you're right. Plus we can use the standard doclet ( For an implementation, my initial thought is to add a proxy layer into the elements api to process the javadocs from asciidoc to html. We could then hand this elements proxy into the HtmlDoclet for final rendering. This would benefit from leveraging the features of the |
You're talking about the core of the implementation here -- some fairly tricky code. I haven't looked at it much -- so my opinion isn't that valuable (at least yet) I'm actually thinking we might want to create a little design document and talk about goals and architecture a little before getting started. One goal I'd like to see is code that could be also be used for a new GroovyDoc that supports Asciidoclet. In fact, we might even be able to propose to the Groovy team to make Asciidoclet the standard format for Groovy. (Especially now that they have Kotlin-envy and Kotlin has a built-in markdown syntax for KDoc) This might be a little too ambitious for our first cut, but I'm wondering what (if anything) could be reusable for GroovyDoc. Back to the question of proxy layer -- I think it makes sense and it might also be reusable for Groovy which would be cool. |
I agree 100% @msgilligan, this deserves some planning w/ a design doc, and the Groovy possibility sounds fantastic. |
If you're interested @msgilligan, I was able to convert one of my other doclets over to Java 9 here. The meat of it here is getting the Javadoc comment via the Elements utility and processing it. In export doclet we just drop it to a file, but this could be the proxy location where we pass it through Asciidoctor to create the output html. |
When running Asciidoclet under Java 9 I get the following message
At some point Asciidoclet should be ported to the new API.
The text was updated successfully, but these errors were encountered: