External Pretty Code
Last modified by Vincent Massol on 2026/06/02 17:54
| Gets code located at an external URL and pretty prints it |
| Type | Snippet |
| Category | |
| Developed by | |
| Rating | |
| License | GNU Lesser General Public License 2.1 |
Table of contents
Description
Using XWiki Syntax 2.0
{{velocity}}
{{code language="java"}}
$xwiki.getURLContent("https://fisheye2.atlassian.com/browse/~raw,r=10166/xwiki/xwiki-platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/api/Api.java")
{{/code}}
{{/velocity}}Using XWiki Syntax 1.0
## Use a variable to bypass the code macro escaping running before velocity.
## The upper case is here to make sure it's bypassed even if another code macro
## follows our block
#set($codevar = "{CODE}")
$codevar.toLowerCase()
$xwiki.getURLContent("http://fisheye2.cenqua.com/browse/~raw,r=trunk/xwiki/xwiki-platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/api/Api.java")
$codevar.toLowerCase()