Feature Proposal: Add some formatting control to the $changes() search token.

Motivation

Summary has some output controls, added as simple arguments to the token:
  • $summary(50, showvarnames, noheader, searchcontex )

Changes however has two options with no format control:
  • $changes Summary of changes between latest rev and previous rev
  • $changes(n) Summary of changes between latest rev and rev n

Search calls Meta::SummariseChanges(). Default is to generate a "diff" in plain text, suitable for emails. Meta also supports generating an html formatted diff, but search has no way to trigger it. Unfortunately neither of these options can be used in a TML table, as they both embed newlines.

There are a couple of other tasks out there in this area:
  • Item13995: $changes doesn't work - only generates a simple summary
  • Item9464: Request to support negative rev's $changes(-1) for changes since the prior rev.
  • Item1390: Ancient request for better rendering control on changes

Description and Documentation

This request adds some additional controls:

$changes Returns the 'print' formatted diff since the prior revision. This is the way it's supposed to work if Item13995 was fixed.

  • n - request diff against revision=n (unchanged)
  • -n - calculate relative diff from current revision.
  • summary - Generate a simple text summary, similar to the default $summary option
  • html - Generate an HTML formatted diff.
  • print - Generate a printable format diff suitable for email notifications. (the default)

Search summary has added the following options. They probably make sense here for consistency.
$summary(showvarnames)
Topic summary, with %SOMEMACRO{...}% macros shown as SOMEMACRO{...}
$summary(noheader)
Topic summary, with leading ---+ headers removed
Note: The tokens can be combined, for example $summary(100, showvarnames, noheader)

Examples

Impact

Most of the changes will be in Meta::summariseChanges(). The formatting flags need to be passed through to Meta for processing.

%WHATDOESITAFFECT%
edit

Implementation

-- Contributors: GeorgeClark - 27 Feb 2016

Discussion

Changed the "plaintext" option to "summary". If it looks like a topic summary, might as well call it that.

-- GeorgeClark - 28 Feb 2016

Added the showvarnames and noheader options for the summary option, consistent with the search summary.

-- GeorgeClark - 16 Mar 2017
 
Topic revision: r4 - 16 Mar 2017, GeorgeClark
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy