Skip to content
Alexander Ljungberg edited this page Mar 16, 2023 · 2 revisions

This page lists the Macros that Gollum supports out of the box.

AllPages

  • Description: Prints a list of all wiki pages.
  • Syntax: <<AllPages()>>
  • Result (example): <ul id="pages"><li>AllPagesMacroPage</li></ul>

GlobalTOC

  • Description: Prints a clickable TOC (all pages site wise)
  • Syntax: <<GlobalTOC()>> you can also override the title: <<GlobalTOC("All pages")>>

Navigation

  • Description: Prints a clickable TOC (of all pages under the indicated path, or under the current page's path by default)
  • Examples:
    • <<Navigation()>>
    • <<Navigation("My TOC", "subdir", true)>>
  • Syntax: <<Navigation(title, subdir, full_path)>>
    • title: string, header above the printed TOC. Defaults to "Navigate in the TOC".
    • subdir: string, the subdirectory to list. Defaults to the current page's path.
    • full_path: true or false. Whether to display the full path to each page, instead of just the relative path under subdir. Default: false.

Series

  • Description: render Next: and Previous: links to navigate through a series of pages in the same directory. You can have a series of pages in a subdirectory named e.g. steps_1.md, steps_2.md, steps_3.md. Just add <Series("steps_")>> to them (or in the Header/Footer of course!) to generate links to the previous and following steps. This way you can easily generate, e.g., a step-wise user manual.
  • Usage: <<Series("prefix")>>
    • Will look for all pages with name starting with "prefix", and link to the pages of the series that immediately precede and follow the current page (by page name, alphanumerically sorted).

Video

Link to video files, generating a simple HTML5 video tag that allows you to play and control the video on your Gollum wiki page. Once PR 442 has been released, you can specify auto=true to get an inline video that autoplays, muted, on a loop (like a gif).

  • Syntax: <<Video(/pathname/filename)[, auto=true]>>
  • Example: <<Video(/uploads/product_tutorial.mp4)>>
  • Example: <<Video(/uploads/cool_demo_animation.mp4, auto=true)>>

Audio

Link to audio files, generating a simple HTML5 video tag that allows you to play and control the audio track on your Gollum wiki page.

  • Syntax: <<Audio(/pathname/filename)>>
  • Example: <<Audio(/uploads/product_tutorial.mp3)>>

Note & Warn Macro

You can add alerts to pages with the Note and Warn macros. These macros generate colored flash boxes to highlight important information. Each flash box by default also shows an octicon icon, but for notes this icon can be changed or disabled altogether.

  • Note Syntax: <<Note(string[, string])>>
    • Example 1: <<Note("Did you know?")>>
    • Example 2: <<Note("Did you know?", "bell")>>
    • Example 3: <<Note("Did you know?", "")>>

Screen Shot 2019-09-27 at 13 44 52

  • Warn Syntax: <<Warn(string)>>
    • Example: <<Warn("Careful, changing that file could be dangerous")>>

Screen Shot 2019-09-27 at 15 53 49

Octicon Macro

You can also add any Octicon icon to your page using the new Octicon macro. This macro takes a string name of the desired octicon and optional dimension parameters (width, height, respectively).

  • Syntax: <<Octicon(string[, integer, integer])>>
  • Example: <<Octicon("globe", 64, 64)>>