You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Tutorials, living in `docs/tutorials`. Output: HTML, PDF, EPUB and Kindle. Given their length,
17
-
tutorials use their own HTML style, with an index frame on the left side.
18
-
* Articles, living in `docs/articles`. Output: HTML only. Articles are output with the same
19
-
HTML style as the rest of the Thymeleaf web site.
17
+
* Tutorials, living in `docs/tutorials`. Output: HTML, PDF, EPUB and Kindle.
18
+
Given their length, tutorials use their own HTML style, with an index frame
19
+
on the left side.
20
+
* Articles, living in `docs/articles`. Output: HTML only. Articles are output
21
+
with the same HTML style as the rest of the Thymeleaf web site.
20
22
21
23
22
24
Setup
23
25
-----
24
26
25
-
(I'm going to assume you've got a working Java 6+ environment.)
26
-
27
-
1. Download and install **Gradle**: http://www.gradle.org/downloads
28
-
2. Download and install **Pandoc** for your environment: http://johnmacfarlane.net/pandoc/installing.html
29
-
(PDF output is not done using Pandoc, so you don't need to get LaTeX.). You will need version 1.12 or
30
-
newer of pandoc, as it fixes some important bugs.
31
-
3. Download and install **wkhtmltopdf** for your environment: http://wkhtmltopdf.org/downloads.html.
32
-
wkhtmltopdf is used for rendering PDF files from pandoc's HTML output, so you might not need it if you
33
-
are not interested on PDF output.
34
-
4. Download and install **Calibre** for your environment: http://calibre-ebook.com/download. Calibre is used
35
-
for conversion of pandoc's `.epub` output (e-book) into `.mobi` files (Kindle format), so you might not need it if you
36
-
are not interested on e-book output.
37
-
38
-
Optional: If you want to be able to import this project into Eclipse or run the
39
-
Gradle job from Eclipse, then install the Groovy-Eclipse and Gradle IDE
27
+
Java 8+ required. The build process is often run on machines with Java 11.
28
+
29
+
1. Download and install **Gradle**: http://www.gradle.org/install
30
+
2. Download and install **Pandoc**: http://johnmacfarlane.net/pandoc/installing.html
31
+
(PDF output is not done using Pandoc, so you don't need to get LaTeX.). You
32
+
will need version 2.2.1 or newer.
33
+
3. Optional: download and install **wkhtmltopdf**: http://wkhtmltopdf.org/downloads.html.
34
+
wkhtmltopdf is used for rendering PDF files from pandoc's HTML output.
35
+
4. Optional: download and install **Calibre**: http://calibre-ebook.com/download.
36
+
Calibre is used for conversion of pandoc's `.epub` output (e-book) into
37
+
`.mobi` files (Kindle format).
38
+
39
+
Additionally, if you want to be able to import this project into Eclipse or run
40
+
the Gradle tasks from Eclipse, then install the Groovy-Eclipse and Gradle IDE
40
41
components from the [Spring Tool Suite](http://www.springsource.org/sts).
42
+
IntelliJ IDEA has support for Gradle tasks through its built-in Gradle plugin.
41
43
42
44
43
45
Generating the documentation
@@ -52,36 +54,33 @@ sources to HTML, e-books and PDF. The following Gradle tasks perform these jobs:
52
54
*`generateDocsEbook` - Create the e-books.
53
55
*`generateDocs` - Creates all docs
54
56
55
-
The generated docs will end up in the `build/site/doc` directory. The entire `build/site`
56
-
directory will be prepared for direct copy (`cp -R`) to the Thymeleaf website repository
57
-
(`thymeleaf.github.com`) for publishing, and it will also contain several `.html` files
58
-
in the `build/site` and `build/site/doc/html` directories acting as *redirects* from old
59
-
locations of documentation files to the new ones (GitHub pages does not support any other kind
60
-
of redirects).
57
+
The generated docs will end up in the `build/site/doc` directory. The entire
58
+
`build/site` directory will be prepared for direct copy (`cp -R`) to the
59
+
Thymeleaf website repository (`thymeleaf.github.com`) for publishing.
61
60
62
61
### Updating the docs for a new version
63
62
64
63
To change the version number that appears in the generated docs, update the
65
-
`project.version` property in the `build.gradle` script. The `project.documentDate`
66
-
property should also be changed to reflect the new date the generated documents should
64
+
`project.version` property in the `build.gradle` script. The `documentDate` var
65
+
should also be changed to reflect the new date the generated documents should
67
66
refer to.
68
67
69
68
70
69
How the docs are generated
71
70
--------------------------
72
71
73
-
**Pandoc** is used to convert the Markdown sources into HTML, using the appropriate
74
-
HTML template in the `templates` directory, which in turn also makes use of JavaScript and CSS
75
-
files copied from the `scripts` and `styles` directories.
72
+
**Pandoc** is used to convert the Markdown sources into HTML, using the
73
+
appropriate HTML template in the `templates` directory, which in turn make use
74
+
of JavaScript and CSS files copied from the `scripts` and `styles` directories.
76
75
77
76
**Pandoc** is also used to generate e-books in EPUB format.
78
77
79
78
**Calibre** is used to convert e-books to MOBI (Kindle) format.
80
79
81
-
**wkhtmltopdf** is used to then create PDF versions of the HTML docs based on the
82
-
`media="print"` stylesheet instead of the `media="screen"` one you normally see when opening it in
83
-
your browser. This task performs a workaround of launching a **Jetty** server to
84
-
temporarily host the HTML files since wkhtmltopdf uses **WebKit** and not using a server would prevent many of the JavaScript files in the HTML documentation from running due
85
-
to WebKit's same-origin policies being stricter with the `file://` protocol.
86
-
87
-
80
+
**wkhtmltopdf** is used to create PDF versions of the HTML docs based on the
81
+
`media="print"` stylesheet instead of the `media="screen"` one you normally see
82
+
when opening it in your browser. The PDF generation task also launches a
83
+
**Jetty** server to host the HTML files since wkhtmltopdf uses **WebKit** and
84
+
not using a server would prevent many of the JavaScript files in the HTML
85
+
documentation from running due to WebKit's same-origin policies being stricter
0 commit comments