openrewrite / rewrite-docs

Stores the markdown documents used to generate docs.openrewrite.org
https://docs.openrewrite.org
Apache License 2.0
41 stars 52 forks source link

Fix rule description markdown of tech.picnic.errorprone.refasterrules.TestNGToAssertJRulesRecipes #282

Closed Philzen closed 5 months ago

Philzen commented 5 months ago

The description displayed at https://docs.openrewrite.org/recipes/tech/picnic/errorprone/refasterrules/testngtoassertjrulesrecipes is confusing, the mixture of HTML and markdown leads to disappearing relevant information such as this:

(note that the type parameters of the map on the right-hand side will be inferred to be rather than).

Still clueless what is being referred to with "Some of the classes below " though.

Wondering if we couldn't cook up a nice recipe to do this cleanup automatically:

It would also be nice to have the Github-Link under "Recipe source" to link to the actual implementation.

timtebeek commented 5 months ago

Thanks for the offer to help fix the description here! Unfortunately this one is a bit of a rabbit hole:

  1. we generate our recipe documentation from the recipe jars themselves in rewrite-recipe-markdown-generator
  2. this particular recipe is found in rewrite-third-party
  3. but only because that shades error-prone-support
  4. which in turn uses rewrite-templating to create recipes from templates
  5. rewrite-templating can extract the documentation either from JavaDoc or from annotations
  6. In this particular case, the documentation likely comes from the JavaDoc on TestNGToAssertJRules

In this case I think we should likely update rewrite-templating to not put those wrapping __ around a multi-line description, as a first formatting fix. Then once that's picked up in error-prone-support and released there, should the doc changes cascade here.

While we could merge this PR, the changes would otherwise be overwritten the next time we generate the documentation, which we tend to do every two weeks.

Philzen commented 5 months ago

I already had a hunch this might be a pointless PR due to some automated process generating this documentation. :wink:

I've documented the issue here now: https://github.com/openrewrite/rewrite-templating/issues/93 (hope this is the correct repo to place this).

So i guess it doesn't matter much whether this is merged or closed, so i'll be fine with any.

timtebeek commented 5 months ago

Thanks for logging that additional issue; I'll merge this for now until we can fix it upstream. 🙏🏻