You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by pa...@apache.org on 2026/04/12 08:07:16 UTC
(groovy-website) branch asf-site updated: fix asciidoc upgrade glitches
This is an automated email from the ASF dual-hosted git repository.
paulk pushed a commit to branch asf-site
in repository https://gitbox.apache.org/repos/asf/groovy-website.git
The following commit(s) were added to refs/heads/asf-site by this push:
new 14be50e fix asciidoc upgrade glitches
14be50e is described below
commit 14be50e5e744595eb10b8b8ff18d6f51138ea5df
Author: Paul King <pa...@asert.com.au>
AuthorDate: Sun Apr 12 18:07:06 2026 +1000
fix asciidoc upgrade glitches
---
generator/src/main/groovy/generator/PageTemplate.groovy | 17 +++++++++++------
site/src/site/pages/wiki.groovy | 13 ++++++++++---
2 files changed, 21 insertions(+), 9 deletions(-)
diff --git a/generator/src/main/groovy/generator/PageTemplate.groovy b/generator/src/main/groovy/generator/PageTemplate.groovy
index a464ed2..00eb86d 100644
--- a/generator/src/main/groovy/generator/PageTemplate.groovy
+++ b/generator/src/main/groovy/generator/PageTemplate.groovy
@@ -22,6 +22,8 @@ import groovy.text.markup.BaseTemplate
import groovy.text.markup.MarkupTemplateEngine
import groovy.text.markup.TemplateConfiguration
import groovy.transform.CompileStatic
+import org.asciidoctor.Attributes
+import org.asciidoctor.Options
@CompileStatic
abstract class PageTemplate extends BaseTemplate {
@@ -62,13 +64,16 @@ abstract class PageTemplate extends BaseTemplate {
*/
String asciidocText(String body, Map options=[:]) {
def asciidoctor = AsciidoctorFactory.instance
- def attributes = options.attributes
- if (!attributes) {
- attributes = [:]
- options.put('attributes', attributes)
+ def attrsBuilder = Attributes.builder()
+ .attribute('source-highlighter', 'prettify')
+ def existingAttrs = options.attributes
+ if (existingAttrs instanceof Map) {
+ existingAttrs.each { k, v -> attrsBuilder.attribute(k.toString(), v) }
}
- attributes['source-highlighter'] = 'prettify'
- asciidoctor.convert(body,options)
+ def opts = Options.builder()
+ .attributes(attrsBuilder.build())
+ .build()
+ asciidoctor.convert(body, opts)
}
String latestDocURL(String target) {
diff --git a/site/src/site/pages/wiki.groovy b/site/src/site/pages/wiki.groovy
index ad62e6e..06110c5 100644
--- a/site/src/site/pages/wiki.groovy
+++ b/site/src/site/pages/wiki.groovy
@@ -1,5 +1,11 @@
import generator.DocUtils
-import org.asciidoctor.ast.DocumentHeader
+import org.asciidoctor.ast.Document
+
+modelTypes = {
+ Document doc
+ String title
+ String notes
+}
title = doc.structuredDoctitle.main
@@ -50,8 +56,9 @@ layout 'layouts/main.groovy', true,
i(authors.join(', '))
}
}
- if (doc.attributes.revisionInfo?.date) {
- p("Last update: ${doc.attributes.revisionInfo.date} (${doc.attributes.revisionInfo.remark?:'no comment'})")
+ def revInfo = doc.revisionInfo
+ if (revInfo?.date) {
+ p("Last update: ${revInfo.date} (${revInfo.remark?:'no comment'})")
}
hr()
yieldUnescaped notesAsHTML