| Name | ops-macro-doku |
|---|---|
| Version | 1.0 |
| Product Versions | any |
| Author(s) | Stefan Baader |
| Homepage | |
| Price | Free |
| License | n/a |
| JavaDocs | n/a |
| IssueTracking | n/a |
| Download JAR | n/a |
| Download Source | see below |
Description/Features
Easily explain your usermacros to your authors how to use with code example and rendered view.This user macro renderes any other user macro and shows 1. its usage and 2. its rendered example in a table with two columns: left the usage as wiki-code, right the rendered view .
Installation
Go to your Administration area / User Macros and create a new user macro called "ops-macro-doku". Copy and paste the following code:
##Autor: Stefan Baader
## Macro mit Code und Beispiel anzeigen
## {ops-macro-doku:titel}{macro}{ops-macro-doku}
#set($globalHelper=$action.getGlobalHelper())
#set($renderer=$globalHelper.getWikiStyleRenderer())
#set($context=$content.toPageContext())
#set($renderedContent=$renderer.convertWikiToXHtml($context, $body))
#set($renderedContent =$renderedContent.replaceAll("<p>",""))
#set($renderedContent =$renderedContent.replaceAll("</p>",""))
<table class="confluenceTable" width="100%">
<tr bgcolor="#dddddd">
<th class="confluenceTh">Code</th>
<th class="confluenceTh">Beispiel</th>
</tr>
<tr>
<td class="confluenceTd" width="30%">$body</td>
<td class="confluenceTd" width="70%">
<div style="width:100%; max-height:200px; overflow:auto">
$renderedContent
</div>
</td>
</tr>
</table>
Usage
{ops-macro-doku:titel}{macro}{ops-macro-doku}
Examples
{ops-macro-doku:titel}{macro}{ops-macro-doku}
