Skip to content

Commit

Permalink
'Update docs'
Browse files Browse the repository at this point in the history
  • Loading branch information
ultraq committed Feb 1, 2025
0 parents commit bcce468
Show file tree
Hide file tree
Showing 88 changed files with 21,904 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
source 'https://rubygems.org'

gem "jekyll"
gem "jekyll-redirect-from"
gem "jekyll-remote-theme"
gem "jekyll-seo-tag"
gem "rake"
gem "webrick"
87 changes: 87 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
GEM
remote: https://rubygems.org/
specs:
addressable (2.8.0)
public_suffix (>= 2.0.2, < 5.0)
colorator (1.1.0)
concurrent-ruby (1.1.9)
em-websocket (0.5.2)
eventmachine (>= 0.12.9)
http_parser.rb (~> 0.6.0)
eventmachine (1.2.7)
ffi (1.15.3)
forwardable-extended (2.6.0)
http_parser.rb (0.6.0)
i18n (1.8.10)
concurrent-ruby (~> 1.0)
jekyll (4.2.0)
addressable (~> 2.4)
colorator (~> 1.0)
em-websocket (~> 0.5)
i18n (~> 1.0)
jekyll-sass-converter (~> 2.0)
jekyll-watch (~> 2.0)
kramdown (~> 2.3)
kramdown-parser-gfm (~> 1.0)
liquid (~> 4.0)
mercenary (~> 0.4.0)
pathutil (~> 0.9)
rouge (~> 3.0)
safe_yaml (~> 1.0)
terminal-table (~> 2.0)
jekyll-redirect-from (0.16.0)
jekyll (>= 3.3, < 5.0)
jekyll-remote-theme (0.4.3)
addressable (~> 2.0)
jekyll (>= 3.5, < 5.0)
jekyll-sass-converter (>= 1.0, <= 3.0.0, != 2.0.0)
rubyzip (>= 1.3.0, < 3.0)
jekyll-sass-converter (2.1.0)
sassc (> 2.0.1, < 3.0)
jekyll-seo-tag (2.7.1)
jekyll (>= 3.8, < 5.0)
jekyll-watch (2.2.1)
listen (~> 3.0)
kramdown (2.3.1)
rexml
kramdown-parser-gfm (1.1.0)
kramdown (~> 2.0)
liquid (4.0.3)
listen (3.5.1)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
mercenary (0.4.0)
pathutil (0.16.2)
forwardable-extended (~> 2.6)
public_suffix (4.0.6)
rake (13.0.6)
rb-fsevent (0.11.0)
rb-inotify (0.10.1)
ffi (~> 1.0)
rexml (3.2.5)
rouge (3.26.0)
rubyzip (2.3.2)
safe_yaml (1.0.5)
sassc (2.4.0)
ffi (~> 1.9)
terminal-table (2.0.0)
unicode-display_width (~> 1.1, >= 1.1.1)
unicode-display_width (1.7.0)
webrick (1.7.0)

PLATFORMS
arm64-darwin-21
x64-mingw32
x86_64-darwin-19
x86_64-darwin-20

DEPENDENCIES
jekyll
jekyll-redirect-from
jekyll-remote-theme
jekyll-seo-tag
rake
webrick

BUNDLED WITH
2.3.5
15 changes: 15 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
title: Thymeleaf Layout Dialect
description: A dialect for Thymeleaf that lets you build layouts and reusable templates in order to improve code reuse
lang: en-NZ
baseurl: /thymeleaf-layout-dialect
permalink: pretty
remote_theme: pmarsceill/just-the-docs@v0.3.1-r
color_scheme: thymeleaf
aux_links:
"GitHub":
- https://github.com/ultraq/thymeleaf-layout-dialect
"GroovyDoc/API":
- /thymeleaf-layout-dialect/groovydoc/
plugins:
- jekyll-redirect-from
- jekyll-remote-theme
2 changes: 2 additions & 0 deletions _sass/color_schemes/thymeleaf.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

