[Pmwiki-users] include part of a page syntax, revisited

Patrick R. Michaud pmichaud
Tue Jun 15 20:07:44 CDT 2004


Hi, all-

I'd like to revisit a discussion we held previously about potential
syntaxes for including parts of other pages.  The current syntax is

    [[include:PageName#start#end]]

which means include the portion of PageName between the [[#start]]
and [[#end]] anchors.  As a special case, #start and #end can be
numeric, in which case they refer to line numbers of the markup source
in the page.

I'd like to extend this markup somehow to be able to support
including a portion of a page starting from any anchor to include
the remainder of the page or the next N lines, paragraphs (delimited 
by blank lines) or anchors.  For orthogonality's sake it might be
nice to be able to include N lines/paragraphs/anchors before an ending
anchor, but I haven't come up with any real uses for this so it
won't hurt if it's not supported.  (Including *everything* before
a given anchor should of course be supported, but I think we can
continue to use the #1#end syntax for this.)

My best idea so far is to make use of the + sign somehow (+ isn't allowed
in anchor names), as in

    SomePage#from+10      ten lines after #from
    SomePage#from+3p      three paragraphs after #from
    SomePage#from+2a      #from and text following next two anchors
    SomePage#from+0a      #from up to the next anchor
    SomePage#from         shortcut for above

this would also allow

    SomePage+10           include first ten lines of SomePage
    SomePage#1#10         same as above
    SomePage#5+10         include ten lines starting with line 5
    SomePage+1p           include first paragraph of SomePage
    SomePage+2a           include start and next two anchors
    SomePage+0a           include everything up to first anchor
    SomePage#1#to         include everything before #to

The only item I'm unsure of is "include everything after #from", but I'm
sure we can come up with something appropriate for that (e.g., a pseudo-anchor
such as #end).

Comments, suggestions?

Pm



More information about the pmwiki-users mailing list