From f9efa745d625aab90ff667601fccf81fb6c56085 Mon Sep 17 00:00:00 2001 From: Eric Deandrea Date: Mon, 15 Jul 2024 16:21:59 -0400 Subject: [PATCH] Distinguish non-instantiable build items In the all-builditems docs, use an icon/hover to distinguish non-instantiable build items. These can be extended by other build items, so documenting them is good. --- docs/src/main/asciidoc/all-builditems.adoc | 4 +++- .../io/quarkus/docs/generation/QuarkusBuildItemDoc.java | 6 +++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/docs/src/main/asciidoc/all-builditems.adoc b/docs/src/main/asciidoc/all-builditems.adoc index 37d6431639e6c..02f053116dffd 100644 --- a/docs/src/main/asciidoc/all-builditems.adoc +++ b/docs/src/main/asciidoc/all-builditems.adoc @@ -11,6 +11,8 @@ include::_attributes.adoc[] :categories: writing-extensions :summary: Explore all the BuildItems you can consume/produce in your extensions. -Here you can find a list of Build Items and the extension that provides them: +Here you can find a list of Build Items and the extension that provides them. + +icon:building[title=Non-instantiatable Build Item] Build item can't be instantiated directly, but can be extended/inherited from include::{generated-dir}/config/quarkus-all-build-items.adoc[opts=optional] diff --git a/docs/src/main/java/io/quarkus/docs/generation/QuarkusBuildItemDoc.java b/docs/src/main/java/io/quarkus/docs/generation/QuarkusBuildItemDoc.java index afc2ee39787c4..c894672ad0bfd 100644 --- a/docs/src/main/java/io/quarkus/docs/generation/QuarkusBuildItemDoc.java +++ b/docs/src/main/java/io/quarkus/docs/generation/QuarkusBuildItemDoc.java @@ -186,10 +186,14 @@ private void printTableRow(Pair pair) { String className = source.getQualifiedName(); String attributes = buildAttributes(source); String description = getJavaDoc(source); + String baseBuildItemText = source.isAbstract() + ? "icon:building[title=Non-instantiatable Build Item (can be inherited from)]" + : ""; String linkToClass = String.format("%s[`%s`, window=\"_blank\"]", link, className); - out.println(String.format("\n\na|%s\n[.description]\n--\n%s\n-- a|%s", + out.println(String.format("\n\na|%s %s\n[.description]\n--\n%s\n-- a|%s", + baseBuildItemText, linkToClass, javadocToAsciidoc(description), attributes));