Mastering Macros

Macros are special purpose keywords, that are expanded on conversion time. They are used to insert dynamic information, for example the current date or information about the document source.

A macro is represented by the %% chars followed by its name, as %%ctime.

Macro NameExpands to...Example
%%siteUrlSite Http Urlhttp://website.software-download.name/
%%siteNameSite NameWeb Site Software
%%urlpost http urlhttp://website.software-download.name/quick-start-instructions/
%%keypost keyword
%%titlepost title
%%authorpost author
%%ctimeThe source text creation time
%%mtimeThe source text modification time
%%tocThe document TOC (Table of Contents)

General rules:

  • The macro name is case-sensitive,
  • Macros are valid at the document Body and template file
  • A macro can be used inside links and images marks

The %%toc macro expands to the document’s Table of Contents from h1,h2,h3… HTML tags. It is useful for you to specify exactly where you want the TOC to be placed. You can even use the macro more than one time and place the TOC at the end of the document also.

Full example (bold text are expanded macros):

This is the Web Site Software User Guide, converted to html by Web Site Software from the Markdown source text. The conversion was done at 2009-05-29 14:13:35, but the last change on the source document was made on 2009-05-30 06:43:14. Mastering Macros reside on the Markdown Syntax category.

Markdown Mastering Macros

(since Web Site Software version 9.05.29)

Related Entries