It's better when it's simple

User Tools

Site Tools


text (export / renderer) Plugin

Compatible with DokuWiki

  • 2023-04-04 "Jack Jackrum" unknown
  • 2022-07-31 "Igor" unknown
  • 2020-07-29 "Hogfather" yes
  • 2018-04-22 "Greebo" yes

plugin Exports or Renders a page as plain text (previous author: Todd Augsburger)

Last updated on

Similar to plaintext

Tagged with export, search

Needed for bookcreator, odtsupport, searchtext

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.


To export a single page add the following parameter to the page URL:


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 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:

  1. they specifically support the 'text' output format, or
  2. they support standard XHTML output and the text is suitable when stripped of its HTML markup


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.

<?php echo html_button('text',$ID,'t',array('do' => 'export_text'),'get','export this page as text'); ?>


  • '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:

<?php echo html_btn('text',$ID,'t',array('do' => 'export_text'),'get','export this page as text'); ?>

Or if you like pretty icon links rather than buttons:

<a href="<?php echo exportlink($ID, 'text')?>"><img src="<?php echo DOKU_BASE?>lib/images/fileicons/txt.png" alt="Text Export"></a>

:!: Please report any issues on the issue tracker, feel free to create pull requests.

plugin/text.txt · Last modified: 2022-08-02 12:35 by michitux

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki