Not logged in. · Lost password · Register
Forum: General Help and Support Plugins RSS
linkbonus plugin [testing release]
extension for DokuWiki's external link syntax
Avatar
ryan.chappelle #1
User title: Chilean DW Fan
Member since May 2008 · 218 posts · Location: Temuco, Chile
Group memberships: Local Moderators, Members, Newsletter Team
Show profile · Link to this post
Subject: linkbonus plugin [testing release]
Hello everyone.

For those interested, I've released a proof-of-concept plugin that improves the syntax for external links in DokuWiki. The "linkbonus plugin" (tentative name) imitates the external link syntax ([[htp://some-server.com/some/path|Link Name]]) but adds specific features and works within regulated input.

Current features include:

  • Name/Title fetching: by adding the fetchname parameter, DokuWiki will try to retrieve the remote page's actual <title> and use it as the link name. If that's not possible, the plugin will default to the standard method of link name (the second parameter of the normal syntax).
  • Pipes: pipe characters (|) are used to separate parameters. If for some reason one needs/wants/fancies a pipe as part of the title or name, one can simply escape C-like: sometext\|somemoretext.
  • Links only: the plugin ignores "media links" ie, links where the name is a {{media link}} and thus those are left for DokuWiki to handle as usual.
  • Dead or Alive mode: if an external link points to an unreachable page (ie.: it has been 404'd or something like that), the plugin will display some sort of notification -- be it a small icon, strike-through, added message....
  • Server base syntax: a syntax mode that creates links always relative to the server root, regardless of virtual hosts, aliases or protocols.

Possible future features:
  • Ability to fetch the favicon and use it as link icon.
    • ... and possibly a method to cache favicons? So that they won't have to be requested every time, after all they're not likely to change in the short term...
  • Ability to set some standard link options: class, id, target, ...
  • Information for non-page links.
  • An option to always fetch external names, even if the fetchname parameter is not used (and maybe, a corresponding "nofetchname" parameter?).
  • Interwiki syntax.
  • Respect all configured schemes.
  • A better name...

----

How to use it:

Set up a link like this:
[[http://www.cnn.com/|CNN.com|Some news|fetchname]]

And it will show like this (note the mouseover tooltip):
[Image: http://ryan.gulix.cl/doku/lib/exe/fetch.php/dw-linkbonus.png]


Want to test the plugin? -- Be warned, this is the first third release and offers only basic functionality; what's more, the plugin's syntax, name or inner workings may change in the future. Not yet deterred? Then check the link below with your DokuWiki's plugin manager.

*Demo page and information
**Credentials: user=visitor; pass=doku-visitor will let you play in the Playground
*Download for plugin manager Updated 2010-04-09

Want to comment on the development? -- Use this thread or, better yet, comment on the plugin page's Discussion section.

When will the major release be ready? -- Short answer: Kittens. Long answer: it depends on what features I think are the minimum for an acceptable, usable release and whether I'm happy with the internal workings of the plugin, in particular how does it request external stuff.

Bye everyone!
Chilean DW Fan!
my plugins for DokuWiki
GULIX, my area's LUG
Surviving earthquakes since Feb 2010!
This post was edited 3 times, last on 2010-04-10, 06:33 by ryan.chappelle.
Edit reason: update to new devel version (Apr 2010)
poll
Poll: What do you want to see added in the Major Release?
(0 votes ·   0%) Automatic name fetching
(0 votes ·   0%) Support for other protocols
(4 votes · 50%) The "dead or alive" option
(2 votes · 25%) Fetch favicon
(0 votes ·   0%) XHTML-related link options (target and class, for example)
(One vote · 13%) ...an option to supersede DokuWiki's core syntax!
(One vote · 13%) ...sorry, I‘m not interested in this plugin.
This poll has ended in Feb 2010 · 8 votes
Avatar
ryan.chappelle #2
User title: Chilean DW Fan
Member since May 2008 · 218 posts · Location: Temuco, Chile
Group memberships: Local Moderators, Members, Newsletter Team
Show profile · Link to this post
Subject: second update on plugin development
According to the results of the thread poll:

(0 votes · 0%) Automatic name fetching
(0 votes · 0%) Support for other protocols
(4 votes · 50%) The "dead or alive" option
(2 votes · 25%) Fetch favicon
(0 votes · 0%) XHTML-related link options (target and class, for example)
(One vote · 13%) ...an option to supersede DokuWiki's core syntax!
(One vote · 13%) ...sorry, I‘m not interested in this plugin.

I have started implementing the dead-or-alive feature as well as some other features and starting the codebase to allow for the other features stated in the poll to be implemented in the future.

The details and downloads are just like stated in the main post:

http://ryan.gulix.cl/doku/doku.php/linkbonus#install

This version includes the following featurettes:

Dead-or-Alive Mode:

Adding the "doa" parameter to a link shows a special visual aid (a "missing link" style of border according to the installed template's colours) for links that are unavailable or report some sort of problem (like 404s). Right now the test looks for two possible conditions to identify "unavailable" pages:
  • Requesting the page via HTTP produces an HTTP error, like 404. It may affect redirects, I haven't tested.
  • An error prevents the plugin from obtaining any data. For example, a DNS resolution error, or the machine doesn't actually have an internet connection available.

Nested Syntax:

experimental AND DANGEROUS!!!

The plugin now allows for arbitrary syntax formatting inside links, for example like this:
[[http://www.wikipedia.org/|Wikipedia, the //supposedly// Free Encyclopedia that "//anyone//" can edit|Sarcastic link to Wikipedia]].

With this, italics or bolds in links have the desired effect.  However, this may allow for weird syntax to be included in links and ultimately for resulting syntax to break any sort of XHTML compliance as well as common sense -- things like tables inside links or heck, links inside links. You are absolutely responsible for the correct usage of this "feature".

This feature is a proof-of-concept only, and will be removed in further versions until I can either find a method to limit what syntax can be allowed (I haven't found reliable documentation on nest yet) or I am somehow convinced to drop it.

Features Pending:

In order of my precedence:

1.- more fine-tuned report of errors for dead-or-alive mode.
2.- favicon fetching (I'm working on it, but I'm facing caching issues).
3.- ... a name! (seriously, I've had about three different ideas but they're too similar to already taken stuff)
4.- optional parameters (class, target, etc).
5.- automatic name fetching

To comment, as stated above, contact me via mail (from my profile) or use this thread, or sign-up at the testing wiki and use the playground.
Chilean DW Fan!
my plugins for DokuWiki
GULIX, my area's LUG
Surviving earthquakes since Feb 2010!
Avatar
ryan.chappelle #3
User title: Chilean DW Fan
Member since May 2008 · 218 posts · Location: Temuco, Chile
Group memberships: Local Moderators, Members, Newsletter Team
Show profile · Link to this post
Subject: New version, 0.03
A relatively better version of the plugin has been released and a plugin page has finally been created!  ;-)

Version 0.03 of the plugin removes the (testing only) ability to do internal formatting. In exchange, it gets slightly better handling of connections (to fetch the title or test the page) and a new syntax mode for "server base" links ie.: links relative to the server's web address, in a manner similar to the Baselink plugin.

You are welcome to try this plugin and discuss either here or at the newly created plugin page at DokuWiki.


The plugin is undergoing development studies in order to improve the "dead-or-alive" mode (using Curl, maybe?) as well as the ability to include a future interwiki syntax, follow the configured schemes, recognizing non-page links (eg.: images or PDFs, for which a <TITLE> can not be obtained) and the possibility to supersede the standard DokuWiki syntax if indicated to do so.


Hoping to have the major version out, with all these new features and a better name, some day soon.
Chilean DW Fan!
my plugins for DokuWiki
GULIX, my area's LUG
Surviving earthquakes since Feb 2010!
Avatar
ryan.chappelle #4
User title: Chilean DW Fan
Member since May 2008 · 218 posts · Location: Temuco, Chile
Group memberships: Local Moderators, Members, Newsletter Team
Show profile · Link to this post
Subject: Linkbonus 0.04; now with favicons!
And surprise!

A new release of the linkbonus plugin is now available, and the wiki page will be updated.

Version 0.04+ of the plugin comes with several minor improvements; nothing major, but improvements towards usability nonetheless.

You are welcome to try this plugin and discuss either here or at the newly created plugin page at DokuWiki.

A brief of the changes follows:

  • Text formatting is available inside links in a controlled manner: bold, italics and deleted are allowed with the usual DokuWiki syntax by default. To disable, check the plugin page.
  • Remote fetch timeout is limited to one second, so that pages with many links don't hang while parsing. To enable a longer timeout, check the plugin page.
  • A new secret option, favicon, does what you think, for the most part. To enable this feature and check its limitations, consult the plugin page.
  • The dead-or-alive message in the tooltip is now i18n'ed (but I have only English for the moment).

The plugin is undergoing development studies in order to improve the "dead-or-alive" mode (using Curl, maybe?) as well as the ability to include a future interwiki syntax, follow the configured schemes, caching downloaded titles, and the possibility to supersede the standard DokuWiki syntax if indicated to do so.

As usual, a cleaning of the DokuWiki and browser cache are recommended after you install or update this plugin.

Seeing you all, major release should be in by the end of the year.
Chilean DW Fan!
my plugins for DokuWiki
GULIX, my area's LUG
Surviving earthquakes since Feb 2010!
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Go to forum
Imprint
This board is powered by the Unclassified NewsBoard software, 20150713-dev, © 2003-2015 by Yves Goergen
Current time: 2019-11-12, 05:54:10 (UTC +01:00)