Learn about DokuWiki
Learn about DokuWiki
Compatible with DokuWiki
DokuWiki allows you to create links to pages, and to section headers. This plugin allows you to link to any arbitrary point in a page.
This plugin is extremely simple, so it's a good place to start if you're trying to figure out how to create a syntax plugin.
This syntax creates an anchor. Put it anywhere in your page, and links will automatically scroll to that point.
anchor_name is an arbitrary name of your choosing. It must begin with a letter, and must be lowercase.
text, if provided, is a block of text that the anchor will wrap in HTML. It's not all that useful, unless your template adds space or other decoration to empty anchor tags.
To link to an anchor from within DokuWiki:
Use standard DokuWiki syntax to link to the new anchor:
To link to an anchor from outside DokuWiki:
renderto suppress warnings in PHP 7.1.
The plugin inserts an unwanted newline after the anchor tag. But I want to create a glossary page with anchored entries of the form:
term – definition
It looks like the Bookmark plugin will serve my purpose.
While using anchor I found that you have to type the anchor_name in all lowercase letters to be compatible with the DW internal link mechanics, which converts the letters of a link to lowercase. To enable copy&paste of anchor names from other text-parts, it would be more convenient if the plugin did that itself.
I put an anchor at the bottom of a page.
If I use this internal link, DW jumps to the top of the page.
Isn't it possible to jump to the part of the page, where the anchor is defined?27.08.2013, Joe
Answer: It's possible that your DokuWiki template includes code that automatically scrolls to the top of the page after page load. You can confirm this by creating a link to a Doku section header and seeing if it behaves the same way.
I created the plugin files and tried to create a link.
Instead of creating an anchor is makes a link to /lib/exe/fetch.php?media=anchor:anchor_name:text
What am I doing wrong?
EDIT: My bad, I was using the syntax incorrectly! :) Great work!
2013/11/03/ 01:56 Stephen V
Just to tell that it works fine and mostly to tell that even the short notation for the anchor works.
This makes the anchors within the page independent of the source page.