Skip to content

Commit

Permalink
[#1882] Update reference documentation style sheet
Browse files Browse the repository at this point in the history
* Replace `prettify` with `rouge` (solve the CSP error with prettify.css)
* Add Hibernate logo on top of the documentation page
* Apply some changes to the default CS
  • Loading branch information
DavideD committed Apr 17, 2024
1 parent a28b208 commit a8e757f
Show file tree
Hide file tree
Showing 5 changed files with 265 additions and 30 deletions.
15 changes: 12 additions & 3 deletions documentation/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,23 @@ task renderReferenceDocumentation(type: AsciidoctorTask, group: 'Documentation')
include 'index.adoc'
}

outputDir = new File("$buildDir/asciidoc/reference/html_single")
resources {
from(sourceDir) {
include 'images/**'
include 'css/**'
}
}

outputDir = new File("$buildDir/asciidoc/reference/html_single")
options logDocuments: true
attributes icons: 'font', experimental: true,
'source-highlighter': 'prettify',
attributes icons: 'font',
'source-highlighter': 'rouge',
experimental: true,
linkcss: true,
majorMinorVersion: project.version.family,
fullVersion: project.version.toString(),
docinfo: 'private'

}

// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down
227 changes: 227 additions & 0 deletions documentation/src/main/asciidoc/reference/css/hibernate.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,227 @@
/* Asciidoctor default stylesheets */
@import "https://fonts.googleapis.com/css?family=Open+Sans:300,300italic,400,400italic,600,600italic%7CNoto+Serif:400,400italic,700,700italic%7CDroid+Sans+Mono:400,700";
@import "https://cdn.jsdelivr.net/gh/asciidoctor/asciidoctor@2.0/data/stylesheets/asciidoctor-default.css";

body:before {
content: url(../images/hibernate_logo_smaller.png);
box-shadow: 0 2px 2px #ddd;
display: block;
padding: 20px 20px 10px 15px;
}

/*
* I'm using the '!important' because the plugin includes the hibernate.css file before the rouge one,
* I cannot override the default any other way.
* Everything else is the same as the default rouge CSS.
*/
pre.rouge .cm {
color: #999988;
font-style: italic;
}
pre.rouge .cp {
color: #999999;
font-weight: normal !important;
}
pre.rouge .c1 {
color: #999988;
font-style: italic;
}
pre.rouge .cs {
color: #999999;
font-weight: normal !important;
font-style: italic;
}
pre.rouge .c, pre.rouge .ch, pre.rouge .cd, pre.rouge .cpf {
color: #999988;
font-style: italic;
}
pre.rouge .err {
color: #a61717;
background-color: #e3d2d2;
}
pre.rouge .gd {
color: #000000;
background-color: #ffdddd;
}
pre.rouge .ge {
color: #000000;
font-style: italic;
}
pre.rouge .gr {
color: #aa0000;
}
pre.rouge .gh {
color: #999999;
}
pre.rouge .gi {
color: #000000;
background-color: #ddffdd;
}
pre.rouge .go {
color: #888888;
}
pre.rouge .gp {
color: #555555;
}
pre.rouge .gs {
font-weight: normal !important;
}
pre.rouge .gu {
color: #aaaaaa;
}
pre.rouge .gt {
color: #aa0000;
}
pre.rouge .kc {
color: #008 !important;
font-weight: normal !important;
}
pre.rouge .kd {
color: #008 !important;
font-weight: normal !important;
}
pre.rouge .kn {
color: #000000;
font-weight: normal !important;
}
pre.rouge .kp {
color: #000000;
font-weight: normal !important;
}
pre.rouge .kr {
color: #000000;
font-weight: normal !important;
}
pre.rouge .kt {
color: #445588;
font-weight: normal !important;
}
pre.rouge .k, pre.rouge .kv {
color: #606 !important;
font-weight: normal !important;
}
pre.rouge .mf {
color: #009999;
}
pre.rouge .mh {
color: #009999;
}
pre.rouge .il {
color: #009999;
}
pre.rouge .mi {
color: #009999;
}
pre.rouge .mo {
color: #009999;
}
pre.rouge .m, pre.rouge .mb, pre.rouge .mx {
color: #009999;
}
pre.rouge .sa {
color: #000000;
font-weight: normal !important;
}
pre.rouge .sb {
color: #d14;
}
pre.rouge .sc {
color: #d14;
}
pre.rouge .sd {
color: #d14;
}
pre.rouge .s2 {
color: #d14;
}
pre.rouge .se {
color: #d14;
}
pre.rouge .sh {
color: #d14;
}
pre.rouge .si {
color: #d14;
}
pre.rouge .sx {
color: #d14;
}
pre.rouge .sr {
color: #009926;
}
pre.rouge .s1 {
color: #d14;
}
pre.rouge .ss {
color: #990073;
}
pre.rouge .s, pre.rouge .dl {
color: #080 !important;
}
pre.rouge .na {
color: #000 !important;
}
pre.rouge .bp {
color: #999999;
}
pre.rouge .nb {
color: #0086B3;
}
pre.rouge .nc {
color: #606 !important;
font-weight: normal !important;
}
pre.rouge .no {
color: #008080;
}
pre.rouge .nd {
color: #066 !important;
font-weight: normal !important;
}
pre.rouge .ni {
color: #800080;
}
pre.rouge .ne {
color: #990000;
font-weight: normal !important;
}
pre.rouge .nf, pre.rouge .fm {
color: #990000;
font-weight: normal !important;
}
pre.rouge .nl {
color: #990000;
font-weight: normal !important;
}
pre.rouge .nn {
color: #555555;
}
pre.rouge .nt {
color: #000080;
}
pre.rouge .vc {
color: #008080;
}
pre.rouge .vg {
color: #008080;
}
pre.rouge .vi {
color: #008080;
}
pre.rouge .nv, pre.rouge .vm {
color: #008080;
}
pre.rouge .ow {
color: #000000;
font-weight: normal !important;
}
pre.rouge .o {
color: #000000;
font-weight: normal !important;
}
pre.rouge .w {
color: #bbbbbb;
}
pre.rouge {
background-color: #f8f8f8;
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 1 addition & 2 deletions documentation/src/main/asciidoc/reference/index.adoc
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
= Hibernate Reactive {fullVersion} Reference Documentation
Davide D'Alto <davide@hibernate.org>; Gavin King <gavin@hibernate.org>
:stylesheet: css/hibernate.css
:toc2:
:toclevels: 3
:sectanchors:
:source-highlighter: pygments
:sourcedir: src/main/asciidoc/reference

:leveloffset: +1

include::{sourcedir}/preface.adoc[]
Expand Down
Loading

0 comments on commit a8e757f

Please sign in to comment.