Skip to content

Commit 639ef36

Browse files
committed
[#1882] Update reference documentation style sheet
* 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
1 parent a28b208 commit 639ef36

File tree

5 files changed

+265
-30
lines changed

5 files changed

+265
-30
lines changed

documentation/build.gradle

+12-3
Original file line numberDiff line numberDiff line change
@@ -105,14 +105,23 @@ task renderReferenceDocumentation(type: AsciidoctorTask, group: 'Documentation')
105105
include 'index.adoc'
106106
}
107107

108-
outputDir = new File("$buildDir/asciidoc/reference/html_single")
108+
resources {
109+
from(sourceDir) {
110+
include 'images/**'
111+
include 'css/**'
112+
}
113+
}
114+
115+
outputDir = new File("$buildDir/asciidoc/reference/html_single")
109116
options logDocuments: true
110-
attributes icons: 'font', experimental: true,
111-
'source-highlighter': 'prettify',
117+
attributes icons: 'font',
118+
'source-highlighter': 'rouge',
119+
experimental: true,
112120
linkcss: true,
113121
majorMinorVersion: project.version.family,
114122
fullVersion: project.version.toString(),
115123
docinfo: 'private'
124+
116125
}
117126

118127
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,227 @@
1+
/* Asciidoctor default stylesheets */
2+
@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";
3+
@import "https://cdn.jsdelivr.net/gh/asciidoctor/[email protected]/data/stylesheets/asciidoctor-default.css";
4+
5+
body:before {
6+
content: url(../images/hibernate_logo_smaller.png);
7+
box-shadow: 0 2px 2px #ddd;
8+
display: block;
9+
padding: 20px 20px 10px 15px;
10+
}
11+
12+
/*
13+
* I'm using the '!important' because the plugin includes the hibernate.css file before the rouge one,
14+
* I cannot override the default any other way.
15+
* Everything else is the same as the default rouge CSS.
16+
*/
17+
pre.rouge .cm {
18+
color: #999988;
19+
font-style: italic;
20+
}
21+
pre.rouge .cp {
22+
color: #999999;
23+
font-weight: normal !important;
24+
}
25+
pre.rouge .c1 {
26+
color: #999988;
27+
font-style: italic;
28+
}
29+
pre.rouge .cs {
30+
color: #999999;
31+
font-weight: normal !important;
32+
font-style: italic;
33+
}
34+
pre.rouge .c, pre.rouge .ch, pre.rouge .cd, pre.rouge .cpf {
35+
color: #999988;
36+
font-style: italic;
37+
}
38+
pre.rouge .err {
39+
color: #a61717;
40+
background-color: #e3d2d2;
41+
}
42+
pre.rouge .gd {
43+
color: #000000;
44+
background-color: #ffdddd;
45+
}
46+
pre.rouge .ge {
47+
color: #000000;
48+
font-style: italic;
49+
}
50+
pre.rouge .gr {
51+
color: #aa0000;
52+
}
53+
pre.rouge .gh {
54+
color: #999999;
55+
}
56+
pre.rouge .gi {
57+
color: #000000;
58+
background-color: #ddffdd;
59+
}
60+
pre.rouge .go {
61+
color: #888888;
62+
}
63+
pre.rouge .gp {
64+
color: #555555;
65+
}
66+
pre.rouge .gs {
67+
font-weight: normal !important;
68+
}
69+
pre.rouge .gu {
70+
color: #aaaaaa;
71+
}
72+
pre.rouge .gt {
73+
color: #aa0000;
74+
}
75+
pre.rouge .kc {
76+
color: #008 !important;
77+
font-weight: normal !important;
78+
}
79+
pre.rouge .kd {
80+
color: #008 !important;
81+
font-weight: normal !important;
82+
}
83+
pre.rouge .kn {
84+
color: #000000;
85+
font-weight: normal !important;
86+
}
87+
pre.rouge .kp {
88+
color: #000000;
89+
font-weight: normal !important;
90+
}
91+
pre.rouge .kr {
92+
color: #000000;
93+
font-weight: normal !important;
94+
}
95+
pre.rouge .kt {
96+
color: #445588;
97+
font-weight: normal !important;
98+
}
99+
pre.rouge .k, pre.rouge .kv {
100+
color: #606 !important;
101+
font-weight: normal !important;
102+
}
103+
pre.rouge .mf {
104+
color: #009999;
105+
}
106+
pre.rouge .mh {
107+
color: #009999;
108+
}
109+
pre.rouge .il {
110+
color: #009999;
111+
}
112+
pre.rouge .mi {
113+
color: #009999;
114+
}
115+
pre.rouge .mo {
116+
color: #009999;
117+
}
118+
pre.rouge .m, pre.rouge .mb, pre.rouge .mx {
119+
color: #009999;
120+
}
121+
pre.rouge .sa {
122+
color: #000000;
123+
font-weight: normal !important;
124+
}
125+
pre.rouge .sb {
126+
color: #d14;
127+
}
128+
pre.rouge .sc {
129+
color: #d14;
130+
}
131+
pre.rouge .sd {
132+
color: #d14;
133+
}
134+
pre.rouge .s2 {
135+
color: #d14;
136+
}
137+
pre.rouge .se {
138+
color: #d14;
139+
}
140+
pre.rouge .sh {
141+
color: #d14;
142+
}
143+
pre.rouge .si {
144+
color: #d14;
145+
}
146+
pre.rouge .sx {
147+
color: #d14;
148+
}
149+
pre.rouge .sr {
150+
color: #009926;
151+
}
152+
pre.rouge .s1 {
153+
color: #d14;
154+
}
155+
pre.rouge .ss {
156+
color: #990073;
157+
}
158+
pre.rouge .s, pre.rouge .dl {
159+
color: #080 !important;
160+
}
161+
pre.rouge .na {
162+
color: #000 !important;
163+
}
164+
pre.rouge .bp {
165+
color: #999999;
166+
}
167+
pre.rouge .nb {
168+
color: #0086B3;
169+
}
170+
pre.rouge .nc {
171+
color: #606 !important;
172+
font-weight: normal !important;
173+
}
174+
pre.rouge .no {
175+
color: #008080;
176+
}
177+
pre.rouge .nd {
178+
color: #066 !important;
179+
font-weight: normal !important;
180+
}
181+
pre.rouge .ni {
182+
color: #800080;
183+
}
184+
pre.rouge .ne {
185+
color: #990000;
186+
font-weight: normal !important;
187+
}
188+
pre.rouge .nf, pre.rouge .fm {
189+
color: #990000;
190+
font-weight: normal !important;
191+
}
192+
pre.rouge .nl {
193+
color: #990000;
194+
font-weight: normal !important;
195+
}
196+
pre.rouge .nn {
197+
color: #555555;
198+
}
199+
pre.rouge .nt {
200+
color: #000080;
201+
}
202+
pre.rouge .vc {
203+
color: #008080;
204+
}
205+
pre.rouge .vg {
206+
color: #008080;
207+
}
208+
pre.rouge .vi {
209+
color: #008080;
210+
}
211+
pre.rouge .nv, pre.rouge .vm {
212+
color: #008080;
213+
}
214+
pre.rouge .ow {
215+
color: #000000;
216+
font-weight: normal !important;
217+
}
218+
pre.rouge .o {
219+
color: #000000;
220+
font-weight: normal !important;
221+
}
222+
pre.rouge .w {
223+
color: #bbbbbb;
224+
}
225+
pre.rouge {
226+
background-color: #f8f8f8;
227+
}
Loading

documentation/src/main/asciidoc/reference/index.adoc

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
= Hibernate Reactive {fullVersion} Reference Documentation
22
Davide D'Alto <davide@hibernate.org>; Gavin King <gavin@hibernate.org>
3+
:stylesheet: css/hibernate.css
34
:toc2:
45
:toclevels: 3
56
:sectanchors:
6-
:source-highlighter: pygments
77
:sourcedir: src/main/asciidoc/reference
8-
98
:leveloffset: +1
109

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

0 commit comments

Comments
 (0)