Skip to content

Commit 711786c

Browse files
committed
Add docs
1 parent f643155 commit 711786c

File tree

10 files changed

+496
-0
lines changed

10 files changed

+496
-0
lines changed

build.gradle

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,3 +281,36 @@ subprojects { Project subproject ->
281281
}
282282

283283
}
284+
285+
def cleanTask = project.tasks.findByName('clean')
286+
if (cleanTask == null) {
287+
task clean(type: Delete) {
288+
delete(buildDir)
289+
}
290+
}
291+
else {
292+
cleanTask.doLast {
293+
ant.delete(dir: 'build/docs')
294+
}
295+
}
296+
297+
tasks.withType(Groovydoc) {
298+
group = 'Documentation'
299+
docTitle = "Grace Data Examples - ${project.version}"
300+
destinationDir = project.file('build/docs/manual/api')
301+
def files = []
302+
if (project.file('src/main/groovy').exists()) {
303+
files += project.files('src/main/groovy')
304+
}
305+
source = files
306+
classpath += configurations.documentation
307+
}
308+
309+
publishGuide {
310+
dependsOn groovydoc
311+
sourceDir = project.file('src/docs')
312+
}
313+
314+
task docs {
315+
dependsOn groovydoc, publishGuide
316+
}

src/docs/guide/introduction.adoc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
https://graceframework.org/grace-data-examples/2024.0.x/[This repository] contains example projects for the different Grace Data modules to showcase the API and how to use the features provided by the modules.
2+
3+
* https://graceframework.org/grace-data-hibernate/2024.0.x/[Grace Data Hibernate]
4+
* https://graceframework.org/grace-data-mongodb/2024.0.x/[Grace Data MongoDB]

src/docs/guide/support.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
For support, please use the https://github.com/orgs/graceframework/discussions[Grace Discussions] or open an issue on link:{github}/issues[Github Issues].

src/docs/guide/toc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
introduction: Introduction
2+
support: Support

src/docs/resources/css/custom.css

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#colset #col2 {
2+
display: none !important;
3+
}
4+
5+
#toggle-col1 {
6+
display: none !important;
7+
}
8+
9+
#nav-summary #nav-summary-childs {
10+
position: absolute;
11+
top: 32px;
12+
margin-left: -54px !important;
13+
}

src/docs/resources/doc.properties

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
api=../api
2+
tags=../ref/Tags
3+
guide=../../guide
4+
github=https://github.com/graceframework/grace-data-examples
5+
gormapi=https://graceframework.org/grace-data/2024.0.x/api
6+
sourcedir=.
7+
sourceRepo=https://github.com/graceframework/grace-data-examples/edit/2024.0.x/src/docs
8+
safe=UNSAFE
9+
title=Grace Data Examples
10+
subtitle=Example projects for the different Grace Data modules to showcase the API and how to use the features provided by the modules.
11+
authors=Michael Yan
12+
copyright=Copyright © 2022-2025 Michael Yan and the original authors. The content is licensed under a Creative Commons Attribution 4.0 International (CC BY SA 4.0) license.

