...
Section |
---|
Column |
---|
Features- Supports capabilities for including data similar to other scripting macros.
- Supports find and replace for adjusting resulting output.
- Allows the user administrators to restrict the usage of Javascript in the HTML macro (based on Allow Javascript in the Configuration pagerefer to Allow JavaScript in Configuration settings). The Confluence page throws a rendering error if this parameter is not enabled, and Javascript is inserted while using the macro.
Other HTML macros |
|
Tip |
---|
By default, header content is excluded as it could interfere with Confluence page HTML. Use head=true to include anyway, provided it does not disturb the content. |
Parameters
Table plus |
---|
Macro Editor Label | Default | Description | Macro Parameter |
---|
Format | html | Specify how the output is treated. The options are as follows: - html - data is entered as standard HTML directly in the macro body
- xhtml - data is treated as XHTML and rendered with the Confluence XHTML renderer prior to display
- wiki - data is surrounded by a noformat macro. This is a very special case.
| output | Profile |
| Enter the profile name to be transformed . For . Refer to this link to know more about profiles. Contact your Confluence administrator for further information about the profiles , contact your Confluence Administratoravailable in your instance. | profile name | Location of HTML data | macro body | Enter the location of data. If specified, the included data follows the body data (if any). - #http... - Data is read from URL. May require the user and password parameters as well.
- ^attachment - Data is read from an attachment to the current page.
- page^attachment - Data is read from an attachment to the page name provided.
- space:page^attachment - Data is read from an attachment to the page name provided in the space indicated.
| script | Find regex patterns |
| Enter a comma separated list of regex patterns to use to post-process the output HTML with find and replace logic. Example: (href=)(/display) | find | Replacement strings |
| Enter a comma separated list corresponding to find patterns via index position in list. If a comma is a part of an entry, use single quotes around it. Example: $1$base_url$2 | replace | File encoding | system default | Specify the encoding for an external file, if different from the system default handling. Example: UTF-8. | encoding | Timeout in milliseconds |
| Enter time in milliseconds such that URL connections do not timeout before getting data. Use this to increase time needed for slow connections. Note that if a zero is given the connection may wait infinitely. | timeout | User id for URL connection |
| Enter the user name for URL access via basic authentication. | user | Password for URL connection |
| Enter the password for URL access via basic authentication. | password |
|
...
The following examples show how you can use the macro to render HTML content:
HTML from a file in the script folder in the Confluence home directory
No Format |
---|
{html:script=#example.html}
{html}
|
HTML from an attachment
No Format |
---|
{html:script=^example.html}
{html}
|
HTML put within {noformat} panel
No Format |
---|
{html:output=wiki|noPanel=true}
Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
Aliquam fermentum vestibulum est. Cras rhoncus.
{html}
|
HTML from an URL
No Format |
---|
{html:script=#http://localhost/example.html}
{html}
|
Use of CSS inline style sheet
No Format |
---|
{html}
<P style="font-size: x-large; color: #8000">
Using inline style sheets - or is that inline styles?
</p>
{html}
|
Use of CSS external style sheet
No Format |
---|
{html}
<LINK href="http://www.cssgarden.com/css/T22/keylime_0001.css" rel="stylesheet" title="default" type="text/css"></LINK>
<H1>Absolute </H1>
{html} |
...