This page contains a script which returns an HTML preview of a given page. By default, it is called automatically for the .wikilink and .wikiinternallink CSS selectors on all pages of the wiki on which it is installed.

The script returns a JSON object containing:

  • The rendered content of the page corresponding to the path given as parameter in the request.
  • The relative URL of the first image attached to that page, if any.

A typical input / output consists of:

  • Input: /XWiki/PagePreviewer?path=/xwiki/wiki/sandbox/view/Sandbox/&xpage=plain&outputSyntax=plain
  • Output:
    {
      "html": "<p>Lorem ipsum dolor sit amor.</p>",
      "image": "/xwiki/wiki/kuava/download/Sandbox/WebHome/XWikiLogo.png?rev=1.1"
    }
Tags:
Created by Ondřej Steffl on 2019/10/25 11:33