wiki:IncludeMacro

Version 10 (modified by rjollos, 3 years ago) (diff)

Updated for change in path with [11532] and [11534].

Include external resources in a wiki page

Notes

This macro lets you include various things.

Currently supported sources:

  • HTTP - http: and https:
  • FTP - ftp:
  • Wiki pages - wiki:
  • Repository files - source:
  • Ticket comments - ticket:N:comment:M (3.0dev, syntax may be changed before release)

The default source is wiki if only a source path is given.

An optional second argument sets the output MIME type, though in most cases the default will be correct.

Permissions

The three remote sources (http, https, and ftp) require INCLUDE_URL to be rendered.

Anyone can add a call to these, however they will not be shown. This is not a replacement for render_unsafe_content, see below.

Configuration

If [wiki] render_unsafe_content is off (the default), any produced HTML will be sanitized.

Caution!

This is a potential security risk! Please review the implications render_unsafe_content before using this feature.

To enable the plugin:

[components]
includemacro.* = enabled

Example

Include another wiki page:

[[Include(PageName)]]

Include the HEAD revision of a reStructuredText file from the repository:

[[Include(source:trunk/docs/README, text/x-rst)]]

Include a specific revision of a file from the repository:

[[Include(source:trunk/docs/README@5, text/x-rst)]]

Tip

If you set the svn:mime-type property on the file, you can leave off the explicit MIME type.

Bugs/Feature Requests

Existing bugs and feature requests for IncludeMacro are here.

If you have any issues, create a new ticket.

Download

Download the zipped source from here.

Source

You can check out IncludeMacro from here using Subversion, or browse the source with Trac.

Recent Changes

[14552] by rjollos on 2015-04-20 18:11:22
3.0.0dev: Return a system message when a node doesn't exist.

This avoids a traceback in the logs when the node doesn't exist. Fixes #12256.

[14551] by rjollos on 2015-04-20 17:46:13
3.0.0dev: Reverse merge of [14438]. Refs #12238.

The changes will be improved on the ticket-12238 branch before being merged back to the trunk.

[14550] by rjollos on 2015-04-20 17:43:04
3.0.0dev: Moving ticket #12238 work to a branch for staging. Refs #12238.

Author/Contributors

Author: coderanger
Maintainer: coderanger
Contributors: