-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Allow multiple format and themes in the Config Doc generator #42907
Conversation
🙈 The PR is closed and the preview is expired. |
Ideally, inject the generated in GitHub somewhere to test how it looks. I'm interested in a link once you have a good enough result. Thanks! |
Perfect, I think I have everything I need to get started. |
I tried to push on your branch but I'm not allowed to, maybe I didn't understand what you meant:
Here's what I got at the moment, I'll work on it some more later: https://gist.github.com/Athou/38211a5a6600e97f3daa8fd909dbd99f |
@gsmet I think I'm almost done. I have a couple of questions:
Also, I'm still unable to push to your branch. Thanks! |
@Athou looks good! So for the section, what you need is a nested We have an issue with the constraints, I need to check if it's you having a problem or me. As for pushing to my branch, you can't. What you can do is to create a PR for my fork here: https://github.com/gsmet/quarkus on the branch |
b038bd0
to
ac75ce9
Compare
@Athou I rebased this work and fixed a few things here and there. I tested it with your Commafeed project and it looks good out of the box. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@ppalaga this PR will change quite a few things as the Javadoc won't be transformed in Asciidoc at the source anymore. You will have to call: String description = JavadocTransformer.transform(javadocElement.get().description(), javadocElement.get().format(),
JavadocFormat.ASCIIDOC); to transform the raw Javadoc to Asciidoc in your plugin. |
This comment has been minimized.
This comment has been minimized.
The idea is to allow generating Markdown for easily publishing the config on GitHub. The Javadoc -> Markdown part will probably change a lot soon as we need to support Markdown for the IDEs. This is the fruit of a collaboration with @Athou (Jérémie Panzer), who is marked as a co-author. Co-authored-by: Jérémie Panzer <jeremiepanzer@gmail.com>
In the end, let's keep it around but handles it properly in the generated config doc.
For IDEs, we will need to be able to convert our javadoc to Markdown. And obviously, transforming our javadoc to Asciidoc right in the generated YAML files is a bad idea. We now pass the raw Javadoc and it is going to be transformed at a later stage.
b5e35cd
to
3cfa644
Compare
Status for workflow
|
Makes sense. Just a clarifying quesrion: Different Formats I grok in sense we store one uniform and then convert to target for the specific output (asciidoc, metadata, etc). Where does themes come in? Didn't grok that part ? Is that just the different outputs you call "theme" ? |
Status for workflow
|
The theme might not be useful in the end but it's something we discussed with Peter at some point so that we would have the CXF "theme" in Quarkus itself. I wouldn't have done it if I wasn't already adjusting this and thus it came basically for free. We don't use it atm. |
Cool. Was just curious what/where it fits. |
@Athou I thought about this a bit more and I wonder if we should switch to HTML tables to render the config tables. My main worry is if some code is added to the Javadoc for instance. But I think it could easily be broken in all sorts of ways as Markdown tables are extremely basic. See https://stackoverflow.com/questions/28508141/code-block-inside-table-row-in-markdown . |
// it's Asciidoc, the fun begins... | ||
return ""; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are your plans here, @gsmet? Are you going to implement AsciiDoc -> Markdown transformation?
I migrated all QCXF to @asciidoclet
because the JavaDoc -> AsciiDoc transformation did not work well in some edge cases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that's the plan.
I don't expect it to be perfect as I won't implement something heavy (I would like to avoid including AsciiDoctorJ + JRuby if we can) but hope it's going to be good enough for the IDEs to be able to consume it.
And we will improve over time when edge cases pop up.
If you have the Javadoc edge cases still around, I'm interested in making it better (if possible). It will never be perfect but it would be nice for it to be good enough in most cases.
But in any case, AsciiDoc will be supported if that's what worried you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The IDE work is slowly being put in shape here: #42677 .
I need to rebase and wire the Markdown transformer and... then... implement it somehow :).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's this thing in Javascript that looks interesting and matches what I would like to achieve: https://github.com/opendevise/downdoc .
But I'm not sure how easy it would be to convert it in Java. The code is not exactly readable :).
Not sure if AI could help translating downdoc to Java.
I agree, those are valid points, switching to HTML tables would indeed be more robust for the future. The templates would also be easier to read and maintain since we would not have to put everything on the same line. I'll play a bit with HTML tables and open a PR if it goes well. |
Awesome, thanks! |
The idea is to allow generating Markdown for easily publishing the config on GitHub.
The Javadoc -> Markdown part will probably change a lot soon as we need to support Markdown for the IDEs.
This is the fruit of a collaboration with @Athou (Jérémie Panzer), who is marked as a co-author.
It also provides the foundation of Markdown support that we will need for the IDE work (it's still partial but I'd like to get it in so that I can rebase the IDE PR on it).