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

Knut Alboldt alboldt
Wed Jun 16 12:04:46 CDT 2004


At 04:07 16.06.2004, Pm wrote:

>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.)

wonderful idea !

>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).

I'll suggest using something like

    SomePage#5#10          include line 5 to 10
    SomePage##10            include line 1 to 10
    SomePage#20#            include line 20 to end
    SomePage#20#+10     include line 20 to +10 = 30 (although this would be 
obsolete)

    SomePage#marka#+10          include from #marka to #marka + 10 lines
    SomePage#marka#+10p        include from #marka to #marka + 10 paragraph
    SomePage#marka#+5a          include from #marka to #marka + 5 anchors
    SomePage#marka#                 include from #marka to end

    SomePage#2a#5a                   include from 2nd anchor to 5th anchor
    SomePage#2a#+5a                 include from 2nd anchor to 7th anchor
    SomePage#2a#                       include from 2nd anchor to end
    SomePage##3a                       include from start to 3rd anchor
    SomePage#1#3a                        same

If you need a defined end you could use $. At least for unix-people it 
would be simple to remember (ok, maybe not for non-IT-authors, #end may be 
better)
I think using the general format of "pagename" + "#" + startdefinition + 
"#" + enddefinition with start / enddefinition = "anchorname" | number + 
"p" | number + "a" (or even number + l lowercase L) would be easy to recognize

Knut

PS: interesting would be:  somepage#10a#-6a  :-) 




More information about the pmwiki-users mailing list