-
Notifications
You must be signed in to change notification settings - Fork 864
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 javadoc formatting to be skipped. #139
Comments
We could consider skipping it whenever the first character of doc is |
What about field/method comments? example: Awesome Asciidoctor: Using Asciidoctor In Javadoc Comments |
Same deal -- if you make it recognizable to the tool then we can consider recognizing it. I don't know why the example you linked makes it clear for the class (starting |
is equivalent to:
What I meant:
|
Oh. That's too bad. If they're going to diverge from the 20-year standard of what javadoc looks like, they should at least make that divergence detectable. For one thing, they leave a large codebase, where people actually care about and write documentation, out of luck for how it might transition. (Perhaps they figure such codebases don't exist, but... they do!) What are other arguments for making javadoc formatting optional in google-java-format? |
As far as I know, the Doclet API does not prescribe the markup of the comment (the StandardDoclet does though.) Here are two doclets supporting Markdown markup: https://github.com/Abnaxos/pegdown-doclet In both pegdown-doclet and asciidoclet one can even embed PlantUML syntax to generate diagrams (see the example in Awesome Asciidoctor: Using Asciidoctor In Javadoc Comments). |
Yes, we have a 20-year standard and yes it is used in most projects. But if one starts a new project now, one might consider using a more pleasant markup language than HTML. Also, IntelliJ, Eclipse, Netbeans, and Jindent can be configured to ignore JavaDoc formatting. |
Why not just have an option to exclude formatting javadoc? |
Adds the command line flag `--skip-javadoc-formatting` to enable skipping javadoc formatting. Only the HTML formatting of javadoc is skipped, not things like fixing indentation, missing asterisks and trimming. This commit does not attempt to solve issues that arise when using other formatting standards, simply just to preserve the text inside of the javadoc. For examples, see the tests added to JavadocFormattingTest. Issue: google#139
There is also a convention to use This would be useful to avoid formatting license headers - the various license plugins that exist for maven, gradle, etc., tend to use exact string matches and therefore conflict with google-java-format. |
(Off-topic to current issue, since Javadoc has to begin with |
Back to the main topic, I would support this as a command-line option. We push back on options that we see as configuring its formatting choices, but we do have several that merely switch on or off certain of its functions. |
Fixes #139, #149 ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=279811849
Fixes #139, #149 ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=279811849
This is useful if one uses the AsciiDoc syntax to write one's Javadoc.
https://github.com/asciidoctor/asciidoclet/
The text was updated successfully, but these errors were encountered: