Thank you Hans for your help ;
easy enough to write and sounds a smart idea to treat anchor as ptv without
the need to define a new markup. And at least strongly distinctive. That's
in my config now and soon in doc.

For complete information, can you explain how your code let ptv visible, as
compared to the original code which makes ptv invisible ?

your code :
"/(\\[\\[#(\\w[-\\w]*)\\]\\](?: *\n)?)(.*?)(\\[\\[#\\2end\\]\\])/s";
vs original code :
'/\\(: *(\\w[-\\w]*) *:(?!\\))\\s?(.*?):\\)/s'));

2015-01-18 10:10 GMT+01:00 Hans Bracker <[email protected]>:

> PS:
>
> one could define anchored sections as PTVs.
>
> Add to config.php:
>
> # make it possible to treat [[#section]] .... [[#sectionend]] as a PTV of
> name 'section'
> $PageTextVarPatterns['[[#anchor]]'] =
>   "/(\\[\\[#(\\w[-\\w]*)\\]\\](?: *\n)?)(.*?)(\\[\\[#\\2end\\]\\])/s";
>
>
> then any section of form
>
> [[#section]]
> your text
> goes here..
> ..
> ..
> ....
> [[#sectionend]]
>
> is a PTV with name 'section'. Put in your choosen anchor name instead.
> Note  the  syntax  of  the  ending  anchorname:  PTV-name  with  'end'
> appended.  Anchor  names  must  start  with  a letter, but can contain
> numbers and underscores.
>
> The  advantage  of  using  anchors as PTVs is that you could reference
> those  sections  as PTVs and also as anchor sections, use them in urls
> for  instance.  The markers are also invisible.  But they maybe not as
> easy to write as what you hope.
>
> Best,
>  Hans
>
>


-- 

---------------------------------------
| A | de la langue française
| B | http://www.languefrancaise.net
| C | [email protected]
---------------------------------------
       @bobmonamour
---------------------------------------
_______________________________________________
pmwiki-users mailing list
[email protected]
http://www.pmichaud.com/mailman/listinfo/pmwiki-users

Reply via email to