Question
Hello,
All of our topics start out with a title line line, like:
---+ This ... is ... the ... title
We are using the
GenPDFAddOn. This addon can create custom title pages by setting the GENPDFADDON_TITLE variable.
I wish to use the title line of a topic as the title on the PDF frontpage, so I need to extract this line out of the current topic.
I tried to fill the title variable using:
%SEARCH{ ".*" scope="text" regex="on" nosearch="on" nototal="on" topic=%TOPIC% format="$pattern(.*?---\++\ (.*?[^\n\r]+).*)" }%
thinking that this would extract the title line out of the current topic.
But this doesn't work, I get the list of topics in the web.
Is there another (or better) way to do what I want?
Environment
--
GerritJanBaarda - 09 Jul 2007
Answer
If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.
Your SEARCH variable works with a tiny correction: Enclose the
%TOPIC% variable in quotes. I admit that the result of the query without quotes is very surprising. Looks like a quirk in TWiki's attribute parser which I am sorry to say that I am too lazy to examine right now
As a minor change I've removed the
.*? from your capture - it isn't necessary since the
[] construct should capture the same result anyway.
%SEARCH{ ".*" scope="text" regex="on" nosearch="on" nototal="on" topic="%TOPIC%" format="$pattern(.*?---\++\ ([^\n\r]+).*)" }%
Look here for a life example of the same regular expression:
Question
--
HaraldJoerg - 09 Jul 2007
Thanks! that did the trick...
--
GerritJanBaarda - 10 Jul 2007