====== text (export / renderer) Plugin ======
---- plugin ----
description: Exports or Renders a page as plain text (previous author: Todd Augsburger)
author : Michael Hamann
email : michael@content-space.de
type : render
lastupdate : 2022-07-07
compatible : Binky, Ponder Stibbons, Hrun, Detritus, Greebo, Hogfather
depends :
conflicts :
similar :
tags : export, search
downloadurl: https://github.com/michitux/dokuwiki-plugin-text/tarball/master
bugtracker : https://github.com/michitux/dokuwiki-plugin-text/issues
sourcerepo : https://github.com/michitux/dokuwiki-plugin-text/
donationurl:
----
This plugin allows you to export a page to a plain text format usable as a simple document or to be used in further processing.
===== Usage =====
To export a single page add the following parameter to the page URL:
?do=export_text
To get a copy of rendered text in PHP (i.e. from a button or some other plugin) use:
global $ID;
$ID = $id; //necessary for correct metadata handling
$text = p_cached_output(wikiFN($id),'text');
===== Other plugins =====
The text renderer plugin was originally designed for use with the [[plugin:searchtext]] plugin, to provide both a basis for searching rendered text, and providing a rendered text snippet for displayed search result.
If you use other syntax plugins, their output may not appear correctly in the exported text unless:
-they specifically support the 'text' output format, or
-they support standard XHTML output and the text is suitable when stripped of its HTML markup
===== Discussion =====
To add a button to your template to access this plugin's output, try adding the following in your template at the point you would like the button to appear.
'export_text'),'get','export this page as text'); ?>
Note:
* 'text' will appear in the button, change as appropriate.
* 'export this page as text' will appear as a tooltip when you hover over the button. change as appropriate.
If you are not using a dev version or are on the latest stable use this code instead:
'export_text'),'get','export this page as text'); ?>
Or if you like pretty icon links rather than buttons:
:!: Please report any issues on the [[https://github.com/michitux/dokuwiki-plugin-text/issues|issue tracker]], feel free to create pull requests.