Skip to content

Commit 0791d40

Browse files
committed
Rework docs to all be PublishGuide compatible & remove duplicated, deprecated source files
1 parent d6031be commit 0791d40

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+158
-574
lines changed

etc/layout/style/layout.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<% if (logo) { %>
2424
<span id="logo">${logo}</span>
2525
<% } %>
26-
Groovy Server Pages
26+
${title.encodeAsHtml()}
2727
</div>
2828
<div class="navLinks">
2929
<ul>

fields/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ logic.
77

88
## Documentation
99

10-
* Latest Guide - https://views.grails.org/latest/fields/guide
10+
* Latest Guide - https://views.grails.org/latest/fields
1111
* Latest API - https://views.grails.org/latest/fields/api
1212

13-
* Snapshot Guide - https://views.grails.org/snapshot/fields/guide
13+
* Snapshot Guide - https://views.grails.org/snapshot/fields
1414
* Snapshot API - https://views.grails.org/snapshot/fields/api

fields/docs/build.gradle

+3-6
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,9 @@ ext {
22
guideTitle = 'Grails Fields Plugin'
33
guideSubtitle = 'Grails Fields Plugin - customize the rendering of input fields for Grails artifacts'
44

5-
apiDocsProjects = [
6-
'fields': [
7-
docTitle : 'Grails Fields Plugin - ' + projectVersion,
8-
windowTitle: 'fields ' + projectVersion + ' API'
9-
]
10-
]
5+
apiDocsProjects = ['fields-plugin']
6+
apiDocTitle = "Grails Fields Plugin API - ${projectVersion}"
7+
apiWindowTitle = "Grails Fields Plugin API - ${projectVersion}"
118

129
asciidoctorAttributes = [
1310
copyright : 'Apache License, Version 2.0',

fields/docs/src/docs/changelog.adoc fields/docs/src/docs/guide/changelog.adoc

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
== Changelog
2-
31
=== Version 5.0.0 - Grails 5.3.x
42

53
In your `build.gradle` file, use:

fields/docs/src/docs/customizingFieldRendering.adoc fields/docs/src/docs/guide/customizingFieldRendering.adoc

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
== Customizing Field Rendering
2-
31
The plugin resolves the GSP template used for each property according to conventions. You can override the rendering based
42
on the class and property name or the property type. The `f:field` tag looks for a template called `_wrapper.gsp`, the `f:widget`
53
tag looks for a template called `_widget.gsp`, the `f:display` tag looks for a template called `_displayWrapper.gsp`.

fields/docs/src/docs/embeddedProperties.adoc fields/docs/src/docs/guide/embeddedProperties.adoc

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
== Embedded Properties
2-
31
Embedded properties are handled in a special way by the `f:field` and `f:all` tags. If the `property` attribute you pass to `f:field` is an embedded property then the tag recursively renders each individual property of the embedded class with a surrounding `fieldset`. For example if you have a `Person` class with a `name` property and an `Address` embedded class with `street`, `city` and `country` properties `<f:field bean="person" property="address">` will effectively do this:
42

53
[source,groovy]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Plugins can include field and/or input level templates to support special UI rendering or non-standard property types. Just include the templates in the plugin's `grails-app/views` directory as described in the <<customizingFieldRendering,Customizing Field Rendering>> section.
2+
3+
WARNING: If you supply templates in a plugin you should consider declaring a `<%@page defaultCodec="html" %>` directive so that any HTML unsafe property values are escaped properly regardless of the default codec used by client apps.
4+
5+
In order to be performant, the Fields plugin caches field template lookup results by default. This makes it possible to perform the time-consuming template path resolutions only once during the runtime of the application.
6+
7+
When template caching is active, only the first page renderings are slow, subsequent ones are fast.
8+
9+
Due to the flexibility needed during template development, this feature can be disabled so it would be possible to recognize newly added field templates without restarting the application. As a result, with bigger webpages, containing a lot of fields, rendering may be fairly slow in development (depending on the number of fields on the page).

fields/docs/src/docs/guide/index.adoc

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
= Fields Plugin
2+
3+
[#introduction]
4+
include::introduction.adoc[]
5+
6+
[#installation]
7+
include::installation.adoc[]
8+
9+
[#usage]
10+
include::usage.adoc[]
11+
12+
[#customizingFieldRendering]
13+
include::customizingFieldRendering.adoc[]
14+
15+
[#embeddedProperties]
16+
include::embeddedProperties.adoc[]
17+
18+
[#themes]
19+
include::themes.adoc[]
20+
21+
[#includingTemplatesInPlugins]
22+
include::includingTemplatesInPlugins.adoc[]
23+
24+
[#performance]
25+
include::performance.adoc[]
26+
27+
[#changelog]
28+
include::changelog.adoc[]

fields/docs/src/docs/installation.adoc fields/docs/src/docs/guide/installation.adoc

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
== Installation
21
The plugin is available on Maven Central and should be a dependency like this:
32

43
[source,groovy,subs="attributes"]

fields/docs/src/docs/introduction.adoc fields/docs/src/docs/guide/introduction.adoc

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
== Introduction
2-
31
The *Fields plugin* allows you to customize the rendering of input fields for properties of domain objects, command beans and POGOs based on their type, name, etc. The plugin aims to:
42

53
* Use good defaults for fields.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
For template development, the following configuration attribute should be placed in the development environment section of your application's Config.groovy:
2+
3+
.application.groovy
4+
[source,groovy]
5+
----
6+
grails.plugin.fields.disableLookupCache = true
7+
----
8+
9+
or
10+
11+
.application.yml
12+
[source,yml]
13+
----
14+
environments:
15+
development:
16+
grails:
17+
plugin:
18+
fields:
19+
disableLookupCache: true
20+
----
21+
22+
After the template development has finished, it is recommended to re-enable the template lookup cache in order to have a performant page rendering even during development.

fields/docs/src/docs/themes.adoc fields/docs/src/docs/guide/themes.adoc

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
== Themes
2-
31
Since version 2.1.4 It is possible to create themes to provide set of templates for different css frameworks or form layouts.
42
For example, a bootstrap-fields plugin can provide different themes (eg bs-horizontal, bs-vertical) to support horizontal and vertical form layouts. And another plugin can provide theme for purecss framework.
53

Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
introduction: Introduction
2+
installation: Installation
23
usage: Usage
34
customizingFieldRendering: Customizing Field Rendering
45
embeddedProperties: Embedded Properties
56
themes: Themes
67
includingTemplatesInPlugins: Including Templates in Plugins
78
performance: Performance
9+
changeLog: Change Log

fields/docs/src/docs/usage.adoc fields/docs/src/docs/guide/usage.adoc

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
== Usage
2-
31
The plugin provides a set of tags you can use to render the fields in a form.
42

53
In the simplest case you can use `f:all` to render a field for every property of a bean (the domain object or command the form will bind to):

fields/docs/src/docs/includingTemplatesInPlugins.adoc

-5
This file was deleted.

fields/docs/src/docs/index.adoc

-74
This file was deleted.

fields/docs/src/docs/links.yml

-6
This file was deleted.

fields/docs/src/docs/performance.adoc

-30
This file was deleted.

0 commit comments

Comments
 (0)