From 2276e2049d39c427cbac5210e4ff7f3f92bd4027 Mon Sep 17 00:00:00 2001 From: Gavin Date: Tue, 16 May 2023 19:47:14 +0200 Subject: [PATCH] integrate rouge source highlighter into adoc build this is needed because prettify does not seem to work for the PDF output (I have not dug deep) --- documentation/documentation.gradle | 11 ++++++++++- .../asciidoc/introduction/Hibernate_Introduction.adoc | 1 - 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/documentation/documentation.gradle b/documentation/documentation.gradle index d2bd5c334a..d44a0a4301 100644 --- a/documentation/documentation.gradle +++ b/documentation/documentation.gradle @@ -4,6 +4,12 @@ import org.asciidoctor.gradle.jvm.pdf.AsciidoctorPdfTask plugins { id 'org.asciidoctor.jvm.convert' version '3.3.2' id 'org.asciidoctor.jvm.pdf' version '3.3.2' + id "org.asciidoctor.jvm.gems" version "3.3.2" +} + +repositories { + mavenCentral() + ruby.gems() } /* @@ -39,6 +45,8 @@ dependencies { reportAggregation project(':hibernate-ant') reportAggregation project(':hibernate-enhance-maven-plugin') reportAggregation project(':hibernate-jpamodelgen') + + asciidoctorGems 'rubygems:rouge:4.1.1' } @@ -67,6 +75,7 @@ tasks.register('buildDocsForPublishing') { asciidoctorj { + requires 'rouge' modules { pdf { version '2.3.7' @@ -74,7 +83,7 @@ asciidoctorj { } attributes icons: 'font', experimental: true, - 'source-highlighter': 'prettify', + 'source-highlighter': 'rouge', majorMinorVersion: rootProject.ormVersion.family, fullVersion: rootProject.ormVersion.fullName diff --git a/documentation/src/main/asciidoc/introduction/Hibernate_Introduction.adoc b/documentation/src/main/asciidoc/introduction/Hibernate_Introduction.adoc index 65bbc49018..924d7df33b 100644 --- a/documentation/src/main/asciidoc/introduction/Hibernate_Introduction.adoc +++ b/documentation/src/main/asciidoc/introduction/Hibernate_Introduction.adoc @@ -339,7 +339,6 @@ public class Main { // export the inferred database schema sessionFactory.getSchemaManager().exportMappedObjects(true); - // persist an entity sessionFactory.inTransaction(session -> { session.persist(new Book("9781932394153", "Hibernate in Action"));