List of Macros

The following macros work when encased in curly braces. 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. Your code text will look like this:

// Hello World in Java

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

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: #edf0f1;
border:1px solid #dee0e1;
padding-left:20px; padding-right:15px;
margin-left:25px; margin-right:25px}

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

{div}

...generates the following HTML...

<div style="background-color: rgb(237, 240, 241); border: 1px solid rgb(222, 224, 225); 
padding-left: 20px; padding-right: 15px; margin-left: 25px; margin-right: 25px;"
>
<ul class="minus">
<li>list item 1</li>
<li>list item 2</li>
<li>list item 3</li>
</ul>
</div>

...which 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. (To upload a custom stylesheet, navigate to Admin -> Site -> Admin Console -> Look and Feel Settings -> Resources tab -> Click Browse next to Custom stylesheet).

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]


previousnext
 
expand allcollapse all