×
The 2025 Client Survey is now open! Responses will be accepted up until 10/31. Please feel free to share this link within your organization and we thank you in advance for your participation!

List of Macros

The following macros work when encased in curly braces. Parameters values follow the macro name, separated by colons. Escape special characters such as "[" and "{" within your macro text using a backslash. For example, {list-of-macros} was used to create the following table:

MacroDescriptionParameters
anchorAnchor Tagname: anchor name.
codeDisplays a chunk of code with syntax highlighting, for example Java, XML and SQL. The none type will do nothing and is useful for unknown code types.1: syntax highlighter to use, defaults to java. Options include none, sql, xml, and java (optional)
commentWraps comment text (which will not appear on the rendered wiki page).none
divWraps content in a div tag with an optional CSS class and/or style specified.class: the CSS class that should be applied to this tag.
style: the CSS style that should be applied to this tag.
file-pathDisplays a file system path. The file path should use slashes. Defaults to windows.1: file path
h1Wraps content in a h1 tag with an optional CSS class and/or style specified.class: the CSS class that should be applied to this tag.
style: the CSS style that should be applied to this tag.
imageDisplays an image file.img: the path to the image.
alt: alt text (optional)
align: alignment of the image (left, right, flow-left, flow-right) (optional)
labkeyBase LabKey macro, used for including data from the LabKey Server portal into wikis.tree : renders a LabKey navigation menu.
treeId: the id of the menu to render can be one of the following: core.projects, core.CurrentProject, core.projectAdmin, core.folderAdmin, core.SiteAdmin
linkGenerate a weblink.1: Text of link, or URL if using a single parameter
2: URL (optional)
3: Image URL (unsupported)
4: CSS style for the span wrapping the anchor (optional)
list-of-macrosDisplays a list of available macros.none
mailtoDisplays an email address.1: mail address
new-tab-linkDisplays a link that opens in a new tab.1. Text to display
2. Link to open in a new tab
quoteDisplay quotations.1: source (optional)
2: displayed description, default is Source (optional)
spanWraps content in a span tag with an optional CSS class and/or style specified.class: the CSS class that should be applied to this tag.
style: the CSS style that should be applied to this tag.
studySee study macro documentation for description of this macro.See study macro documentation for description of this macro.
tableDisplays a table.none
videoEmbeds a video from a link.video: the video URL
width: width of the video frame (optional)
height: height of the video frame (optional)

Example: Using the Code Formatting Macro

Encase text that you wish to format as code between two {code} tags. Note that the text will be placed inside <pre> tags, so it will not line-wrap. For example,

{code:java}
// Hello World in Java

class HelloWorld {
static public void main( String args[] ) {
System.out.println( "Hello World!" );
}
}
{code}

which specifies that the Java formatting option should be used (which is the default behavior), will render as:

// Hello World in Java

class HelloWorld {
static public void main( String args[] ) {
System.out.println( "Hello World!" );
}
}

Example: Strike Through

The following wiki code...

{span:style=text-decoration:line-through}
Strike through this text.
{span}

...renders text with a line through it.

Strike through this text.

Example: Using the {div} Macro to Apply Inline CSS Styles

The {div} macro lets you inject arbitrary CSS styles into your wiki page, either as an inline CSS style, or as a class in a separate CSS file.

The following example demonstrates injecting inline CSS styles to the wiki code.

The following wiki code...

{div:style=background-color: #FCAE76;
border:1px solid #FE7D1F;
padding-left:20px; padding-right:15px;
margin-left:25px; margin-right:25px}

- list item 1
- list item 2
- list item 3

{div}

...renders in the browser as shown below:

  • list item 1
  • list item 2
  • list item 3

Example: Using the {div} Macro to Apply CSS Classes

To apply a CSS class in wiki code, first create a CSS file that contains your class:

.bluebox { 
background-color: #edf0f1;
border:1px solid #dee0e1;
padding-left:20px; padding-right:15px;
margin-left:25px; margin-right:25px
}

Then upload this CSS file to your LabKey Server site as a custom stylesheet. Navigate to Admin > Site > Admin Console > Look and Feel Settings > Resources tab to see any current custom stylesheet or replace with a new one.

Finally, refer to your CSS class with a wrapper {div}:

{div:class=bluebox}

- list item 1
- list item 2
- list item 3

{div}

Example: Using the {anchor} Macro

To define a target anchor:

{anchor:someName}

To link to the target anchor within the same document:

[Link to anchor|#someName]

To link to the target anchor in another document, where the document name is docName.

[Link to anchor|docName#someName]

Example: Colored Text Inline

  • To create
    RED TEXT
    :
{div:style=color:red;display:inline-block}RED TEXT{div}


previousnext
 
expand allcollapse all