From 521932ea7be96639a597b1ef0e19f93c6cec6610 Mon Sep 17 00:00:00 2001 From: Tim Quinn Date: Tue, 7 Jan 2025 16:02:52 -0600 Subject: [PATCH] Add support for row and column span; propagate rendering error information to the output Signed-off-by: Tim Quinn --- .../maven/sitegen/RenderingException.java | 18 +++++++++++------- .../templates/vuetify/block_table.ftl | 12 +++++++++--- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/maven-plugins/sitegen-maven-plugin/src/main/java/io/helidon/build/maven/sitegen/RenderingException.java b/maven-plugins/sitegen-maven-plugin/src/main/java/io/helidon/build/maven/sitegen/RenderingException.java index 66ac670b7..a00e8218d 100644 --- a/maven-plugins/sitegen-maven-plugin/src/main/java/io/helidon/build/maven/sitegen/RenderingException.java +++ b/maven-plugins/sitegen-maven-plugin/src/main/java/io/helidon/build/maven/sitegen/RenderingException.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, 2022 Oracle and/or its affiliates. + * Copyright (c) 2018, 2025 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,6 +16,8 @@ package io.helidon.build.maven.sitegen; +import java.io.PrintWriter; +import java.io.StringWriter; import java.util.ArrayDeque; import java.util.Arrays; import java.util.Deque; @@ -24,9 +26,6 @@ import freemarker.template.TemplateException; -import static java.lang.System.lineSeparator; -import static java.util.stream.Collectors.joining; - /** * An exception to represent any error occurring as part of site processing. */ @@ -47,11 +46,16 @@ public RenderingException(String msg) { * @param errors exceptions to aggregate */ public RenderingException(List errors) { - this(errors.stream() - .map(Throwable::getMessage) - .collect(joining(lineSeparator()))); + this(allErrorInfo(errors)); } + private static String allErrorInfo(List errors) { + StringWriter sw = new StringWriter(); + try (PrintWriter pw = new PrintWriter(sw)) { + errors.forEach(t -> t.printStackTrace(pw)); + return sw.toString(); + } + } /** * Create a new instance. * diff --git a/maven-plugins/sitegen-maven-plugin/src/main/resources/templates/vuetify/block_table.ftl b/maven-plugins/sitegen-maven-plugin/src/main/resources/templates/vuetify/block_table.ftl index c1b17b91f..df5b6dc3b 100644 --- a/maven-plugins/sitegen-maven-plugin/src/main/resources/templates/vuetify/block_table.ftl +++ b/maven-plugins/sitegen-maven-plugin/src/main/resources/templates/vuetify/block_table.ftl @@ -1,5 +1,5 @@ <#-- - Copyright (c) 2018, 2022 Oracle and/or its affiliates. + Copyright (c) 2018, 2025 Oracle and/or its affiliates. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -50,8 +50,14 @@ TODO: <#list row.cells as cell> <#if cell.content?is_enumerable> -<#list cell.content as cellcontent>${cellcontent} -<#else>${cell.content} +<#list cell.content as cellcontent> rowspan="${cell.rowspan}" +<#if cell.colspan??> colspan="${cell.colspan}" +>${cellcontent} +<#else> rowspan="${cell.rowspan}" +<#if cell.colspan??> colspan="${cell.colspan}" +>${cell.content}