You can create user macros without writing a plugin through the User Macros administration menu. |
User Macros are a kind of Confluence plugin module.
User macro plugin modules are available in Confluence 2.3 or later |
User macro plugin modules allow plugin developers to define simple macros directly in the atlassian-plugin.xml file, without writing any additional Java code. User macro plugin modules are functionally identical to User Macros configured through the administrative console, except that they can be packaged and distributed in the same way as normal plugins.
User macros installed by plugin modules do not appear in the user macro section of the administrative console, and are not editable from within the user interface. They appear just as normal plugin modules in the plugin interface. |
Macro plugin modules are configured entirely inside the atlassian-plugin.xml file, as follows:
<atlassian-plugin name='Hello World Macro' key='confluence.extra.helloworld'>
<plugin-info>
<description>Example user macro</description>
<vendor name="Atlassian Software Systems" url="http://www.atlassian.com"/>
<version>1.0</version>
</plugin-info>
<user-macro name='helloworld' key='helloworld' hasBody='true' bodyType='raw' outputType='html'>
<description>Hello, user macro</description>
<template><![CDATA[Hello, $body!]]></template>
</user-macro>
<!-- more macros... -->
</atlassian-plugin>
|
属性 |
必須 |
既定値 |
指定可能な値 |
|---|---|---|---|
hasBody |
いいえ |
false |
|
bodyType |
いいえ |
raw |
|
outputType |
いいえ |
html |
|