Macros

In addition to the Markdown syntax, wiki pages can include Macros, which perform additional functions on a page, like generating an image gallery, including parts of other pages, etc. Macros make Shellwiki truly dynamic and flexible.

attachments

Lists the files attached to a page, i.e.

<<attachments>>
<<attachments /some/page>>

changes

Similar to <<pagelist>> (see below), but display missing and outdated translations in multilanguage setups.

Arguments:

  • --system - includes "system" pages in listing, that is pages in bracket names like [wiki]. By default system pages are omitted from the listing
  • --depth N - defines the depth of sub pages to list. Default is 0 which means only pages matching the given pattern will be listed. -1 - means infinite depth of subpages.
  • :LANG - language for which to display a translation column. There is no default since expected translations are not otherwise registered in the wiki

    • may be repeated
  • Pattern of page names
<<pagelist ./* :de :fr :es>>

errormessage

Can be used in the header or footer section to insert error messages. It marks the place where ever a system error, like failed login etc. will be displayed. You will probably not use it within page content.

There are no arguments for this macro.

<<errormessage>>

gallery

Generates an image gallery from attached files

Arguments:

  • Pattern for image names

    • may contain path to a different page
    • may be repeated
<<gallery *-2023.jpg /event_2023/*>>

include

Includes another page, or a list of other pages. This is one of the most powerful macros, if you are creative. You can use it to list blog teasers or items in a shop page. In a multilingual setup the language version of the included page is automatically selected.

Arguments:

  • from=N - include text, starting with line number N
  • from=/PATTERN/ - include text starting with line matching PATTERN
  • to=N - end include with line number N
  • to=/PATTERN/ - include text until line matching PATTERN
  • items=N - include no more than N pages
  • --reverse - reverse order of inclusions, useful for putting newest pages first when sorting by date
  • --nolink - don't include a link to the page
  • --hl N - raise headline level by N levels, e.g. --hl 1 turns <h1> into <h2> headings, <h2> into <h3> and so on...
  • pattern for pages to include
<<include --reverse blogposts/* items=5 to="/%teaser end/">>

newpage

Displays an input field offering to create a new page. The item is only displayed, if the user has permission to create a new page at the given location. By default the page will be created as a subpage of the current one.

Arguments:

  • template=page - points to a text that will be used as a template, optional
  • label=Buttonlabel - Label for the submit button. Defaults to the english "New Page".
  • Pattern used as the page name. The default is ./%%s

If the pattern contains the string %%s, it will be replaced by the text entered in the name field. Otherwise the name field will not be offered at all. The pattern may also contain key sequences used by the unix date program, e.g. %d, %m, %Y for day, month and year respectively. The pattern does also determine the path at which a page will be created.

<newpage template=/templates/article /blog/%Y-%m-%d_%%s label="New Blog Article">

pagelist

List pages matching a pattern.

Arguments:

  • --system - includes "system" pages in listing, that is pages in bracket names like [wiki]. By default system pages are omitted from the listing
  • --depth N - defines the depth of sub pages to list. Default is 0 which means only pages matching the given pattern will be listed. -1 - means infinite depth of subpages.
  • Pattern of page names
<<pagelist ./*>>

revisions

Lists revisions of the given page, or of the current page, if no page is given. The list is identical to the one on the ''revisions''-tab in the edit menu. The macro can be used to embed the revision list within page content.

Arguments:

  • --list or --no-list - show list of revisions, default behaviour
  • --diff or --no-diff - show diff to previous revision, disabled by default. Combine with --no-list to display only the diff.
  • Page for which to display revisions, defaults to current
<<revisions ./>>

toc

Generates a Table of Contents like on this page.

Arguments:

  • Headline level min - default 1
  • Headline level max - default 6
<<toc 2 2>>

wikiform

This macro grants access to internal wiki functions like the login, or user registration form. Like the errormessage-macro it will usually be used in the header or footer page. Though if you want to put a login form on your front page, you can use this macro.

Arguments:

  • The dialog form you want to display, either one of

    • login - login form, or logout button if a user is logged in
    • register - registration form, if registration is allowed
    • invite - invite form, if a user is logged in
    • settings - password change dialog, if a user is logged in
<<wikiform login>>