src/docs/resources/index.html

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
2+
"http://www.w3.org/TR/html4/loose.dtd">
3+
4+
<html lang="en">
5+
<head>
6+
<meta http-equiv="refresh" content="0; url=manual/" />
7+
</head>
8+
9+
</body>
10+
</html>
Lines changed: 150 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,150 @@
1+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
4+
<head>
5+
<title>${sectionNumber} ${title.encodeAsHtml()} ${version}</title>
6+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
7+
<link rel="stylesheet" href="${resourcesPath}/css/main.css" type="text/css" media="screen, print" title="Style" charset="utf-8"/>
8+
<link rel="stylesheet" href="${resourcesPath}/css/pdf.css" type="text/css" media="print" title="PDF" charset="utf-8"/>
9+
<script type="text/javascript">
10+
function addJsClass() {
11+
var classes = document.body.className.split(" ");
12+
classes.push("js");
13+
document.body.className = classes.join(" ");
14+
}
15+
</script>
16+
</head>
17+
18+
<body class="body" onload="addJsClass();">
19+
<div id="navigation">
20+
<div class="navHeader">
21+
<% if (logo) { %>
22+
<span id="logo">${logo}</span>
23+
<% } else { %>
24+
<span id="logo">
25+
<a href="https://graceframework.org" title="Grace Framework Website">
26+
<img src="${resourcesPath}/img/grace.svg" alt="Grace Framework" />
27+
</a>
28+
</span>
29+
<% } %>
30+
<div class="docHeader">
31+
<h1 class="docTitle">${docTitle.encodeAsHtml()}</h1>
32+
<h3 class="docSubTitle">${subtitle.encodeAsHtml()}</h3>
33+
</div>
34+
</div>
35+
<div class="navLinks">
36+
<ul>
37+
<li>
38+
<div id="nav-summary" onmouseover="toggleNavSummary(false)" onmouseout="toggleNavSummary(true)">
39+
<a href="${path}/guide/index.html" class="button">Table of contents</a>
40+
41+
<div id="nav-summary-childs" style="display:none;">
42+
<% toc.children.eachWithIndex { ch, i -> %>
43+
<div class="toc-item" style="margin-left:0"><a href="${path}/guide/${ch.name.encodeAsUrlPath().encodeAsHtml()}.html"><strong>${i + 1}</strong><span>${ch.title.encodeAsHtml()}</span></a>
44+
</div>
45+
<% } %>
46+
</div>
47+
</div>
48+
</li>
49+
<!-- <li class="separator selected">
50+
<a id="ref-button" onclick="localToggle(); return false;" href="#">Quick Reference</a>
51+
</li> -->
52+
<li class="separator selected">
53+
<a id="ref-button" href="${resourcesPath}/api/index.html">API Docs</a>
54+
</li>
55+
</ul>
56+
</div>
57+
58+
59+
</div>
60+
61+
<table id="colset" border="0" cellpadding="0" cellspacing="0">
62+
<tr>
63+
<td id="col1">
64+
<div id="main" class="corner-all">
65+
66+
<% if(prev){ %>
67+
<div class="toc-item prev-left"><a href="${path}/guide/${prev?.name?.encodeAsUrlPath()?.encodeAsHtml()}.html">&lt;&lt; <strong>${chapterNumber - 1}</strong><span>${prev?.title?.encodeAsHtml()}</span></a></div>
68+
<% } %>
69+
70+
<span id='toggle-col1' class="toggle">(<a href="#" onclick="localToggle(); return false;">Quick Reference</a>)</span>
71+
72+
<% if(next){ %>
73+
<div class="toc-item next-right"><a href="${path}/guide/${next?.name?.encodeAsUrlPath()?.encodeAsHtml()}.html"><strong>${chapterNumber + 1}</strong><span>${next?.title?.encodeAsHtml()}</span> >></a></div>
74+
<% } %>
75+
76+
77+
<div class="project">
78+
<h1>${sectionNumber} ${title.encodeAsHtml()}</h1>
79+
80+
<p><strong>Version:</strong> ${version}</p>
81+
</div>
82+
83+
<% if (sectionToc) { %>
84+
<div id="table-of-content">
85+
<h2>Table of Contents</h2>
86+
<%
87+
sectionWriter = { lvl, section, prefix ->
88+
%>
89+
<div class="toc-item" style="margin-left:${lvl * 10}px"><a href="#${ section.name.encodeAsUrlFragment().encodeAsHtml() }"><strong>$prefix</strong><span>${section.title?.encodeAsHtml()}</span></a>
90+
</div>
91+
<%
92+
lvl++
93+
section.children.eachWithIndex { s, j ->
94+
sectionWriter.call(lvl, s, prefix + '.' + (j + 1))
95+
}
96+
}
97+
98+
sectionToc.eachWithIndex { s, i ->
99+
sectionWriter.call(0, s, chapterNumber + '.' + (i + 1))
100+
}
101+
%>
102+
</div>
103+
<% } %>
104+
105+
${content}
106+
107+
<div style="clear:both;margin-top:15px;"></div>
108+
<% if(prev){ %>
109+
<div class="toc-item prev-left"><a href="${path}/guide/${prev?.name?.encodeAsUrlPath()?.encodeAsHtml()}.html">&lt;&lt; <strong>${chapterNumber - 1}</strong><span>${prev?.title?.encodeAsHtml()}</span></a></div>
110+
<% }
111+
if(next){ %>
112+
<div class="toc-item next-right"><a href="${path}/guide/${next?.name?.encodeAsUrlPath()?.encodeAsHtml()}.html"><strong>${chapterNumber + 1}</strong><span>${next?.title?.encodeAsHtml()}</span> >></a></div>
113+
<% } %>
114+
<div style="clear:both"></div>
115+
</div>
116+
</td>
117+
<td id="col2">
118+
<div class="local clearfix">
119+
<div class="local-title">
120+
<a href="${path}/guide/index.html" target="mainFrame">Quick Reference</a>
121+
<span class="toggle">(<a href="#" onclick="localToggle(); return false;">hide</a>)</span>
122+
</div>
123+
<div class="menu">
124+
<% for (cat in refMenu) { %>
125+
<div class="menu-block"><h1 class="menu-title" onclick="toggleRef(this.parentNode.childNodes[1])">${cat.name.encodeAsHtml()}</h1><div class="menu-sub">
126+
<% if (cat.usage.exists()) { %>
127+
<div class="menu-item"><a href="${path}/ref/${cat.name.encodeAsUrlPath().encodeAsHtml()}/Usage.html">Usage</a></div>
128+
<% } %>
129+
<% for (txt in cat.sections) { %>
130+
<div class="menu-item"><a href="${path}/ref/${cat.name.encodeAsUrlPath().encodeAsHtml()}/${txt.name[0..-6].encodeAsUrlPath().encodeAsHtml()}.html">${txt.name[0..-6].encodeAsHtml()}</a>
131+
</div>
132+
<% } %>
133+
</div>
134+
</div>
135+
<% } %>
136+
</div>
137+
</div>
138+
</td>
139+
</tr>
140+
</table>
141+
142+
<div id="footer">
143+
${copyright}
144+
${footer}
145+
</div>
146+
147+
<script type="text/javascript" src="${resourcesPath}/js/docs.js"></script>
148+
149+
</body>
150+
</html>
Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
1+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
4+
<head>
5+
<title>${title.encodeAsHtml()} ${version}</title>
6+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
7+
<link rel="stylesheet" href="${resourcesPath}/css/main.css" type="text/css" media="screen, print" title="Style" charset="utf-8" />
8+
<link rel="stylesheet" href="${resourcesPath}/css/pdf.css" type="text/css" media="print" title="PDF" charset="utf-8" />
9+
<script type="text/javascript">
10+
function addJsClass(el) {
11+
var classes = document.body.className.split(" ");
12+
classes.push("js");
13+
document.body.className = classes.join(" ");
14+
}
15+
</script>
16+
</head>
17+
18+
<body class="body" onload="addJsClass();">
19+
<div id="navigation">
20+
<div class="navHeader">
21+
<% if (logo) { %>
22+
<span id="logo">${logo}</span>
23+
<% } else { %>
24+
<span id="logo">
25+
<a href="https://graceframework.org" title="Go to Grace Framework Website">
26+
<img src="${resourcesPath}/img/grace.svg" alt="Grace Framework" />
27+
</a>
28+
</span>
29+
<% } %>
30+
<div class="docHeader">
31+
<h1 class="docTitle">${docTitle.encodeAsHtml()}</h1>
32+
<h3 class="docSubTitle">${subtitle.encodeAsHtml()}</h3>
33+
<span class="docVersion">${version}</span>
34+
</div>
35+
</div>
36+
<div class="navLinks">
37+
<ul>
38+
<li>
39+
<div id="nav-summary" onmouseover="toggleNavSummary(false)" onmouseout="toggleNavSummary(true)">
40+
<a href="${path}/guide/index.html" class="button">Table of contents</a>
41+
<div id="nav-summary-childs" style="display:none;">
42+
<%
43+
toc.children.eachWithIndex { ch, i ->
44+
if (single) {
45+
%>
46+
<div class="toc-item" style="margin-left:0"><a href="#${ ch.name.encodeAsUrlFragment().encodeAsHtml() }"><strong>${i + 1}</strong><span>${ch.title?.encodeAsHtml()}</span></a></div>
47+
<%
48+
}
49+
else {
50+
%>
51+
<div class="toc-item" style="margin-left:0"><a href="${path}/guide/${ch.name.encodeAsUrlPath().encodeAsHtml()}.html"><strong>${i + 1}</strong><span>${ch.title?.encodeAsHtml()}</span></a></div>
52+
<%
53+
}
54+
}
55+
%>
56+
</div>
57+
</div>
58+
</li>
59+
<!-- <li class="separator selected">
60+
<a id="ref-button" onclick="localToggle(); return false;" href="#">Quick Reference</a>
61+
</li> -->
62+
<li class="separator selected">
63+
<a id="ref-button" href="${resourcesPath}/api/index.html">API Docs</a>
64+
</li>
65+
</ul>
66+
67+
</div>
68+
</div>
69+
70+
<table id="colset" cellpadding="0" cellspacing="0">
71+
<tr>
72+
<td id="col1">
73+
<div id="main" class="corner-all">
74+
75+
<span id='toggle-col1' class="toggle">(<a href="#" onclick="localToggle(); return false;">Quick Reference</a>)</span>
76+
77+
<div class="project">
78+
<h1>${title.encodeAsHtml()}</h1>
79+
<p><strong>Authors:</strong> ${authors}</p>
80+
<p><strong>Version:</strong> ${version}</p>
81+
<% if (translators) { %>
82+
<p><strong>Translated by:</strong> ${translators}</p>
83+
<% } %>
84+
</div>
85+
86+
<% if(toc){ %>
87+
<div id="table-of-content">
88+
<h2>Table of Contents</h2>
89+
<%
90+
sectionWriter = { lvl, section, topSection, prefix ->
91+
if (single) {
92+
%>
93+
<div class="toc-item" style="margin-left:${lvl * 10}px"><a href="#${ section.name.encodeAsUrlFragment().encodeAsHtml() }"><strong>$prefix</strong><span>${section.title?.encodeAsHtml()}</span></a></div>
94+
<%
95+
}
96+
else {
97+
%>
98+
<div class="toc-item" style="margin-left:${lvl * 10}px"><a href="${path}/guide/${topSection.name.encodeAsUrlPath().encodeAsHtml()}.html${ lvl == 0 ? '' : '#' + section.name.encodeAsUrlFragment().encodeAsHtml() }"><strong>$prefix</strong><span>${section.title?.encodeAsHtml()}</span></a></div>
99+
<%
100+
}
101+
102+
lvl++
103+
section.children.eachWithIndex { s, j ->
104+
sectionWriter.call(lvl, s, topSection, prefix + '.' + (j + 1))
105+
}
106+
}
107+
108+
toc.children.eachWithIndex { topSection, i ->
109+
sectionWriter.call(0, topSection, topSection, i + 1)
110+
}
111+
%>
112+
<div style="clear:both" ></div>
113+
</div>
114+
<% } %>
115+
${content}
116+
</div>
117+
</td>
118+
<td id="col2">
119+
<div class="local clearfix">
120+
<div class="local-title">
121+
<a href="${path}/guide/index.html" target="mainFrame">Quick Reference</a>
122+
<span class="toggle">(<a href="#" onclick="localToggle(); return false;">hide</a>)</span>
123+
</div>
124+
<div class="menu">
125+
<% for (cat in refMenu) { %>
126+
<div class="menu-block"><h1 class="menu-title" onclick="toggleRef(this.parentNode.childNodes[1])">${cat.name.encodeAsHtml()}</h1><div class="menu-sub">
127+
<% if (cat.usage.exists()) { %>
128+
<div class="menu-item"><a href="${path}/ref/${cat.name.encodeAsUrlPath().encodeAsHtml()}/Usage.html">Usage</a></div>
129+
<% } %>
130+
<% for (txt in cat.sections) { %>
131+
<div class="menu-item"><a href="${path}/ref/${cat.name.encodeAsUrlPath().encodeAsHtml()}/${txt.name[0..-6].encodeAsUrlPath().encodeAsHtml()}.html">${txt.name[0..-6].encodeAsHtml()}</a>
132+
</div>
133+
<% } %>
134+
</div>
135+
</div>
136+
<% } %>
137+
</div>
138+
</div>
139+
</td>
140+
</tr>
141+
</table>
142+
143+
<div id="footer">
144+
${copyright}
145+
${footer}
146+
</div>
147+
148+
<script type="text/javascript" src="${resourcesPath}/js/docs.js"></script>
149+
150+
</body>
151+
</html>

0 commit comments

Comments
 (0)