Fossil

Check-in [828821463a]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:th1 docs: added new capexpr and marked (anycap, hascap, anoncap) as deprecated.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 828821463aa630aab145d33addc6a351738cafa7652e0dfd6304ae441301b6fa
User & Date: stephan 2021-01-26 17:53:01.837
Context
2021-01-26
19:37
Rework the /sitemap customization settings. There is now just a single setting "sitemap-extra" that is a TCL list of triples, where each triple defines a new entry in the /sitemap. Legacy entries are ignored. Administrators that have a custom /sitemap configuration will need to update the "Custom Sitemap Entries" setting on the /Admin/Configuration page after updating to this version of Fossil or later. ... (check-in: aa5beb8c29 user: drh tags: trunk)
17:53
th1 docs: added new capexpr and marked (anycap, hascap, anoncap) as deprecated. ... (check-in: 828821463a user: stephan tags: trunk)
16:57
Add the "capexpr" TH1 command. This makes "hascap", "anoncap", and "anycap" all obsolete. We'll keep those old commands around, for legacy compatibility. ... (check-in: f96de5abdf user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to www/th1.md.
166
167
168
169
170
171
172

173
174
175
176
177
178
179

There are many new commands added to TH1 and used to access the special
features of Fossil.  The following is a summary of the extended commands:

  *  [anoncap](#anoncap)
  *  [anycap](#anycap)
  *  [artifact](#artifact)

  *  [captureTh1](#captureTh1)
  *  [cgiHeaderLine](#cgiHeaderLine)
  *  [checkout](#checkout)
  *  [combobox](#combobox)
  *  [copybtn](#copybtn)
  *  [date](#date)
  *  [decorate](#decorate)







>







166
167
168
169
170
171
172
173
174
175
176
177
178
179
180

There are many new commands added to TH1 and used to access the special
features of Fossil.  The following is a summary of the extended commands:

  *  [anoncap](#anoncap)
  *  [anycap](#anycap)
  *  [artifact](#artifact)
  *  [capexpr](#capexpr)
  *  [captureTh1](#captureTh1)
  *  [cgiHeaderLine](#cgiHeaderLine)
  *  [checkout](#checkout)
  *  [combobox](#combobox)
  *  [copybtn](#copybtn)
  *  [date](#date)
  *  [decorate](#decorate)
231
232
233
234
235
236
237


238
239
240
241
242
243
244


245
246
247
248
249
250
251
252
253
254
255
256
257
258
259

























260
261
262
263
264
265
266
require the Tcl integration subsystem be included at compile-time.
Additionally, the "tcl" repository setting must be enabled at runtime
in order to successfully make use of these commands.

<a id="anoncap"></a>TH1 anoncap Command
-----------------------------------------



  *  anoncap STRING...

Returns true if the anonymous user has all of the capabilities listed
in STRING.

<a id="anycap"></a>TH1 anycap Command
---------------------------------------



  *  anycap STRING

Returns true if the current user user has any one of the capabilities
listed in STRING.

<a id="artifact"></a>TH1 artifact Command
-------------------------------------------

  *  artifact ID ?FILENAME?

Attempts to locate the specified artifact and return its contents.  An
error is generated if the repository is not open or the artifact cannot
be found.


























<a id="captureTh1"></a>TH1 captureTh1 Command
-----------------------------------------------------

  *  captureTh1 STRING

Executes its single argument as TH1 code and captures any
TH1-generated output as a string, which becomes the result of the







>
>







>
>















>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
require the Tcl integration subsystem be included at compile-time.
Additionally, the "tcl" repository setting must be enabled at runtime
in order to successfully make use of these commands.

<a id="anoncap"></a>TH1 anoncap Command
-----------------------------------------

Deprecated: prefer [capexpr](#capexpr) instead.

  *  anoncap STRING...

Returns true if the anonymous user has all of the capabilities listed
in STRING.

<a id="anycap"></a>TH1 anycap Command
---------------------------------------

Deprecated: prefer [capexpr](#capexpr) instead.

  *  anycap STRING

Returns true if the current user user has any one of the capabilities
listed in STRING.

<a id="artifact"></a>TH1 artifact Command
-------------------------------------------

  *  artifact ID ?FILENAME?

Attempts to locate the specified artifact and return its contents.  An
error is generated if the repository is not open or the artifact cannot
be found.



<a id="capexpr"></a>TH1 capexpr Command
-----------------------------------------------------

  *  capexpr CAPABILITY-EXPR

The capability expression is a list. Each term of the list is a
cluster of capability letters. The overall expression is true if any
one term is true. A single term is true if all letters within that
term are true. Or, if the term begins with "!", then the term is true
if none of the terms or true. Or, if the term begins with "@" then
the term is true if all of the capability letters in that term are
available to the "anonymous" user. Or, if the term is "*" then it is
always true.

Examples:

```
  capexpr {j o r}               True if any one of j, o, or r are available
  capexpr {oh}                  True if both o and h are available
  capexpr {@2 @3 4 5 6}         2 or 3 available for anonymous or one of
                                  4, 5 or 6 is available for the user
```

<a id="captureTh1"></a>TH1 captureTh1 Command
-----------------------------------------------------

  *  captureTh1 STRING

Executes its single argument as TH1 code and captures any
TH1-generated output as a string, which becomes the result of the
423
424
425
426
427
428
429


430
431
432
433
434
435
436

Attempts to query for unsupported global state variables will result
in a script error.  Additional global state variables may be exposed
in the future.

<a id="hascap"></a>TH1 hascap Command
---------------------------------------



  *  hascap STRING...

Returns true if the current user has all of the capabilities listed
in STRING.

<a id="hasfeature"></a>TH1 hasfeature Command







>
>







453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468

Attempts to query for unsupported global state variables will result
in a script error.  Additional global state variables may be exposed
in the future.

<a id="hascap"></a>TH1 hascap Command
---------------------------------------

Deprecated: prefer [capexpr](#capexpr) instead.

  *  hascap STRING...

Returns true if the current user has all of the capabilities listed
in STRING.

<a id="hasfeature"></a>TH1 hasfeature Command