xref: /plugin/dbquery/renderer.php (revision 2e564e06806b572fcd4150c4267799087a935085)
1<?php
2
3/**
4 * DokuWiki Plugin dbquery (Renderer Component)
5 *
6 * Extracts code blocks from pages
7 *
8 * @todo this needs to be extended to get all the HTML blocks from sub sections
9 * @license GPL 2 http://www.gnu.org/licenses/gpl-2.0.html
10 * @author  Andreas Gohr <dokuwiki@cosmocode.de>
11 */
12class renderer_plugin_dbquery extends \Doku_Renderer
13{
14    /** @var bool remember if the first code block has been found already */
15    protected $codeFound = false;
16
17    /** @inheritDoc */
18    public function getFormat()
19    {
20        return 'dbquery';
21    }
22
23    /** @inheritDoc */
24    public function code($text, $lang = null, $file = null)
25    {
26        if ($this->codeFound) return;
27        $this->codeFound = true;
28        $this->doc = $text;
29    }
30
31}
32