Skip to content

Commit 22877df

Browse files
committed
HHH-19827 Apply Hibernate Asciidoctor extensions
1 parent 141c65c commit 22877df

File tree

5 files changed

+41
-0
lines changed

5 files changed

+41
-0
lines changed

documentation/documentation.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,7 @@ asciidoctorj {
231231
version '2.3.18'
232232
}
233233
}
234+
docExtensions project(':local-build-asciidoctor-extensions')
234235

235236
attributes icons: 'font',
236237
experimental: true,
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/*
2+
* SPDX-License-Identifier: Apache-2.0
3+
* Copyright Red Hat Inc. and Hibernate Authors
4+
*/
5+
6+
plugins {
7+
id "local.java-module"
8+
}
9+
10+
description = 'Asciidoctor extensions for Hibernate ORM'
11+
12+
dependencies {
13+
implementation "org.hibernate.infra:hibernate-asciidoctor-extensions:3.2.0.Final"
14+
implementation "org.asciidoctor:asciidoctorj:3.0.0"
15+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/*
2+
* SPDX-License-Identifier: Apache-2.0
3+
* Copyright Red Hat Inc. and Hibernate Authors
4+
*/
5+
package org.hibernate.orm.build.asciidoctor;
6+
7+
import org.hibernate.infra.asciidoctor.extensions.copytoclipboard.CopyToClipboardProcessor;
8+
import org.hibernate.infra.asciidoctor.extensions.customnumbering.CustomNumberingProcessor;
9+
10+
import org.asciidoctor.Asciidoctor;
11+
import org.asciidoctor.extension.JavaExtensionRegistry;
12+
import org.asciidoctor.jruby.extension.spi.ExtensionRegistry;
13+
14+
public class HibernateAsciidoctorExtensionRegistry implements ExtensionRegistry {
15+
16+
@Override
17+
public void register(Asciidoctor asciidoctor) {
18+
JavaExtensionRegistry javaExtensionRegistry = asciidoctor.javaExtensionRegistry();
19+
javaExtensionRegistry.docinfoProcessor( CopyToClipboardProcessor.class );
20+
javaExtensionRegistry.treeprocessor( CustomNumberingProcessor.class );
21+
}
22+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
org.hibernate.orm.build.asciidoctor.HibernateAsciidoctorExtensionRegistry

settings.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,8 @@ include 'hibernate-micrometer'
334334
include 'hibernate-graalvm'
335335
include 'hibernate-integrationtest-java-modules'
336336

337+
include 'local-build-asciidoctor-extensions'
338+
337339
include 'documentation'
338340
include 'release'
339341

0 commit comments

Comments
 (0)