openrewrite / rewrite-recipe-markdown-generator

Utility that generates OpenRewrite recipe documentation in markdown format for all recipes on the classpath.
Apache License 2.0
2 stars 7 forks source link

Show recipe option example values in table #91

Closed timtebeek closed 9 months ago

timtebeek commented 9 months ago

What's changed?

Add a fourth options column with example values, as indicated on the option annotations.

What's your motivation?

Helps users see what type of input is expected.

Have you considered any alternatives or workarounds?

We could add the same value to the description instead of a fourth column, as it might be missing frequently.

Any additional context

Reported through OSS Slack: https://rewriteoss.slack.com/archives/C01A843MWG5/p1702462745389259

timtebeek commented 9 months ago

See this page for a quick preview: https://openrewrite.github.io/rewrite-recipe-markdown-generator/reference/recipes/java/dependencies/adddependency.html

timtebeek commented 9 months ago

Looks like we did show those example values in the Usage yaml, as seen in the current version of the docs: https://docs.openrewrite.org/recipes/maven/adddependency

timtebeek commented 9 months ago

We might also want to show valid options as can be seen here: https://github.com/openrewrite/rewrite-logging-frameworks/blob/a69a8b85c43e3f71b8fdd0a722bdc130e55b6b25/src/main/java/org/openrewrite/java/logging/SystemPrintToLogging.java#L44-L49

mike-solomon commented 9 months ago

@timtebeek I see this as a draft PR -- is there anything in particular you're wanting feedback on here? The changes made seem fine to me.