$link-color: lighten(#005f0f, 10%); // The Thymeleaf link colour
21 changes: 21 additions & 0 deletions _sass/custom/custom.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@

blockquote {
border-left: 0.25em solid $border-color;
margin: 0;
padding: 0 1em;
}

code {
font-size: 0.8em;
}

.site-title {
@media (min-width: 50rem) {
font-size: 17px !important;
padding-right: 1rem;
}
}

.navigation-list-child-list {
display: block !important;
}
102 changes: 102 additions & 0 deletions configuration-options.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
---
layout: default
title: Configuration options
nav_order: 4
---

Configuration options
=====================
{: .no_toc }


On this page
------------
{: .no_toc .text-delta }

1. TOC
{:toc}


To configure the layout dialect, you have 2 options:
- the constructor with arguments, `LayoutDialect(SortingStrategy, boolean)`
- the fluent API methods `withAutoHeadMerging`, `withExperimentalTitleTokens`,
and `withSortingStrategy`

> Note that the fluent API is currently the only way to enable the `experimentatlTitleTokens`
> setting. With the number of options growing, the constructor might be
> deprecated in favour of the fluent API methods in a future release.

`sortingStrategy`
-----------------

Default: `ApendingStrategy`

```java
new LayoutDialect(new AppendingStrategy());
// or
new LayoutDialect().withSortingStrategy(new AppendingStrategy());
```

Sets how `<head>` elements will be sorted when combined from the layout and
content templates. See [the decorate processor page]({{ site.baseurl }}{% link processors/decorate.md %})
for more details and examples.


`autoHeadMerging`
-----------------

Default: `true`

```java
new LayoutDialect(null, true);
// or
new LayoutDialect().withAutoHeadMerging(true);
```

Bypass the layout dialect prforming any `<head>` element merging altogether.
See [Bypassing <head> element merging altogether]({{ site.baseurl }}{% link processors/decorate.md %}#bypassing-head-element-merging-altogether)
for more details.


`experimentalTitleTokens`
-------------------------

Default: `false`

```java
new LayoutDialect().withExperimentalTitleTokens(false);
```

An experimental option added in 3.4.0 to use standard Thymeleaf expression
syntax for title patterns and to have access to the title parts in templates as
the variables `layoutDialectLayoutTitle` and `layoutDialectContentTitle` (the
names are pretty verbose but I want to avoid any potential clashes while I
either come up with new ones or some way to configure the names).

So instead of the example in [Processors > title-pattern]({{ site.baseurl }}{% link processors/title-pattern.md %})
for setting what the final title will look like:

```html
<title layout:title-pattern="$LAYOUT_TITLE - $CONTENT_TITLE">...</title>
```

You can do this instead:

```html
<title layout:title="|${layoutDialectLayoutTitle} - ${layoutDialectContentTitle}|">...</title>
```

The title parts will also be made available anywhere in the template as the
variables above, so you can reference them as necessary:

```html
<body>
<p>The title of my page is
<span th:text="${layoutDialectContentTitle}">(title here)</span>
<p>
</body>
```

Any feedback for this experimental option can be made in
[thymeleaf-layout-dialect/issues/172](https://github.com/ultraq/thymeleaf-layout-dialect/issues/172)
Binary file added favicon.ico
Binary file not shown.
62 changes: 62 additions & 0 deletions getting-started.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
---
layout: default
title: Getting started
nav_order: 2
redirect_from:
- /Installation.html
---

Getting started
===============
{: .no_toc }


On this page
------------
{: .no_toc .text-delta }

1. TOC
{:toc}


Installation
------------

A minimum of Java 8 and Thymeleaf 3.x is required. Add the layout dialect by
configuring Maven or your Maven-compatible dependency manager to the following
co-ordinates:

- GroupId: `nz.net.ultraq.thymeleaf`
- ArtifactId: `thymeleaf-layout-dialect`
- Version: `3.4.0`

Check the [project releases](https://github.com/ultraq/thymeleaf-layout-dialect/releases)
for a list of available versions. Each release page also includes a
downloadable JAR if you want to manually add it to your project classpath.


Usage
-----

Configure Thymeleaf to include the layout dialect using one of the methods below:

- Spring or Spring Boot w/ Java/annotation config:
```java
@Bean
public LayoutDialect layoutDialect() {
return new LayoutDialect();
}
```

- DIY management of the Thymeleaf template engine:
```java
TemplateEngine templateEngine = new TemplateEngine();
templateEngine.addDialect(new LayoutDialect());
```

This will introduce the `layout` namespace, and 5 new attribute processors that
you can use in your templates: `decorate`, `title-pattern`, `insert`, `replace`,
and `fragment`.

Continue on to the [processors]({{ site.baseurl }}{% link processors/index.md %})
section to learn how to use these in your templates.
81 changes: 81 additions & 0 deletions groovydoc/allclasses-frame.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>All Classes</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="groovy.ico" type="image/x-icon" rel="shortcut icon">
<link href="groovy.ico" type="image/x-icon" rel="icon">
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">

</head>
<body class="left">
<h1 class="bar">All Classes</h1>
<div class="indexContainer">
<ul>
<li><a href="nz/net/ultraq/thymeleaf/layoutdialect/decorators/strategies/AppendingStrategy.html" title="class in nz.net.ultraq.thymeleaf.layoutdialect.decorators.strategies" target="classFrame">AppendingStrategy</a></li>
<li><a href="nz/net/ultraq/thymeleaf/layoutdialect/models/AttributeMerger.html" title="class in nz.net.ultraq.thymeleaf.layoutdialect.models" target="classFrame">AttributeMerger</a></li>
<li><a href="nz/net/ultraq/thymeleaf/layoutdialect/models/ChildModelIterator.html" title="class in nz.net.ultraq.thymeleaf.layoutdialect.models" target="classFrame">ChildModelIterator</a></li>
<li><a href="nz/net/ultraq/thymeleaf/layoutdialect/fragments/CollectFragmentProcessor.html" title="class in nz.net.ultraq.thymeleaf.layoutdialect.fragments" target="classFrame">CollectFragmentProcessor</a></li>
<li><a href="nz/net/ultraq/thymeleaf/layoutdialect/decorators/DecorateProcessor.html" title="class in nz.net.ultraq.thymeleaf.layoutdialect.decorators" target="classFrame">DecorateProcessor</a></li>
<li><a href="nz/net/ultraq/thymeleaf/layoutdialect/decorators/Decorator.html" title="interface in nz.net.ultraq.thymeleaf.layoutdialect.decorators" target="classFrame"><I>Decorator</I></a></li>
<li><a href="nz/net/ultraq/thymeleaf/layoutdialect/models/ElementMerger.html" title="class in nz.net.ultraq.thymeleaf.layoutdialect.models" target="classFrame">ElementMerger</a></li>
<li><a href="nz/net/ultraq/thymeleaf/layoutdialect/models/EventIterator.html" title="class in nz.net.ultraq.thymeleaf.layoutdialect.models" target="classFrame">EventIterator</a></li>
<li><a href="nz/net/ultraq/thymeleaf/layoutdialect/extensions/FragmentExtensions.html" title="class in nz.net.ultraq.thymeleaf.layoutdialect.extensions" target="classFrame">FragmentExtensions</a></li>
<li><a href="nz/net/ultraq/thymeleaf/layoutdialect/fragments/FragmentFinder.html" title="class in nz.net.ultraq.thymeleaf.layoutdialect.fragments" target="classFrame">FragmentFinder</a></li>
<li><a href="nz/net/ultraq/thymeleaf/layoutdialect/fragments/FragmentParameterNamesExtractor.html" title="class in nz.net.ultraq.thymeleaf.layoutdialect.fragments" target="classFrame">FragmentParameterNamesExtractor</a></li>
<li><a href="nz/net/ultraq/thymeleaf/layoutdialect/fragments/FragmentParameterVariableUpdater.html" title="class in nz.net.ultraq.thymeleaf.layoutdialect.fragments" target="classFrame">FragmentParameterVariableUpdater</a></li>
<li><a href="nz/net/ultraq/thymeleaf/layoutdialect/fragments/FragmentProcessor.html" title="class in nz.net.ultraq.thymeleaf.layoutdialect.fragments" target="classFrame">FragmentProcessor</a></li>
<li><a href="nz/net/ultraq/thymeleaf/layoutdialect/decorators/strategies/GroupingStrategy.html" title="class in nz.net.ultraq.thymeleaf.layoutdialect.decorators.strategies" target="classFrame">GroupingStrategy</a></li>
<li><a href="nz/net/ultraq/thymeleaf/layoutdialect/decorators/html/HtmlBodyDecorator.html" title="class in nz.net.ultraq.thymeleaf.layoutdialect.decorators.html" target="classFrame">HtmlBodyDecorator</a></li>
<li><a href="nz/net/ultraq/thymeleaf/layoutdialect/decorators/html/HtmlDocumentDecorator.html" title="class in nz.net.ultraq.thymeleaf.layoutdialect.decorators.html" target="classFrame">HtmlDocumentDecorator</a></li>
<li><a href="nz/net/ultraq/thymeleaf/layoutdialect/decorators/html/HtmlHeadDecorator.html" title="class in nz.net.ultraq.thymeleaf.layoutdialect.decorators.html" target="classFrame">HtmlHeadDecorator</a></li>
<li><a href="nz/net/ultraq/thymeleaf/layoutdialect/decorators/html/HtmlTitleDecorator.html" title="class in nz.net.ultraq.thymeleaf.layoutdialect.decorators.html" target="classFrame">HtmlTitleDecorator</a></li>
<li><a href="nz/net/ultraq/thymeleaf/layoutdialect/extensions/IAttributeExtensions.html" title="class in nz.net.ultraq.thymeleaf.layoutdialect.extensions" target="classFrame">IAttributeExtensions</a></li>
<li><a href="nz/net/ultraq/thymeleaf/layoutdialect/extensions/ICloseElementTagExtensions.html" title="class in nz.net.ultraq.thymeleaf.layoutdialect.extensions" target="classFrame">ICloseElementTagExtensions</a></li>
<li><a href="nz/net/ultraq/thymeleaf/layoutdialect/extensions/IContextExtensions.html" title="class in nz.net.ultraq.thymeleaf.layoutdialect.extensions" target="classFrame">IContextExtensions</a></li>
<li><a href="nz/net/ultraq/thymeleaf/layoutdialect/extensions/IModelExtensions.html" title="class in nz.net.ultraq.thymeleaf.layoutdialect.extensions" target="classFrame">IModelExtensions</a></li>
<li><a href="nz/net/ultraq/thymeleaf/layoutdialect/extensions/IProcessableElementTagExtensions.html" title="class in nz.net.ultraq.thymeleaf.layoutdialect.extensions" target="classFrame">IProcessableElementTagExtensions</a></li>
<li><a href="nz/net/ultraq/thymeleaf/layoutdialect/extensions/IStandaloneElementTagExtensions.html" title="class in nz.net.ultraq.thymeleaf.layoutdialect.extensions" target="classFrame">IStandaloneElementTagExtensions</a></li>
<li><a href="nz/net/ultraq/thymeleaf/layoutdialect/extensions/ITemplateEventExtensions.html" title="class in nz.net.ultraq.thymeleaf.layoutdialect.extensions" target="classFrame">ITemplateEventExtensions</a></li>
<li><a href="nz/net/ultraq/thymeleaf/layoutdialect/extensions/ITextExtensions.html" title="class in nz.net.ultraq.thymeleaf.layoutdialect.extensions" target="classFrame">ITextExtensions</a></li>
<li><a href="nz/net/ultraq/thymeleaf/layoutdialect/includes/IncludeProcessor.html" title="class in nz.net.ultraq.thymeleaf.layoutdialect.includes" target="classFrame">IncludeProcessor</a></li>
<li><a href="nz/net/ultraq/thymeleaf/layoutdialect/includes/InsertProcessor.html" title="class in nz.net.ultraq.thymeleaf.layoutdialect.includes" target="classFrame">InsertProcessor</a></li>
<li><a href="nz/net/ultraq/thymeleaf/layoutdialect/LayoutDialect.html" title="class in nz.net.ultraq.thymeleaf.layoutdialect" target="classFrame">LayoutDialect</a></li>
<li><a href="nz/net/ultraq/thymeleaf/layoutdialect/models/ModelBuilder.html" title="class in nz.net.ultraq.thymeleaf.layoutdialect.models" target="classFrame">ModelBuilder</a></li>
<li><a href="nz/net/ultraq/thymeleaf/layoutdialect/models/ModelMerger.html" title="interface in nz.net.ultraq.thymeleaf.layoutdialect.models" target="classFrame"><I>ModelMerger</I></a></li>
<li><a href="nz/net/ultraq/thymeleaf/layoutdialect/PojoLoggerFactory.html" title="class in nz.net.ultraq.thymeleaf.layoutdialect" target="classFrame">PojoLoggerFactory</a></li>
<li><a href="nz/net/ultraq/thymeleaf/layoutdialect/includes/ReplaceProcessor.html" title="class in nz.net.ultraq.thymeleaf.layoutdialect.includes" target="classFrame">ReplaceProcessor</a></li>
<li><a href="nz/net/ultraq/thymeleaf/layoutdialect/decorators/SortingStrategy.html" title="interface in nz.net.ultraq.thymeleaf.layoutdialect.decorators" target="classFrame"><I>SortingStrategy</I></a></li>
<li><a href="nz/net/ultraq/thymeleaf/layoutdialect/models/TemplateModelFinder.html" title="class in nz.net.ultraq.thymeleaf.layoutdialect.models" target="classFrame">TemplateModelFinder</a></li>
<li><a href="nz/net/ultraq/thymeleaf/layoutdialect/models/TitleExtractor.html" title="class in nz.net.ultraq.thymeleaf.layoutdialect.models" target="classFrame">TitleExtractor</a></li>
<li><a href="nz/net/ultraq/thymeleaf/layoutdialect/decorators/TitlePatternProcessor.html" title="class in nz.net.ultraq.thymeleaf.layoutdialect.decorators" target="classFrame">TitlePatternProcessor</a></li>
<li><a href="nz/net/ultraq/thymeleaf/layoutdialect/decorators/TitleProcessor.html" title="class in nz.net.ultraq.thymeleaf.layoutdialect.decorators" target="classFrame">TitleProcessor</a></li>
<li><a href="nz/net/ultraq/thymeleaf/layoutdialect/models/VariableDeclaration.html" title="class in nz.net.ultraq.thymeleaf.layoutdialect.models" target="classFrame">VariableDeclaration</a></li>
<li><a href="nz/net/ultraq/thymeleaf/layoutdialect/models/VariableDeclarationMerger.html" title="class in nz.net.ultraq.thymeleaf.layoutdialect.models" target="classFrame">VariableDeclarationMerger</a></li>
<li><a href="nz/net/ultraq/thymeleaf/layoutdialect/models/VariableDeclarationParser.html" title="class in nz.net.ultraq.thymeleaf.layoutdialect.models" target="classFrame">VariableDeclarationParser</a></li>
<li><a href="nz/net/ultraq/thymeleaf/layoutdialect/decorators/xml/XmlDocumentDecorator.html" title="class in nz.net.ultraq.thymeleaf.layoutdialect.decorators.xml" target="classFrame">XmlDocumentDecorator</a></li>

</ul>
</div>
</body>
</html>
Loading

0 comments on commit bcce468

Please sign in to comment.