Skip to content

Commit fbab5c7

Browse files
authored
Apply suggestions from code review
1 parent 3ec56fd commit fbab5c7

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

docs/backend/fields.md

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,9 @@ See [`plone.namedfile`](https://pypi.org/project/plone.namedfile/) and [plone.fo
103103
| `NamedBlobFile` | `NamedBlobFile` | A binary uploaded file stored as a ZODB blob. Requires the `blobs` extra to `plone.namedfile`. Otherwise identical to `NamedFile`. | `IField` |
104104
| `NamedBlobImage` | `NamedBlobImage` | A binary uploaded image stored as a ZODB blob. Requires the `blobs` extra to `plone.namedfile`. Otherwise identical to `NamedImage`. | `IField` |
105105

106-
#### NamedBlobImage
106+
#### `NamedBlobImage`
107107

108-
The following example shows, how to create an Image object and attach the image file to it.
108+
The following example shows how to create an `Image` object, and attach the image file to it.
109109

110110
```python
111111
img_obj = api.content.create(
@@ -145,7 +145,8 @@ See [`plone.app.textfield`](https://pypi.org/project/plone.app.textfield/) for m
145145
| `RichText` | `RichTextValue` | Stores a `RichTextValue`, which encapsulates a raw text value, the source MIME type, and a cached copy of the raw text transformed to the default output MIME type. | `IField`, `IRichText` |
146146

147147

148-
The RichText field allows for alternative markups and content filtering.
148+
The `RichText` field allows for alternative markups and content filtering.
149+
The following code sample shows how to create a schema with a `RichText` field.
149150

150151
```python
151152
from plone.app.textfield import RichText
@@ -208,17 +209,17 @@ class ITestSchema(model.Schema):
208209

209210
(backend-fields-richtextvalue-label)=
210211

211-
#### RichTextValue
212+
#### `RichTextValue`
212213

213-
The `RichText` field, most of the time does not store a string.
214+
The `RichText` field usually does not store a string.
214215
Instead, it stores a `RichTextValue` object.
215216
This is an immutable object that has the following properties.
216217

217218
`raw`
218219
: A Unicode string with the original input markup.
219220

220221
`mimeType`
221-
: The MIME type of the original markup, for example `text/html` or `text/structured`.
222+
: The MIME type of the original markup, for example, `text/html` or `text/structured`.
222223

223224
`encoding`
224225
: The default character encoding used when transforming the input markup.
@@ -251,7 +252,7 @@ context.body = RichTextValue("Some input text", mimeType="text/html", outputMime
251252
The standard widget used for a `RichText` field will correctly store this type of object for you, so it is rarely necessary to create one yourself.
252253

253254

254-
##### Using RichText fields in templates
255+
##### `RichText` fields in templates
255256

256257
If you use a `DisplayForm`, the display widget for the `RichText` field will render the transformed output markup automatically.
257258
If you write TAL manually, you may try something like the following.
@@ -280,7 +281,7 @@ This operation is approximately as efficient as rendering a simple `Text` field,
280281

281282
Sometimes, you may want to invoke alternative transformations.
282283
Under the hood, the default implementation uses the `portal_transforms` tool to calculate a transform chain from the raw value's input MIME type to the desired output MIME type.
283-
If you need to write your own transforms, take a look at [this tutorial](https://5.docs.plone.org/develop/plone/misc/portal_transforms.html).
284+
If you need to write your own transforms, take a look at [Changing Portal Transforms Settings via Python](https://5.docs.plone.org/develop/plone/misc/portal_transforms.html).
284285
This is abstracted behind an `ITransformer` adapter to allow alternative implementations.
285286

286287
To invoke a transformation in code, you can use the following syntax.
@@ -300,8 +301,8 @@ If you write a page template, there is an even more convenient syntax.
300301
<div tal:content="structure context/@@text-transform/body/text/plain" />
301302
```
302303

303-
The first traversal name gives the name of the field on the context (`body` in this case).
304-
The second and third give the output MIME type.
304+
The first traversal name segment gives the name of the field on the context (`body` in this case).
305+
The second and third segments give the output MIME type.
305306
If the MIME type is omitted, the default output MIME type will be used.
306307

307308
```{note}

0 commit comments

Comments
 (0)