Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 56 additions & 6 deletions documentation/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ plugins {
id "hr-java-library"
}

configurations {
themezip
}

dependencies {
themezip 'org.hibernate.infra:hibernate-asciidoctor-theme:6.0.0.Final@zip'
}

ext {
projectsToSkipWhenAggregatingJavadocs = [
'example',
Expand All @@ -21,6 +29,23 @@ rootProject.subprojects { subproject ->
}
}

// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Prepare the theme for Javadocs/Asciidoc
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tasks.register('unpackTheme', Copy) {
def unpackDir = rootProject.layout.buildDirectory.dir("unpacked-theme")

onlyIf {
!unpackDir.get().asFile.exists()
}
destinationDir = unpackDir.get().asFile

def zipFile = configurations.themezip.singleFile
from zipTree(zipFile)

dependsOn configurations.themezip
}

// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Aggregated JavaDoc
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down Expand Up @@ -50,6 +75,9 @@ def aggregateJavadocsTask = tasks.register( 'aggregateJavadocs', Javadoc ) {
windowTitle = 'Hibernate Reactive API documentation'
docTitle = "Hibernate Reactive API documentation ($project.version)"
bottom = "Copyright &copy; $inceptionYear-$currentYear <a href=\"http://redhat.com\">Red Hat, Inc</a>. All Rights Reserved."
// Pick the styles for the JDK that is used to "build" the Javadocs:
stylesheetFile = rootProject.layout.buildDirectory.dir("unpacked-theme").get()
.dir("hibernate-asciidoctor-theme").dir("javadoc").dir("jdk21").file("stylesheet.css").asFile
use = true
options.encoding = 'UTF-8'

Expand Down Expand Up @@ -90,6 +118,8 @@ def aggregateJavadocsTask = tasks.register( 'aggregateJavadocs', Javadoc ) {
classpath += subProject.sourceSets.main.output + subProject.sourceSets.main.compileClasspath
}
}

dependsOn 'unpackTheme'
}

// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand All @@ -104,27 +134,47 @@ asciidoctor {
def renderReferenceDocumentationTask = tasks.register( 'renderReferenceDocumentation', AsciidoctorTask ) {
description = 'Renders the Reference Documentation in HTML format using Asciidoctor.'
sourceDir = file( 'src/main/asciidoc/reference' )
asciidoctorj {
version '3.0.0'
docExtensions(project(':local-build-asciidoctor-extensions'))
}

sources {
include 'index.adoc'
}

resources {
from( sourceDir ) {
include 'images/**'
}
from(rootProject.layout.buildDirectory.dir("unpacked-theme").get()
.dir("hibernate-asciidoctor-theme").dir("asciidoc")) {
include 'css/**'
include 'images/**'
include 'script/**'
}
}

outputDir = project.layout.buildDirectory.dir( "asciidoc/reference/html_single" ).get().asFile
options logDocuments: true

attributes icons: 'font',
'source-highlighter': 'rouge',
experimental: true,
linkcss: true,
majorMinorVersion: project.projectVersion.family,
fullVersion: project.version.toString(),
docinfo: 'private'
'source-highlighter': 'rouge',
majorMinorVersion: project.projectVersion.family,
fullVersion: project.version.toString(),
stylesdir: "css",
'iconfont-remote': false,
'iconfont-name': 'font-awesome/css/solid',
docinfo: 'shared,private',
docinfodir: rootProject.layout.buildDirectory.dir("unpacked-theme").get()
.dir("hibernate-asciidoctor-theme").dir("asciidoc").dir("docinfo").dir('hibernate').asFile.absolutePath,
'html.meta.project-key': 'orm',
'html.outdated-content.project-key': 'orm',
'html-meta-description': 'Hibernate Reactive, reactive API for Hibernate ORM - Reference Documentation',
'html-meta-keywords': 'hibernate, reactive, hibernate reactive, database, db, vert.x',
'html-meta-version-family': project.projectVersion.family

dependsOn 'unpackTheme'
}

// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down
227 changes: 0 additions & 227 deletions documentation/src/main/asciidoc/reference/css/hibernate.css

This file was deleted.

Binary file not shown.
2 changes: 1 addition & 1 deletion documentation/src/main/asciidoc/reference/index.adoc
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
= Hibernate Reactive {fullVersion} Reference Documentation
Davide D'Alto <davide@hibernate.org>; Gavin King <gavin@hibernate.org>
:stylesheet: css/hibernate.css
:toc2:
:toclevels: 3
:sectanchors:
:sourcedir: src/main/asciidoc/reference
:leveloffset: +1
:version-selector-enabled: true

include::{sourcedir}/preface.adoc[]

Expand Down
15 changes: 15 additions & 0 deletions local-build-asciidoctor-extensions/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/*
* SPDX-License-Identifier: Apache-2.0
* Copyright Red Hat Inc. and Hibernate Authors
*/

plugins {
id "hr-java-library"
}

description = 'Asciidoctor extensions for Hibernate Reactive'

dependencies {
implementation "org.hibernate.infra:hibernate-asciidoctor-extensions:3.2.0.Final"
implementation "org.asciidoctor:asciidoctorj:3.0.0"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/* Hibernate, Relational Persistence for Idiomatic Java
*
* SPDX-License-Identifier: Apache-2.0
* Copyright: Red Hat Inc. and Hibernate Authors
*/
package org.hibernate.reactive.env.asciidoctor;

import org.hibernate.infra.asciidoctor.extensions.copytoclipboard.CopyToClipboardProcessor;
import org.hibernate.infra.asciidoctor.extensions.customnumbering.CustomNumberingProcessor;
// import org.hibernate.infra.asciidoctor.extensions.sourcecodelanguage.SourcecodeLanguagePreprocessor;

import org.asciidoctor.Asciidoctor;
import org.asciidoctor.extension.JavaExtensionRegistry;
import org.asciidoctor.jruby.extension.spi.ExtensionRegistry;

public class HibernateAsciidoctorExtensionRegistry implements ExtensionRegistry {

@Override
public void register(Asciidoctor asciidoctor) {
JavaExtensionRegistry javaExtensionRegistry = asciidoctor.javaExtensionRegistry();
javaExtensionRegistry.docinfoProcessor( CopyToClipboardProcessor.class );
javaExtensionRegistry.treeprocessor( CustomNumberingProcessor.class );
// javaExtensionRegistry.preprocessor( SourcecodeLanguagePreprocessor.class );
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
org.hibernate.reactive.env.asciidoctor.HibernateAsciidoctorExtensionRegistry
Loading
Loading