clcms 0.6 documentation

About clcms Overview Content Tree Macros
Arguments Defining Macros Default Macros
PageNav:
Next:
Up: Macros
Prev: Defining Macros
To Project Page
Last updated:
2007-02-10

Default Macros

There are a number of builtin macros in clcms. These can be overridden by specifying your own macro with the same name.

  • menu (2 integer arguments) Will be replaced with the main menu, with the argument as is depth (depth as in how many subdirectories it will check for subitems). The menuitemX macros below are then used for each level of menu. The second argument specifies the 'start depth'. So if you use _2_1_ as arguments, only the second level is shown, with the current page or one of it's (grand)parent as indicator.
  • submenu Will be replaced with the submenu, the list of page items within one page.
  • nextpage Will be replaced by a link to the next page in the directory tree.
  • prevpage Will be replaced by a link to the previous page in the directory tree.
  • uppage Will be replaced by a link to the parent page in the directory tree.
  • title Will be replaced by the title of the current page.
  • stylesheet Will be replaced by the text 'default.css'.
  • date Will be replaced by the date (YYYY-mm-dd) when clcms is run.
  • datefile Will be replaced by the last modified date (YYYY-mm-dd) of the most recent one of the .page files.
  • itemseparator Will be placed between page items. By default it's a small horizontal line.
  • submenuitemseparator Will be placed between submenu items. By default it's a small horizontal line.
  • header Will be used in at the start of every page. Redefine this with you own header.inc
  • footer Will be used in at the end of every page. Redefine this with you own footer.inc
  • menustart Will be used at the start of the "menu" macro.
  • menuend Will be used at the end of the "menu" macro.
  • menuitemXstart Will be used at the start of a menu item in the top level.
    X is an integer specifying the page depth for the menu item (for instance, for the first level, you can override menuitem1start)
    This can be overridden in 2 ways: for a simple .inc, you can override it by defining the macro menuitem1start, which will be evaluated, and followed by the name of the page (in a link if appropriate). Or you can override menuitem1start-arg, which takes the name of the page as it's first (and only!) argument. See examples/site2 for an example of this.
  • menuitemXend Will be used at the end of a menu item in the top level.
    X is an integer specifying the page depth for the menu item
  • menuitemXselected Will be added to the <a> tag of the menu entry for the current page ant it's (grand)parents. You can override this with the value 'class="selected"' for instance.
    If you want deeper menus, you must define menuitemXstart/end for each extra level.
  • debug (1 string argument) Will print the given string to stdout while creating the page. Does nothing else.
  • dumpmacros Will print the list of all current macros and their sources to stdout.
  • fake Does nothing.

There are also a few built-in macros that cannot be overridden:

  • NO_WIKI Will cause the next lines .not. to be passed through the wiki engine
  • NO_WIKI_END Marks the end of the NO_WIKI part.