DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:htmlabstract

HtmlAbstract Plugin

Compatible with DokuWiki

>= 2009-02-14b

plugin Integrates any DokuWiki RSS feed with HTML formatted abstracts.

Last updated on
2016-11-07
Provides
Syntax

Tagged with abstract, feed, html, rss

Download and Installation

  1. Install the plugin :
    • Automatically : use the Plugin Manager with the download URL above.
    • Manually : download plugin from download URL above, and unzip package directly in lib/plugins/ directory.
  2. That's done! Now you can configure it using the configuration page.

Syntax

{{htmlabs><feed_url>[&feed=options] [integration options]}}

Feed URL (mandatory)

Feed options

This plugin is made for to work with the feed.php file available in the DokuWiki package, so most of options which are available for this feed are available for htmlabstract plugin too, except content option, which is automatically set to HTML, and type which is set to RSS 2.0 .
These options (linkto, mode, num, minor) and their description are viewable on this page.
Note : these options must be separated by the & sign, and set with = sign, like in URL schemes.

Integration options

By default, the feed will be integrated including

  • the title of the page as a link to the diff table (or whatever you configured using feed options)
  • the author of modifications
  • the date of the modifications

If you want to skip one of these details, just add one of the following options :

  • notitle (A link to the page will still append at the end of the preview)
  • noauthor
  • nodate

Plugin options

These options are available in the config page.

  • paragraph : if enabled, htmlabstract will try to cut the abstract at the end of a paragraph, instead of the middle of a sentence / word
  • maxlength : maximal length of the abstract's text
  • textlink : the text to be put at the end of abstracts as a link to the page
  • bg_color : background color for abstracts

Examples

{{htmlabs>feed.php?num=42&ns=misc notitle noauthor}}

will integrate the 42 last modifications in the namespace misc, displaying the date of modification for each item.

{{htmlabs>feed.php?minor=1 nodate}}

will integrate the x last modifications, including minor changes, and displaying the page's title and the author of the modification for each item. (x being what you configured for your DokuWiki.)

Demo

A demo of the plugin can be seen here.
Please feel free to add your own links if you use it! ;-)

Changelog

2016/11/07

  • Fixed date info in plugin description to fix a permanent update warning.

2011/07/10

  • Resurrected download link thanks to Håkan Sandell who sent me a saved package of my lost code.
  • Fixed date display problem.

2010/07/23

  • Fixed some bugs for W3C compliance. :!:Be careful : the integration of previews in the DW page is W3C compliant, but it's yours to check that the pages you want to integrate are OK!

2010/07/22 From suggestions by Vincent Fleury :

  • HtmlAbstract was severely revised, and doesn't add a feed builder anymore. This way, it shouldn't create RSS event conflicts!
  • Abstracts visibility is improved by a background color, which is configurable in plugin options.
  • Now allows to integrate another RSS feed than the local one, as long as this one is generated by a DW feed builder. (It probably could works with another feed, but parsing errors may occur… my aim wasn't here, so it's yours to test!)

2009/12/15 As suggested by Mc.Prins :

  • Now uses DOKU_URL variable for building path to feed.php, instead of $_SERVER. That should allow using this plugin even in not root-installed wikis.

2009/11/28 As suggested by Anonymous :

  • Link's text now automatically adapt to wiki's language (fr/en only) if no particular message is set in options.
  • Date format now uses dformat parameter available in configuration page. (Config page ⇒ Display Settings ⇒ dformat)

2009/11/16

  • Doesn't consider HTML tags in calculating article's length anymore, so previews should be far more regular in length.
  • Doesn't display grey bars between items anymore, use a div to pad them.

2009/11/15

  • First release.

Nota Bene

Don't hesitate to post feedback (or to mail me if I don't seem to notice your remarks), and to post links to pages where this plugin is used! It's particularly motivating for enhancement! =)
And don't forget to use popularity plugin! ;-)

User feedback

Bug :

cache file from htmlabstract's feed is in conflict with the usual DokuWiki feed

Fixes :

in feed.php change
  // the feed is dynamic - we need a cache for each combo
  // (but most people just use the default feed so it's still effective)
  $cache = getCacheName(join('',array_values($opt)).$_SERVER['REMOTE_USER'],'.feed');


for

  // the feed is dynamic - we need a cache for each combo
  // (but most people just use the default feed so it's still effective)
  $cache = getCacheName(join('',array_values($opt)).$_SERVER['REMOTE_USER'],'.htmlabstractfeed');
  $cmod = @filemtime($cache); // 0 if not exists




Bug :

an 'FEED_ITEM_ADD' event is throw by feed.php from HTML abstract.
and this event is in conflict with normal feed.php from DokuWiki. then when you build an action plugin on 'FEED_ITEM_ADD' you get 2x more events ;)

Fixes :

comment thoses lines in feed.php

        // finally add the item to the feed object, after handing it to registered plugins
        $evdata = array('item'  => &$item,
                        'opt'   => &$opt,
                        'ditem' => &$ditem,
                        'rss'   => &$rss);
        $evt = new Doku_Event('FEED_ITEM_ADD', $evdata);
        if ($evt->advise_before())
          ....
        $evt->advise_after(); // for completeness
          


fleury vincent for : http://www.tangueando.fr

Problems solved in last update, which where there's no feed.php added. Thanks for your suggests ;-)
Vince / {psycho.}
Thanks! Very useful addition. With this plugin, DokuWiki can get a CMS type of “frontpage”, solving the problem of what to put there. ;-) Would be nice if the date format and the “Read more” could be according to default language. Cheers!
For the format and the link's text, I've planned to do that, but I'm currently under pressure at work, so I won't be able to work on before a few weeks :-(. Thanks for the feedback and suggests,
Vince / {psycho.}
Finally found time! Hope this is what you wanted ^_^. Cheers and thanks again!
Vince / {psycho.}
seems this plugin at the moment only works when DokuWiki is installed in the root of the server as you construct the path to your feed.php (line 65 in syntax.php) by using the [SERVER_NAME], you should use the proper DokuWiki variable DOKU_PLUGIN/htmlabstract/feed.phpfor this (which you have included in the plugin). please change this ASAP because it's a really useful plugin! — mailto:mc [dot] prins [at] gmail [dot] com
You're right, I didn't consider the possibility to not install DokuWiki in the root. Fixed! Now uses DOKU_URL.
Vince / {psycho.}
plugin/htmlabstract.txt · Last modified: 2016-11-07 22:27 by 82.66.82.155