Question
How is the variable TopicSummary defined and how can it best be used to encourage writers to provide a clear summary of a topic's subject matter?
I'm studying how to format TWiki searches and am curious about what exactly the Topic Summary variable includes. Is it simply the first x number of characters in a topic? Is is actually stored as metadata on a topic? I searched the TWiki documentation and don't see this clarified explicitly anywhere.
The next question I had in this area is regarding the section in the documentation entitled "Extract some text from a topic using regular expression." What is meant by "regular expression?" Does this refer to some standard unix formating? (Understand, I am very much a newbie to unix). Where would I look for more information on the syntax of these expressions? At first glance, the examples offered make absolutely no sense.
Thanks so much.
.
- TWiki version: Dec 01
- Web server: Apache
- Server OS: Unix
- Web browser: IE5
- Client OS: Mac OSX
--
LynnwoodBrown - 06 Apr 2002
Answer
Not sure about the topic summary, but you can always just try - I believe it's the first N characters.
As for regular expressions, try
Google:regular+expression+tutorial
- there are a lot of Net resources on this topic. As always, doing your own research will pay dividends.
--
RichardDonkin - 06 Apr 2002
Thanks Richard! That was just the bit of direction I needed.
What I'm wanting to achieve is to get some more control over what is displayed as the topic summary. My thought it that I can create a regular expression that displays only the first sentence, and then make sure the first sentence of the topic provides a concise summary. As per your suggestion, I will read up enough on regular expression to implement this for myself.
Thanks again.
--
LynnwoodBrown - 08 Apr 2002
For advice how to design web site,
http://www.useit.com
is my first choice. And it uses what it preaches! Most pages has on top summary with light-colored background. You can do it using tables and
TablePlugin.
Just begin your pages with something like:
| Summary: What is this page about? |
Then, you can look in regex for pipe (|). And TWiki table magic will render table nicely. Maybe somebody around can advise how to make table be wide 90% or 100% of page width...
--
PeterMasiar - 09 Apr 2002
I like what you are suggesting, Peter. I would like to encourage a standard format that provides a concise summary of each page or at least describe general subject matter beyond what can be expressed in a
WikiWord. I'm a big advocate of chuncking information into discrete, predictable pieces and I'm looking for the next larger chunck after
WikiWord. The TopicSummary does not completely fulfill this for me as most people are not necessarily conscious of the first n characters they write in a topic being the summary. Sometimes it is and sometimes it may not be. Considering this topic for example, my opening line is definitely not a good summary. I suspect a lot of people start out writing like in an email where the first line or two is just sort of a warm-up to the real topic.
(Actually, I think I will edit the first line to provide a better TopicSummary for benefit of anyone looking through the Support topic list.)
To serve my purposes, I would like to be able to define a
TopicSummary that is up to, say, 130 charaters (which is a little smaller than the current TopicSummary which I estimate is ~165 characters). I would like it to be clearly identified as the topic summary for the writer and to be extracted by a search. Your formating does both of these things. One could even do it more simply by having "Topic Summary:" in a topic template and then do the search for the text between that phrase up to the first punctuation.
I've begun reading up on regular expression and find it pretty daunting still. I understand the simplest elements but it gets complex quickly as one builds largers construction. I've studied Peter's example in the documentation using the
TWikiFAQ and haven't made much sense out of it yet. It looks like it does essentially what I suggested in the last paragraph. When I figure out how to do it, I'll post it here. (If someone else more versed in this wants to do it, I won't feel cheated of my learning opportunity!)
--
LynnwoodBrown - 09 Apr 2002
I've been looking a way to do the same thing lately. There should be a way to include certain number of letters into the
$pattern, since there is a regular expression .{min,max}, to include minimum "min" number of letters and maximum "max" number of letters (if the topic has less letters).
$pattern(.*?START(.*?)END.*) will keep all the text between START and STOP. But if I try something like this:
$pattern(.*?START(.{0-120}?)END.*) - it will only return those lines with zero or more letters and 120 or less letters. Other lines will not display at all.
--
MikkoLaakso - 13 Oct 2005
I did not try, but this
should work:
$pattern(.*?START(.{0-120}?).*?END.*)
--
PeterThoeny - 13 Oct 2005
See also:
AllowDesignationOfSummary