[Pmwiki-users] Re: [[include: ... ]] part of a page

Jonathan Scott Duff duff
Tue May 4 08:16:14 CDT 2004


On Mon, May 03, 2004 at 08:34:27PM -0600, Patrick R. Michaud wrote:
> An open question is what should happen with [[include:SomePage#from]]
> if [[#from]] doesn't exist in SomePage-- should nothing be included?
> (I believe my current implementation includes the entire page, but I
> think my vote would be to include nothing in this case.)

I vote for whatever is the most obvious to the user (author) that there
is a problem that they need to fix. No output makes it obvious that
there's a problem but doesn't give a hint as to what the problem might
be. John Rankin's suggestion to output an appropriately
internationalized message to the effect that the anchor wasn't found is
better because it gives the author some clue as to the problem.

> In addition, since HTML doesn't allow anchor names to begin with 
> a digit, I've overloaded the syntax to use numbers as "pseudo-anchors" 
> representing line numbers in the markup of included file.  

Nifty!

> Thus, the following work:
> 
>    [[include:SomePage##5]]       - include the first 5 lines of SomePage
>    [[include:SomePage#5#]]       - include everything after the first 5 lines
>    [[include:SomePage#5#20]]     - include lines 6-20 of SomePage

Could those last two be "include everything from line 5 onward" and
"include lines 5-20"?  That would make more sense from a user
perspective IMHO.

-Scott
-- 
Jonathan Scott Duff
duff at pobox.com



More information about the pmwiki-users mailing list