NacoWiki PHP API

PluginIncludes
in package

PluginIncludes

This plugin can be used to include files into a document before rendering.

In a new line use: $include: file $ to include a file.

Include file paths are to the current directory unless they start with '/'. In that case they are relative to the root of the wiki.

Included files can further include more files if needed.

The included article can contain barriers of the form:

  • %
  • include-start
  • %

Or

  • %
  • include-stop
  • %

Whene these are present, only the lines between the barriers will be included. If the start barrier is missing, it will begin from the start of the article. If the stop barrier is missing, it will include all the way to the end of the article.

Barriers can be disabled using the syntax: $include: file --all.

You can change the include part of the barrier to a custom marker using the syntax: $include: file --mark=custom $. This example would change the barriers from include-start, include-stop to custom-start, custom-stop.

Tags
phpcod

PluginIncludes

Table of Contents

Constants

VERSION  = '2.1.0'

Methods

load()  : void
Loading entry point for this class
mdx_include()  : string
Include file implementation

Constants

Methods

load()

Loading entry point for this class

public static load(array<string|int, mixed> $cfg) : void

Hooks pre-render event implemented by this class

Parameters
$cfg : array<string|int, mixed>

mdx_include()

Include file implementation

public static mdx_include(NanoWikiApp $wiki, string $doc, string $html[, array<string|int, mixed> &$limit = NULL ]) : string
Parameters
$wiki : NanoWikiApp

running wiki instance

$doc : string

Document URL

$html : string

Input text

$limit : array<string|int, mixed> = NULL
Return values
string

text with included files


        
On this page

Search results