[dokuwiki] Re: Using DokuWiki_Plugin::render_text() to generate small piece of xhtml from some wiki template
- From: "Dmitry Katsubo" <dmarc-noreply@xxxxxxxxxxxxx> (Redacted sender "dma_k" for DMARC)
- To: dokuwiki@xxxxxxxxxxxxx
- Date: Wed, 26 Oct 2016 21:51:25 +0200
On 2016-10-20 02:12, Zen-Do.Ru wrote:
I mean not the template that fills a new wiki page (e.g. with a title).
I mean an output template, such as /lib/tpl/dokuwiki
A wiki page stays as it is, only its view in a browser would change with
whichever additional HTML we put there.
Alternatively, plugins can alter a page with JS, which could be easy:
https://www.dokuwiki.org/devel:plugin_file_structure#javascript
I don't think look&feel template cannot somehow help. Wiki snippet I want to
embed comes from another source and contains DokuWiki syntax -- how can
JavaScript help here?
(Of course that works if we form a text for a browser view.
Export would be another story).
Let's assume I have piece of wiki text received from external source and I
want it to be embedded into output HTML from plugin.
See plugins that embed external pages content into a current page:
https://www.dokuwiki.org/plugin:include
That plugin uses this approach (as least that is what I got):
$this->helper = plugin_load('helper', 'include');
$instructions = $this->helper->_get_instructions($id, $sect, $mode, $level,
$flags, $root_id, $secids);
$renderer->nest($instructions);
https://www.dokuwiki.org/plugin:tabinclude
That plugin uses the following flow:
tpl_include_page($pageid, ...) -> p_wiki_xhtml($pageid, $revision, ...) ->
p_render('xhtml',p_get_instructions(io_readWikiPage($file,$id,$rev)),$info,$date_at);
As I said in my earlier post, I know about the following way of doing this:
$info = null;
p_render($mode, p_get_instructions('Hello, <em>user</em>!'), $info);
I wonder if render_text($text, $format) could do the same, so I have less
parameters to pass. Or is it better to something like this:
$renderer->nest(p_get_instructions('Hello, <em>user</em>!'));
??
Thanks in advance.
--
With best regards,
Dmitry
--
DokuWiki mailing list - more info at
http://www.dokuwiki.org/mailinglist
Other related posts: