Skip to content

Commit

Permalink
Update readme, etc.
Browse files Browse the repository at this point in the history
Signed-off-by: Seonghyeon Cho <[email protected]>
  • Loading branch information
sh-cho committed Dec 1, 2024
1 parent b89bc3e commit 7b03821
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 8 deletions.
18 changes: 16 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -82,24 +84,36 @@ 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
}
}
```

## Options
```
# Standard doclet options
-d [<directory>]
Destination directory for output file. (Default: .)
-filename [<filename>]
# Custom options (prefix with -X)
-Xfilename [<filename>]
Output filename. (Default: javadoc.xml)
-Xescape [true|false]
Escape characters in javadoc comments. (Default: true)
```

## References
- [MarkusBernhardt/xml-doclet](https://github.com/MarkusBernhardt/xml-doclet) - Supports JDK 8
- [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)
12 changes: 6 additions & 6 deletions lib/src/main/java/io/github/shcho/xmldoclet/XmlDoclet.java
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,10 @@ public boolean process(String option, List<String> 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<String> arguments) {
Expand All @@ -98,9 +98,9 @@ public boolean process(String option, List<String> 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.
* <br>
* <p>
* Without this, gradle will fail with the error like below:
* <pre>
* error: option -doctitle not allowed
Expand Down

0 comments on commit 7b03821

Please sign in to comment.