Skip to content

Commit 8f101f8

Browse files
committed
Tidy up code samples
1 parent 6d9db22 commit 8f101f8

File tree

2 files changed

+36
-36
lines changed

2 files changed

+36
-36
lines changed

docs/deployment/caching/profiles.md

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -49,57 +49,57 @@ This also hides the profile from Plone's {guilabel}`Add-ons` control panel.
4949
Here is an example from this package:
5050

5151
```xml
52-
<genericsetup:registerProfile
53-
name="with-caching-proxy"
54-
title="With caching proxy"
55-
description="Settings useful for setups with a caching proxy such as Squid or Varnish"
56-
directory="profiles/with-caching-proxy"
57-
provides="Products.GenericSetup.interfaces.EXTENSION"
58-
for="plone.app.caching.interfaces.ICacheProfiles"
59-
/>
52+
<genericsetup:registerProfile
53+
name="with-caching-proxy"
54+
title="With caching proxy"
55+
description="Settings useful for setups with a caching proxy such as Squid or Varnish"
56+
directory="profiles/with-caching-proxy"
57+
provides="Products.GenericSetup.interfaces.EXTENSION"
58+
for="plone.app.caching.interfaces.ICacheProfiles"
59+
/>
6060
```
6161

6262
The directory `profiles/with-caching-proxy` contains a single import step, `registry.xml`, containing settings to configure the ruleset to operation mapping, and setting options for various operations.
6363

6464
At the time of writing, this includes:
6565

6666
```xml
67-
<record name="plone.caching.interfaces.ICacheSettings.operationMapping">
68-
<value purge="False">
69-
<element key="plone.resource">plone.app.caching.strongCaching</element>
70-
<element key="plone.stableResource">plone.app.caching.strongCaching</element>
71-
<element key="plone.content.itemView">plone.app.caching.weakCaching</element>
72-
<element key="plone.content.feed">plone.app.caching.moderateCaching</element>
73-
<element key="plone.content.folderView">plone.app.caching.weakCaching</element>
74-
<element key="plone.content.file">plone.app.caching.moderateCaching</element>
75-
<element key="plone.content.dynamic">plone.app.caching.terseCaching</element>
76-
</value>
77-
</record>
67+
<record name="plone.caching.interfaces.ICacheSettings.operationMapping">
68+
<value purge="False">
69+
<element key="plone.resource">plone.app.caching.strongCaching</element>
70+
<element key="plone.stableResource">plone.app.caching.strongCaching</element>
71+
<element key="plone.content.itemView">plone.app.caching.weakCaching</element>
72+
<element key="plone.content.feed">plone.app.caching.moderateCaching</element>
73+
<element key="plone.content.folderView">plone.app.caching.weakCaching</element>
74+
<element key="plone.content.file">plone.app.caching.moderateCaching</element>
75+
<element key="plone.content.dynamic">plone.app.caching.terseCaching</element>
76+
</value>
77+
</record>
7878
```
7979

8080
Default options for the various standard operations are found in the `registry.xml` file that is part of the standard installation profile for this product, in the directory `profiles/default`.
8181

8282
The custom profile overrides a number of operation settings for specific {doc}`rulesets <rulesets-and-caching-operations>`, as shown below.
8383

8484
```xml
85-
<record name="plone.app.caching.weakCaching.plone.content.itemView.ramCache">
86-
<field ref="plone.app.caching.weakCaching.ramCache" />
87-
<value>True</value>
88-
</record>
85+
<record name="plone.app.caching.weakCaching.plone.content.itemView.ramCache">
86+
<field ref="plone.app.caching.weakCaching.ramCache" />
87+
<value>True</value>
88+
</record>
8989
```
9090

9191
This enables RAM caching for the "weak caching" operation for resources using the ruleset `plone.content.itemView`.
9292
The default is defined in the main `registry.xml` as shown below.
9393

9494
```xml
95-
<record name="plone.app.caching.weakCaching.ramCache">
96-
<field type="plone.registry.field.Bool">
97-
<title>RAM cache</title>
98-
<description>Turn on caching in Zope memory</description>
99-
<required>False</required>
100-
</field>
101-
<value>False</value>
102-
</record>
95+
<record name="plone.app.caching.weakCaching.ramCache">
96+
<field type="plone.registry.field.Bool">
97+
<title>RAM cache</title>
98+
<description>Turn on caching in Zope memory</description>
99+
<required>False</required>
100+
</field>
101+
<value>False</value>
102+
</record>
103103
```
104104

105105
Notice how we use a _field reference_ to avoid having to re-define the field.

docs/deployment/caching/rulesets-and-caching-operations.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ One way to do that is to set the global Zope logging level to `DEBUG` in `zope.c
262262
<eventlog>
263263
level DEBUG
264264
<logfile>
265-
path <file_path_here>
265+
path <file_path_here/>
266266
level DEBUG
267267
</logfile>
268268
</eventlog>
@@ -304,10 +304,10 @@ This adapter allows you to declare a ruleset for the *default view* of a given c
304304
Or for a class.
305305

306306
```xml
307-
<cache:ruleset
308-
ruleset="plone.content.itemView"
309-
for=".content.MyContentType"
310-
/>
307+
<cache:ruleset
308+
ruleset="plone.content.itemView"
309+
for=".content.MyContentType"
310+
/>
311311
```
312312

313313
There are two reasons to do this.

0 commit comments

Comments
 (0)