Dokuwiki - Metadata Renderer

Card Puncher Data Processing

About

A metadata is a renderer type (parsing mode) that is used to create metadata.

See:

Type

Internally DokuWiki maintains two arrays of metadata

  • current (current metadata should only be set in the context of the renderer as it will be overwritten the next time metadata is rendered)
  • persistent. (The persistent array holds duplicates of those key/values which should not be cleared during the rendering process.)

If you want to create logic that persists:

  • only in the scope of a session (example, add a library at the end of a template if a syntax is present): use current
  • for all scope that is data dependent: use persistent

Management

Start

Metadata: The metadata rendering is only started by the p_get_metadata() and p_set_metadata().

with the render option possible values:

  • METADATA_RENDER_USING_CACHE (default)
  • METADATA_DONT_RENDER,
  • METADATA_RENDER_USING_SIMPLE_CACHE,
  • METADATA_RENDER_UNLIMITED (also combined with the previous two options),

Set

Persisent:

Current:

  • renderer→meta

Example

global $ID
p_set_metadata(
    $ID,
    array($key => $value),
    $render = false,
    $persistent = true
);

Event

https://www.dokuwiki.org/devel:event:parser_metadata_render - Signalled by p_render_metadata() in inc/parserutils.php before instantiating the metadata renderer.

Get

To get persistent metadata

To get volatile meta:

  • renderer→meta

Update

Metadata update happens asynchronously via the taskrunner

The task runner is located in lib/exe/taskrunner.php and is included as hidden image by the tpl_indexerWebBug() function.





Discover More
Card Puncher Data Processing
Dokuwiki - Media

This page is showing snippet on how to manage media Via the renderer, you have the internalmedia and externalmedia method. From plugin-medialist...
Card Puncher Data Processing
Dokuwiki - Plugin Development

This pages are notes above the devel:unittesting page. an _ (underscore) is a reserved character and cannot...
Card Puncher Data Processing
Dokuwiki - Renderer

The wikipage parsing process has two stages: generation of the instructions by the devel:parserHandler and next the generation of output via a renderer (with these instructions as input.)
Card Puncher Data Processing
Dokuwiki - Renderer Mode

Renderer Mode The special mode metadata does not output anything but collects metadata for the page. Use it to insert values into the metadata array. i stands for instructions. A page is...



Share this page:
Follow us:
Task Runner