[Pmwiki-users] Idea for visual anchors

Patrick R. Michaud pmichaud
Thu Feb 5 17:29:28 CST 2004


[[append:Cookbook.VisibleAnchors]]    <--non-functioning demonstration

On Thu, Feb 05, 2004 at 10:09:52PM +0100, Christian Ridderstr?m wrote:
> 
> However, the solution I'm thinking of is that anchors (possibly using a 
> slightly different markup) would cause a visible 'anchor'-icon appear that 
> is a link to itself basically. This way, you just right click on the icon 
> and do "copy link adress".
> 
> One possible markup for an anchor that's visible like this could be:
> 	[[##anchor]]
> 
> and here's an example of what the HTML could be like:
> 	http://www.md.kth.se/~chr/test.shtml

If you want to try it, add to local.php:

    $LinkPatterns[780]["\\[\\[#$FragmentPattern\\]\\]"] =
      "<span id='$1' class='$1'><a href='#$1'>&#167;</a></span>";

This recognizes [[##anchor]] and produces a link sort of like what
you indicated on the test page.  I chose &#167; ('?') as the link text,
but you can put <img...> or whatever you want, and I used <span> instead
of <div> because [[##anchor]] might be used in inline text (<div> is block
markup by default).

Pm



More information about the pmwiki-users mailing list