[[PageOutline(2-5,Contents,pullout)]] = Simple but useful Trac macros = == Description == Expand Trac capabilities by embedding simple snippets in wiki pages using simple macros. ==== !ConfigOptionMacro ==== Insert configuration options in Wiki pages Usage is as follows. `[[ConfigOption(section, name, type=option_type, sep=char)]]` - ''section'' : the section in trac.ini (mandatory) - ''name'' : option name (mandatory) - ''type'' : if this keyword argument is present then the value will be rendered using an appropriate format according to the option type. Supported values are `text` (default), `bool`, `int`, `list`, `path`, `extension`. - ''sep'' : list separator (otional, ignored if `type`! = `list`) ==== !WikiHistoryMacro ==== Embed information about wiki changelog in wiki pages. If invoked without keyword arguments then full changelog is shown inside a table with columns `Date`, `Version`, `Description, `Author`. Please read below for further details. Usage is as follows (all fields are optional). `[[WikiHistory(pagename, version, attr=attr_name, cols=columns)]]` - ''pagename'' : the name of target Wiki page. If missing or empty and a wiki page is being rendered then it defaults to the current wiki page. If the page being rendered doesn't belong in the Wiki then `WikiStart` is used instead. - ''version'' : consider changes prior to (and including) this version - ''attr'' : if this keyword argument is present then only the value of the version attribute identified by `attr_name` is rendered in textual form (and `cols` argument is ignored) Supported values are `time`, `version`, `comment`, and `author` - ''cols'' : colon separated list of identifiers used to select specific columns (order matters). Identifiers are the same supported for `attr` parameter. == Bugs/Feature Requests == Existing bugs and feature requests for TracBasicMacro are [report:9?COMPONENT=TracBasicMacro here]. If you have any issues, create a [http://trac-hacks.org/newticket?component=TracBasicMacro&owner=olemis new ticket]. == Download == Download the zipped source from [download:tracbasicmacro here]. == Source == You can check out TracBasicMacro from [http://trac-hacks.org/svn/tracbasicmacro here] using Subversion, or [source:tracbasicmacro browse the source] with Trac. == Example == - `[[ConfigOption(project, name)]]` displays project name. - `[[WikiHistory]]` lists versions of current wiki page (or `WikiStart` if wiki text inserted elsewhere e.g. in a ticket's comment) - `[[WikiHistory(,4)]]` lists versions of current wiki page (or `WikiStart` if wiki text inserted elsewhere e.g. in a ticket's comment) up to version 4 - `[[WikiHistory(TracGuide,cols=time:version:author)]]` lists versions of `TracGuide` wiki page but hides user comments. - `[[WikiHistory(,cols=time:comment)]]` lists versions of current wiki page (or `WikiStart` if wiki text inserted elsewhere e.g. in a ticket's comment). Only shows modification time and user comment. - `[[WikiHistory(TracGuide,19,cols=time:comment)]]` lists versions of `TracGuide` wiki page up to version 19. Only shows modification time and user comment. - `[[WikiHistory(,attr=time)]]` displays last modification time of current wiki page (or `WikiStart` if wiki text inserted elsewhere e.g. in a ticket's comment) - `[[WikiHistory(TracPermissions,2,attr=time)]]` displays modification time of version 2 of `TracPermissions` wiki page. == Recent Changes == [[ChangeLog(tracbasicmacro, 3)]] == Author/Contributors == '''Author:''' [wiki:olemis Olemis Lang] [[BR]] '''Maintainer:''' [wiki:olemis Olemis Lang] [[BR]] '''Contributors:'''