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

Patrick R. Michaud pmichaud
Wed Jun 16 07:05:59 CDT 2004


On Wed, Jun 16, 2004 at 10:43:42AM +0200, Christian Ridderstr?m wrote:
> I think it'd look pretty and *very* intuitive if
>         [[include:PageName#1-20]]
> included lines 1-20. Is there anything bad with using this?

No, not in itself, but it seems to me that whatever is used should
match the syntax used to include the text between two anchors 
(i.e., #start#end).  #start-end doesn't work because hyphens are
allowed in anchor names--it would need to be #start-#end, in which
case the hyphen seems superfluous and possibly confusing (is it "start"
or "start-"?).

> > [...]  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
> 
> See my other mail for an example of how it could be useful.

Umm, my original line about usefulness was about being able to say
something like "the three paragraphs *before* #someanchor" -- I didn't
see anything in your other mail that addressed this.  Sorry if I missed it.
I know that there's a strong usefulness to being able to include 
lines/paragraphs/anchors *after* #someanchor, that's why I'm proposing
the syntax change.

> > My best idea so far is to make use of the + sign somehow (+ isn't allowed
> > in anchor names)
> 
> Is '-' allowed in achor names?

Yes, which IMO makes it unsuitable for part of the include syntax.  

> >     SomePage#from+0a      #from up to the next anchor
> >     SomePage#from         shortcut for above
> 
> I like the above, but... [...]
> * I think 'SomePage#from' should be equivalent to 'Somepage#from+1p', i.e
>   the default is to include the entire paragraph. That's something I'd 
>   need a lot more often.

So far my reading of comments from others, as well as my own experience,
is that 'SomePage#from' implies including a section (up to the next
anchor) more than it does a paragraph.  This is likely because the
markup naturally references anchors (#), not paragraphs.

> Why not allow a '#' in 'SomePage+1p', making it 'SomePage#+1p'. To me an 
> empty anchor would imply the beginning. Without the '+' I think that it's 
> a part of the page name...

Makes sense to me.

> > 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).
> 
> How about one of these:

 	[[include:Page#from+]]            looks good to me
 	[[include:Page#from-]]            probably not
 	[[include:Page#from -]]           definitely not
 	[[include:Page#from..]]           perhaps
 	[[include:Page#from#]]            looks okay to me
 	[[include:Page#from#-]]           no, definitely confusing
 	[[include:Page#from#END]]         okay

Pm 



More information about the pmwiki-users mailing list