< Previous | Front page | Next >
Skip to end of metadata
Go to start of metadata

You may use {snippet} macro to retrieve and display a snippet of source code from a remote URL (e.g. Subversion, Git repository etc.). This is very handy for documentation that includes code. This can ensure that code examples in your documentation are kept up-to-date since they are sourced from the original code, without copy&paste.

Full documentation for macro is available here.

There are two prefixes defined for this macro in our confluence so you may access source codes from:

prefix URL base
anonsvn.jboss.org/ http://anonsvn.jboss.org/repos/
github.com/ https://github.com/

For example:

macro shows you content from given github source file starting with line 37.

Code Snippet error: Unable to retrieve the URL: https://github.com/arquillian/arquillian-core/raw/master/examples/junit/src/test/java/com/acme/ejb31/NoInterfaceEJBTestCase.java status code: 404.
Always use title and lang parameters for this macro!
The content is cached for configurable period, defaulting to one hour, in order to improve performance. The snippet is also unindented to remove excess space.
Labels:
None
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.
  1. Oct 01, 2012

    Code Snippet error: Unable to retrieve the URL: https://github.com/arquillian/arquillian-core/raw/master/examples/junit/src/test/java/com/acme/ejb31/NoInterfaceEJBTestCase.java status code: 404.

    Is there an issue with content retrieval for just that code sample, or is that an issue with the macro?