format="" of FormattedSearch already has a $summary that returns the first 162 characters of a topic in plain text, stripped of all markup. It supports now a $summary(options); the options are comma separated tokens: 16 ... 512 indicates the number of characters shown in the summary
showvarnames shows the variables as VARIABLE and VARIABLE{...}; they are removed by default
noheader suppresses the headings at the beginning
$summary(showvarnames, noheader, 50) shows a summary of 50 characters with stripped heading on top and stripped variables
Interactive Example:
%SEARCH{ ".*" regex="on" order="modified" reverse="on" limit="10" nosearch="on" header="|*Topic: $summary*|*$summary()*|" format="|$topic:%BR% $summary|%BR%$summary()|" }%
| Topic: $summary | $summary() |
|---|---|
| TWikiOrgWebsiteFacilitatorTaskTeam: TWiki.org Website Facilitator Task Team SvenDowideit proposes an initial TWikiOrgWebsiteFacilitatorTaskTeam, which could start by creating a couple of news webs ... |
TWiki.org Website Facilitator Task Team SvenDowideit proposes an initial TWikiOrgWebsiteFacilitatorTaskTeam, which could start by creating a couple of news webs ... |
| TWikiGovernanceConsolidated: TWiki Governance Consolidated We have as of August 31st, 2008 TWO proposals for the future Governance of TWiki. We need ONE proposal so we can again become ONE community ... |
TWiki Governance Consolidated We have as of August 31st, 2008 TWO proposals for the future Governance of TWiki. We need ONE proposal so we can again become ONE community ... |
| BulgarianTranslation: Bulgarian User Interface for TWiki Several months ago I downloaded TWiki and played around with it. Several days ago I downloaded it again and found that it perfectly ... |
Bulgarian User Interface for TWiki Several months ago I downloaded TWiki and played around with it. Several days ago I downloaded it again and found that it perfectly ... |
| SpellChecker: I'd like to see a spell checker. I'm notoriously bad at spelling and any help would be appreciated. I have noticed that Ward Cunningham's Wiki has a spell checking ... |
I'd like to see a spell checker. I'm notoriously bad at spelling and any help would be appreciated. I have noticed that Ward Cunningham's Wiki has a spell checking ... |
| WebSegregation: Feature Proposal: Separating Webs with their own WEBMASTER Motivation This would be a useful feature if the setup you have is crying out for separate TWikis for each ... |
Feature Proposal: Separating Webs with their own WEBMASTER Motivation This would be a useful feature if the setup you have is crying out for separate TWikis for each ... |
| VarENCODETransformNewlineIntoHTML: Feature Proposal: VarENCODE with an adicional parameter type to convert newlines into HTML Motivation Forms with textareas allow newlines to be entered. If the contents ... |
Feature Proposal: VarENCODE with an adicional parameter type to convert newlines into HTML Motivation Forms with textareas allow newlines to be entered. If the contents ... |
| WebStatistics: Statistics for Codev Web See also: TWikiOrgStatistics, TWikiDownloadStatistics Month: Topic Views: Topic Saves: Attachment Uploads: Most ... |
Statistics for Codev Web See also: TWikiOrgStatistics, TWikiDownloadStatistics Month: Topic Views: Topic Saves: Attachment Uploads: Most ... |
| TWikiHeart: TWiki Heart TWiki is about technology, but at the same time also about collaboration and human interaction. The TWiki robot represents both, technology and feeling ... |
TWiki Heart TWiki is about technology, but at the same time also about collaboration and human interaction. The TWiki robot represents both, technology and feeling ... |
| TWikiOrgSkin: TWiki.org skin Development and discussion topic for the new (2008) twiki.org skin. Why do we need a new layout for twiki.org? This site uses pattern skin, the default ... |
TWiki.org skin Development and discussion topic for the new (2008) twiki.org skin. Why do we need a new layout for twiki.org? This site uses pattern skin, the default ... |
| TWikiForWindowsPersonal: TWiki for Windows Personal (TWiki WP 4.0.5 2006 12 27) Download TWiki 4.0 TWiki WP 4.0.5.zip (14MB) This is a ready to use TWiki installation for personal use on ... |
TWiki for Windows Personal (TWiki WP 4.0.5 2006 12 27) Download TWiki 4.0 TWiki WP 4.0.5.zip (14MB) This is a ready to use TWiki installation for personal use on ... |
$summary(noheader) funtionality.
While we are at it, should we change the default summary shown in search? Possibly with the variables stripped by default? Or should that also be a TWikiPreferences setting?
-- PeterThoeny - 25 Sep 2004
I would vote to strip the variables. "TOC PUBURL / TWIKIWEB" is not useful when reading a summary. I wonder if it would ever be, perhaps someone can think of borderline cases.
-- ArthurClemens - 25 Sep 2004
It looks like it is better to remove the vars by default. That means, we should change the novariables option to showvariablenames. Opinions?
-- PeterThoeny - 25 Sep 2004
I vote for stripping them (or would if there was a vote button).
Actually, a simple improvement would be to show me something interesting in the summary - how about the text of the last diff?
-- MartinCleaver - 26 Sep 2004
Text of last diff: This is out of scope of this feature here; it has been discussed in AllowDesignationOfSummary
OK, the novariables option should change to showvariablenames.
-- PeterThoeny - 28 Sep 2004
SVN and TWiki.org are updated with the spec change: Reversed logic and renamed novariables to showvarnames.
-- PeterThoeny - 28 Sep 2004
Hmm, I am preaching compatibility for existing content but this enhancement broke one TWikiApplication at work that has nested searches. One outer search introduces newlines; the $n got evaluated one level too early. This code fixes the issue:
--- Search.pm (revision 1762)
+++ Search.pm (working copy)
@@ -965,10 +965,6 @@
$tempVal =~ s/\$formfield\(\s*([^\)]*)\s*\)/getMetaFormField( $meta, $1 )/geos;
$tempVal =~ s/\$formname/_getMetaFormName( $meta )/geos;
$tempVal =~ s/\$pattern\((.*?\s*\.\*)\)/getTextPattern( $text, $1 )/geos;
- $tempVal =~ s/\$nop(\(\))?//gos; # remove filler, useful for nested search
- $tempVal =~ s/\$quot(\(\))?/\"/gos; # expand double quote
- $tempVal =~ s/\$percnt(\(\))?/\%/gos; # expand percent
- $tempVal =~ s/\$dollar(\(\))?/\$/gos; # expand dollar
$tempVal =~ s/\r?\n/$newLine/gos if( $newLine );
if( $theSeparator ) {
$tempVal .= $theSeparator;
@@ -977,6 +973,10 @@
}
$tempVal =~ s/\$n\(\)/\n/gos; # expand "$n()" to new line
$tempVal =~ s/\$n([^$mixedAlpha]|$)/\n$1/gos; # expand "$n" to new line
+ $tempVal =~ s/\$nop(\(\))?//gos; # remove filler, useful for nested search
+ $tempVal =~ s/\$quot(\(\))?/\"/gos; # expand double quote
+ $tempVal =~ s/\$percnt(\(\))?/\%/gos; # expand percent
+ $tempVal =~ s/\$dollar(\(\))?/\$/gos; # expand dollar
} elsif( $noSummary ) {
$tempVal =~ s/%TEXTHEAD%//go;
This change is now in SVN.
-- PeterThoeny - 19 Oct 2004
Small follow-up in MainBranch to remove leading and trailing spaces, needed to get correct text alignment for summaries in table cells.
-- PeterThoeny - 09 Nov 2004
| ChangeProposalForm | |
|---|---|
| TopicClassification | FeatureRequest |
| TopicSummary | Formatted Search with $summary(50, noheader, showvarnames) |
| CurrentState | MergedToCore |
| OutstandingIssues | |
| RelatedTopics | |
| InterestedParties | |
| ProposedFor | DakarRelease |
| TWikiContributors | PeterThoeny |