[pmwiki-users] Help for designing a new ptv pattern <<< my new multiline ptv pattern >>>

Hans Bracker design at softflow.co.uk
Sun Jan 18 03:10:55 CST 2015


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                         




More information about the pmwiki-users mailing list