[[PageOutline(2-5,Contents,pullout)]] = Display option values for trac.ini = == Description == Allows a Trac wiki author to insert the value of a {{{trac.ini}}} configuration option into a page. The IniGetMacro package consists of two macros. The first, [http://github.com/dwclifton/tracinigetmacro/tree/master/0.11/iniget/macro.py IniGet], returns as plain text the value of a [http://trac-hacks.org/wiki/TracIni trac.ini] configuration option. The `trac.ini` file is a simple flat-file database of sections and option/value pairs: {{{ [section] name = value }}} By calling the macro like so: `[[IniGet(section.name)]]`, it returns the value. If no option matches, it returns an error message. Some option names themselves contain periods, this is supported. The second macro in the package is [http://github.com/dwclifton/tracinigetmacro/tree/master/0.11/welcome/macro.py Welcome], and it returns a level 1 heading element in the following format: {{{

Welcome to the project.name Project

}}} Where `project.name` is dynamically inserted in the same manner as !IniGet. The example above is the default behavior. However, Welcome also supports from zero to two arguments that allow the user to specify the prefix and/or suffix strings. Both standard and dictionary keyword methods are supported. If using the standard method, order is important, if using the keyword method it is not. You cannot mix both methods. These macros are useful for WikiStart project templates. == Installation == Download the zipped source from [/wiki/IniGetMacro/inigetmacro.zip?format=raw here], or clone the repository (see [#Source below]) from !GitHub to a location on your local drive. Visit the [http://github.com/dwclifton/tracinigetmacro/tree/master/0.11 0.11] directory and run: {{{ python setup.py bdist_egg cp dist/*.egg /trac/env/Project/plugins }}} == Configuration == Enable the macros in: /trac/env/Project/conf/trac.ini: {{{ [components] iniget.* = enabled welcome.* = enabled }}} You may need to restart your Web server. == Examples == {{{ [[Welcome]] [[Welcome()]] [[Welcome(This is the,Project)]] [[Welcome(prefix=This is the,suffix=Project)]] [[Welcome(suffix=Super Cool Project)]] [[Welcome(,Super Cool Project)]] The [[IniGet(project.name)]] project is designed to track and document software defects... }}} == Source == * Browse the source at: [http://github.com/dwclifton/tracinigetmacro/tree/master GitHub] * Public clone URL: {{{ git clone git://github.com/dwclifton/tracinigetmacro.git }}} == Bugs/Feature Requests == Existing bugs and feature requests for IniGetMacro are [report:9?COMPONENT=IniGetMacro here]. If you have any issues, create a [http://trac-hacks.org/newticket?component=IniGetMacro&owner=dwclifton new ticket]. == Recent Changes == [[ChangeLog(inigetmacro, 3)]] == Author/Contributors == * '''Author''': [wiki:dwclifton] * '''Maintainer''': [wiki:dwclifton] * '''Contributors''': The Python/Trac development community.