From 7b03821f27da11b0413c69efb5032219f24d7cc9 Mon Sep 17 00:00:00 2001 From: Seonghyeon Cho Date: Sun, 1 Dec 2024 19:20:02 +0900 Subject: [PATCH] Update readme, etc. Signed-off-by: Seonghyeon Cho --- README.md | 18 ++++++++++++++++-- .../io/github/shcho/xmldoclet/XmlDoclet.java | 12 ++++++------ 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index c51be26..f9975ec 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,8 @@ javadoc \ '...java files...' ``` +Note: currently `commons-lang3` should be provided in the classpath. + ### Gradle (Groovy DSL) ex) when using [Lombok](https://projectlombok.org/) ```groovy @@ -82,7 +84,9 @@ tasks.register('xmldoc', Javadoc) { docletpath = configurations.xmlDoclet.files as List doclet = "io.github.shcho.xmldoclet.XmlDoclet" - // addStringOption("filename", "custom-output-name.xml") + //// Additional options + // addStringOption("-Xfilename", "custom-output-name.xml") + // addStringOption("-Xescape", "false") // If you want to unescape strings in Javadoc comments } } @@ -90,10 +94,15 @@ tasks.register('xmldoc', Javadoc) { ## Options ``` +# Standard doclet options -d [] Destination directory for output file. (Default: .) --filename [] + +# Custom options (prefix with -X) +-Xfilename [] Output filename. (Default: javadoc.xml) +-Xescape [true|false] + Escape characters in javadoc comments. (Default: true) ``` ## References @@ -101,5 +110,10 @@ tasks.register('xmldoc', Javadoc) { - [manticore-projects/xml-doclet](https://github.com/manticore-projects/xml-doclet) (fork of above) - Supports JDK 11 and later, via enforcing Java toolchain version of 11 - https://github.com/vojtechhabarta/typescript-generator +## TODO +- [ ] Publish uber jar also +- [ ] Publish to Maven Central + - Package name might be changed + ## License [Apache License 2.0](LICENSE) diff --git a/lib/src/main/java/io/github/shcho/xmldoclet/XmlDoclet.java b/lib/src/main/java/io/github/shcho/xmldoclet/XmlDoclet.java index 16764bd..55f1ce2 100644 --- a/lib/src/main/java/io/github/shcho/xmldoclet/XmlDoclet.java +++ b/lib/src/main/java/io/github/shcho/xmldoclet/XmlDoclet.java @@ -83,10 +83,10 @@ public boolean process(String option, List arguments) { return OK; } }, - // option to whether escape characters or not - // e.g. `-Xescape true`, "안녕" will be "\uc548\ub155" (default) - // `-Xescape false`, it will be printed in xml as "안녕", - new Option("-Xescape", true, "Unescape characters in javadoc comments (Default: true)", + new Option("-Xescape", true, "Escape characters in javadoc comments\n" + + "e.g. `-Xescape true`, \"안녕\" -> \"\\uc548\\ub155\"\n" + + " `-Xescape false`, \"안녕\" -> \"안녕\"\n" + + "(Default: true)", "[true|false]", Kind.EXTENDED) { @Override public boolean process(String option, List arguments) { @@ -98,9 +98,9 @@ public boolean process(String option, List arguments) { } ); /** - * For now {@code -doctitle} and {@code -windowtitle} option is not needed, + * For now some options (ex. {@code -doctitle}, {@code -windowtitle}, etc.) are not needed for this Doclet, * but just allow it to make gradle happy. - *
+ *

* Without this, gradle will fail with the error like below: *

      * error: option -doctitle not allowed