Changes between Version 17 and Version 18 of TracFormsPlugin/Syntax


Ignore:
Timestamp:
Aug 27, 2015, 10:11:59 AM (9 years ago)
Author:
figaro
Comment:

Cosmetic changes, tagged as reference

Legend:

Unmodified
Added
Removed
Modified
  • TracFormsPlugin/Syntax

    v17 v18  
    1 [[TOC]]
     1[[PageOutline(2-5,Contents,pullout)]]
    22
    3 = TracFormsPlugin !TracForm Syntax =
     3= TracFormsPlugin !TracForm Syntax
    44
    55All !TracForm blocks are wrapped and formatted as follows:
     
    2929(... and so on)
    3030
    31 Comments are ignored and can be intermixed with commands until the first non-comment line.  [tf] operations are intermixed with other Trac wiki entities and the results ''can'' in some cases cause other wiki entities to take place (but only where it makes sense).
     31Comments are ignored and can be intermixed with commands until the first non-comment line. [tf] operations are intermixed with other Trac wiki entities and the results ''can'' in some cases cause other wiki entities to take place (but only where it makes sense).
    3232
    33 == !TracForm Configuration Commands ==
     33== !TracForm Configuration Commands
    3434
    3535In the header section of the form, several commands can be used to control the rendering and configuration of the form in the form of "#!command [arg...]" lines before the first non-comment line:
    3636
    3737|| '''Command''' || '''Version''' || '''Arguments''' || '''Meaning''' ||
    38 || '''page''' || 0.1 || page-context || Sets the page portion of the context used to store the form.  This defaults to the page the user is currently on. ||
    39 || '''subcontext''' || 0.1 || subcontext || Sets a subcontext within the page.  For example, a SVN checklist could have a "#!subcontext SVN" to differentiate it from other forms on the page. ||
    40 || '''default''' || 0.1 || operation || Specifies the default operation in [tf:args] blocks.  Defaults to "checkbox" ||
    41 || '''track_fields''' || 0.1 || [yes|no] || If no argument given or yes, keep track of field changes in this form.  Unless track_fields is specified, this defaults to false (no field changes tracked). This affects [tf.who] and [tf.when] ||
    42 || '''keep_history''' || 0.1 || [yes|no] || If no argument given or yes, keep full history of form changes.  Unless keep_history is specified, this defaults to false (no history recording). In contrast to track_fields history records mean essential revision support for !TracForms, required i.e. for incremental form reset/rollback, provided since 0.3 ||
    43 || '''submit_label''' || 0.1 || label || Set the label to use for the submit button at the end of the form.  The default is "Submit Form" ||
    44 || '''setenv''' || 0.1 || name value || Set the name to value in the form's environment (or any subforms therein). ||
     38|| '''page''' || 0.1 || page-context || Sets the page portion of the context used to store the form. This defaults to the page the user is currently on. ||
     39|| '''subcontext''' || 0.1 || subcontext || Sets a subcontext within the page. For example, a SVN checklist could have a "#!subcontext SVN" to differentiate it from other forms on the page. ||
     40|| '''default''' || 0.1 || operation || Specifies the default operation in [tf:args] blocks. Defaults to "checkbox" ||
     41|| '''track_fields''' || 0.1 || [yes|no] || If no argument given or yes, keep track of field changes in this form. Unless track_fields is specified, this defaults to false (no field changes tracked). This affects [tf.who] and [tf.when] ||
     42|| '''keep_history''' || 0.1 || [yes|no] || If no argument given or yes, keep full history of form changes. Unless keep_history is specified, this defaults to false (no history recording). In contrast to track_fields history records mean essential revision support for !TracForms, required i.e. for incremental form reset/rollback, provided since 0.3 ||
     43|| '''submit_label''' || 0.1 || label || Set the label to use for the submit button at the end of the form. The default is "Submit Form" ||
     44|| '''setenv''' || 0.1 || name value || Set the name to value in the form's environment or any subforms therein. ||
    4545|| '''class''' || 0.2 || value || Set the CSS class for the form. ||
    4646|| '''id''' || 0.2 || value || Set the CSS id for the form (defaults to the subcontext). ||
    4747|| '''name''' || 0.2 || value || Set the CSS name for the form (defaults to the subcontext). ||
    4848
    49 == !TracForm Operations ==
     49== !TracForm Operations
    5050
    5151Within the !TracForm, you can use the following commands with [tf.OP:arg...] blocks.
    5252
    53 === Form Field Operations ===
     53=== Form Field Operations
     54
    5455|| '''Operation''' || '''Version''' || '''Argument(s)''' || '''Meaning''' ||
    55 || '''tf.checkbox''' || 0.1 || name [value] || Put an HTML checkbox here.  Use value only if specified (simply "on" is default). ||
    56 || '''tf.radio''' || 0.1 || name value || Put an HTML radio button here.  Use the name and value pair together. ||
    57 || '''tf.input''' || 0.1/0.4 || name [content] [size] || Put an HTML form input field here. '''since 0.4''': If content is provided, it is used as a default.  size, if specified, indicate the width of the input field in characters. Use {{{''}}} for content to specify the size of a blank area. ||
    58 || '''tf.select''' || 0.2 || name value[//label]... || Put a SELECT dropdown list here.  The values are by default used as labels but can be added if //label is used (the // is removed) ||
    59 || '''tf.textarea''' || 0.2 || name [content] [cols] [rows] || Add a textarea of the specified label.  If content is provided, it is used as a default. cols and rows, if specified, indicate the size the textarea should occupy. Use {{{''}}} for content to specify the size of a blank area. ||
     56|| '''tf.checkbox''' || 0.1 || name [value] || Put an HTML checkbox here. Use value only if specified ("on" is default). ||
     57|| '''tf.radio''' || 0.1 || name value || Put an HTML radio button here. Use the name and value pair together. ||
     58|| '''tf.input''' || 0.1/0.4 || name [content] [size] || Put an HTML form input field here. '''since 0.4''': If content is provided, it is used as a default. size, if specified, indicate the width of the input field in characters. Use {{{''}}} for content to specify the size of a blank area. ||
     59|| '''tf.select''' || 0.2 || name value[//label]... || Put a SELECT dropdown list here. The values are by default used as labels but can be added if //label is used (the // is removed) ||
     60|| '''tf.textarea''' || 0.2 || name [content] [cols] [rows] || Add a textarea of the specified label. If content is provided, it is used as a default. cols and rows, if specified, indicate the size the textarea should occupy. Use {{{''}}} for content to specify the size of a blank area. ||
    6061
    6162Starting in 0.2, the form field operations all accept -class= or -id= to set the CSS class or ID for the field.
    6263
    63 === Form Query Operations ===
     64=== Form Query Operations
     65
    6466|| '''Operation''' || '''Version''' || '''Argument(s)''' || '''Meaning''' ||
    65 || '''tf.who''' || 0.1 || name || Show which user most recently affected the specified field.  This requires track_fields to be set in the commands section. ||
    66 || '''tf.when''' || 0.1 || name [strftime format string] || Show when the most change was made on the specified field.  This requires track_fields to be set in the commands section. ||
     67|| '''tf.who''' || 0.1 || name || Show which user most recently affected the specified field. This requires track_fields to be set in the commands section. ||
     68|| '''tf.when''' || 0.1 || name [strftime format string] || Show when the most change was made on the specified field. This requires track_fields to be set in the commands section. ||
    6769|| '''tf.form_updater''' || 0.1 || || Show the most recent updater of the form itself. ||
    6870|| '''tf.form_updated_on''' || 0.1 || [strftime format string] || Show when the form was most recently updated. ||
     
    7577|| '''sum''' || 0.2 || value... || Perform a floating-point sum on the arguments ||
    7678|| '''sumif''' || 0.2 || criteria value... || Perform a floating-point sum of the arguments that match the criteria ||
    77 || '''sumprod''' || 0.2 || value... [-stride=n] || Using stride, add each group of n factors together.  Thus [tf.sumprod: a b c d e f] = (ab) + (cd) + (ef) ||
     79|| '''sumprod''' || 0.2 || value... [-stride=n] || Using stride, add each group of n factors together. Thus [tf.sumprod: a b c d e f] = (ab) + (cd) + (ef) ||
    7880|| '''value''' || 0.2 || source... || Return each source from the environment in the same manner as %...% below ||
    7981|| '''quote''' || 0.2 || source... || Quote each source from the environment in the same manner as %...% below ||
     
    8284critiera can be a normal string, a wildcard in the UNIX form, or a regular expression if wrapped in /.../.
    8385
    84 === Debugging Operations ===
     86=== Debugging Operations
     87
    8588|| '''Operation''' || '''Version''' || '''Argument(s)''' || '''Meaning''' ||
    86 || '''env_debug''' || 0.2 || [criteria] || Display all keys and values from the environment.  If criteria is provided, it is used as a filter on the keys ||
     89|| '''env_debug''' || 0.2 || [criteria] || Display all keys and values from the environment. If criteria is provided, it is used as a filter on the keys ||
    8790
    88 == !TracForm Arguments ==
     91== !TracForm Arguments
    8992
    9093Each arguments listed above are either:
    9194
    92  * Separated by whitespace.  Example: #!setenv VAR VALUE
    93  * Quoted with double-quotes.  Example: #!submit_label "Hello World"
    94  * Quoted with single-quotes.  Example: [tf.input:'Big Text']
     95 * Separated by whitespace. Example: #!setenv VAR VALUE
     96 * Quoted with double-quotes. Example: #!submit_label "Hello World"
     97 * Quoted with single-quotes. Example: [tf.input:'Big Text']
    9598
    96 == !TracForm Environment ==
     99== !TracForm Environment
    97100
    98 Within any command or operation, you can retrieve previously defined elements with %NAME% (case insensitive).  These do NOT currently work within general text (use [tf:value] or [tf:quote] instead for these cases). Other environment variables are also defined by the system:
     101Within any command or operation, you can retrieve previously defined elements with %NAME% (case insensitive). These do NOT currently work within general text (use [tf:value] or [tf:quote] instead for these cases). Other environment variables are also defined by the system:
    99102
    100103|| '''Variable''' || '''Version''' || '''Meaning''' ||
     
    102105|| '''%NOW%''' || 0.1 || The current date and time. ||
    103106
    104 All substitutions may be applied to any argument within #! command or [tf:] operation sections.  Use [tf.value] or [tf.quote] to extract environment variables within general text.
     107All substitutions may be applied to any argument within #! command or [tf:] operation sections. Use [tf.value] or [tf.quote] to extract environment variables within general text.
    105108
    106 All form variables appear in the environment in three ways: prefixed with the whole context (page:subcontext:), prefixed with the page (page:), and prefixed with the subcontext if defined (subcontext:). 
     109All form variables appear in the environment in three ways: prefixed with the whole context (page:subcontext:), prefixed with the page (page:), and prefixed with the subcontext if defined (subcontext:).
    107110
    108 Environment lookups (via %...%, value, quote, etc) can have wildcards in the UNIX manner.  Currently regular expressions are not supported for environment lookups.
     111Environment lookups (via %...%, value, quote, etc) can have wildcards in the UNIX manner. Currently regular expressions are not supported for environment lookups.