Skip to content

Commit 521932e

Browse files
committed
Add support for row and column span; propagate rendering error information to the output
Signed-off-by: Tim Quinn <[email protected]>
1 parent 9603d8a commit 521932e

File tree

2 files changed

+20
-10
lines changed

2 files changed

+20
-10
lines changed

maven-plugins/sitegen-maven-plugin/src/main/java/io/helidon/build/maven/sitegen/RenderingException.java

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018, 2022 Oracle and/or its affiliates.
2+
* Copyright (c) 2018, 2025 Oracle and/or its affiliates.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -16,6 +16,8 @@
1616

1717
package io.helidon.build.maven.sitegen;
1818

19+
import java.io.PrintWriter;
20+
import java.io.StringWriter;
1921
import java.util.ArrayDeque;
2022
import java.util.Arrays;
2123
import java.util.Deque;
@@ -24,9 +26,6 @@
2426

2527
import freemarker.template.TemplateException;
2628

27-
import static java.lang.System.lineSeparator;
28-
import static java.util.stream.Collectors.joining;
29-
3029
/**
3130
* An exception to represent any error occurring as part of site processing.
3231
*/
@@ -47,11 +46,16 @@ public RenderingException(String msg) {
4746
* @param errors exceptions to aggregate
4847
*/
4948
public RenderingException(List<RenderingException> errors) {
50-
this(errors.stream()
51-
.map(Throwable::getMessage)
52-
.collect(joining(lineSeparator())));
49+
this(allErrorInfo(errors));
5350
}
5451

52+
private static String allErrorInfo(List<RenderingException> errors) {
53+
StringWriter sw = new StringWriter();
54+
try (PrintWriter pw = new PrintWriter(sw)) {
55+
errors.forEach(t -> t.printStackTrace(pw));
56+
return sw.toString();
57+
}
58+
}
5559
/**
5660
* Create a new instance.
5761
*

maven-plugins/sitegen-maven-plugin/src/main/resources/templates/vuetify/block_table.ftl

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<#--
2-
Copyright (c) 2018, 2022 Oracle and/or its affiliates.
2+
Copyright (c) 2018, 2025 Oracle and/or its affiliates.
33
44
Licensed under the Apache License, Version 2.0 (the "License");
55
you may not use this file except in compliance with the License.
@@ -50,8 +50,14 @@ TODO:
5050
<tr>
5151
<#list row.cells as cell>
5252
<#if cell.content?is_enumerable>
53-
<#list cell.content as cellcontent><td class="${cell_classes}">${cellcontent}</td></#list>
54-
<#else><td class="${cell_classes}">${cell.content}</td>
53+
<#list cell.content as cellcontent><td class="${cell_classes}"
54+
<#if cell.rowspan??> rowspan="${cell.rowspan}"</#if>
55+
<#if cell.colspan??> colspan="${cell.colspan}"</#if>
56+
>${cellcontent}</td></#list>
57+
<#else><td class="${cell_classes}"
58+
<#if cell.rowspan??> rowspan="${cell.rowspan}"</#if>
59+
<#if cell.colspan??> colspan="${cell.colspan}"</#if>
60+
>${cell.content}</td>
5561
</#if>
5662
</#list>
5763
</tr>

0 commit comments

Comments
 (0)