[pmwiki-users] Include specific lines of text on a page

Peter & Melodye Bowers pbowers at pobox.com
Sat Jan 19 07:43:27 CST 2008


I think this approach from Hans (below) should be cookbook-ized.  I think it
could very easily become a very useful component in various situations.
Maybe change the markup to this?

 

(:grep "regex" wikifilename/pattern . :)

 

And then tomorrow I can ask for this?

 

(:grep options=[vqcn.] "regex" wikifilename/pattern . :)

 

And then the next day I can ask for this?

 

      (:pipe (:grep .:) (:grep "regex" STDIN:) (:cut -d\t -f2 STDIN:) (:tail
-n 10 STDIN:):)

 

And then.  OK, I'll stop.

 

-Peter

 

==(snip)===

 

From: Hans <design5 at softflow.co.uk>

.

A different approach, I thought, would be to extract text rows from

a page which contain a certain string. Here is a definition of a markup

expression which does this. It should be added to config.php:

 

$MarkupExpr['textrows'] = 'ExtractTextRows($pagename, @$args[0],
@$args[1])';

function ExtractTextRows($pagename, $str, $source) {

        if ($str=='' || $source=='') return '';

        $pn = MakePageName($pagename, $source);

.

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: /pipermail/pmwiki-users/attachments/20080119/516163fe/attachment.html 


More information about the pmwiki-users mailing list