Changes between Version 8 and Version 9 of IniGetMacro
- Timestamp:
- Dec 20, 2008, 10:34:44 AM (15 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
IniGetMacro
v8 v9 3 3 == Description == 4 4 5 The IniGetMacro package consists of two macros. The first, '''!IniGet''', returns as plain 6 text the value of a [http://trac-hacks.org/wiki/TracIni trac.ini] configuration option. The 7 `trac.ini` file is a simple flat-file database of sections and option/value pairs: 5 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 6 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: 8 7 9 8 {{{ … … 12 11 }}} 13 12 14 By calling the macro like so: `[[IniGet(section.name)]]`, it returns the value. 15 If no option matches, it returns an error message. Some option names themselves 13 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 16 14 contain periods, this is supported. 17 15 18 The second macro in the package is '''Welcome''', and it returns a level 1 heading16 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 19 17 element in the following format: 20 18 … … 23 21 }}} 24 22 25 Where `project.name` is dynamically inserted in the same manner as !IniGet. 23 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. 26 24 27 25 These macros are useful for WikiStart project templates. 28 26 29 == Bugs/Feature Requests ==27 == Installation == 30 28 31 Existing bugs and feature requests for IniGetMacro are 32 [report:9?COMPONENT=IniGetMacro here]. 29 Download the zipped source from [http://trac-hacks.org/attachment/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: 30 31 {{{ 32 python setup.py bdist_egg 33 cp dist/*.egg /trac/env/Project/plugins 34 }}} 33 35 34 If you have any issues, create a 35 [http://trac-hacks.org/newticket?component=IniGetMacro&owner=dwclifton new ticket]. 36 == Configuration == 37 38 Enable the macros in: 39 40 /trac/env/Project/conf/trac.ini: 41 42 {{{ 43 [components] 44 iniget.* = enabled 45 welcome.* = enabled 46 }}} 47 48 Then restart your Web server. 36 49 37 == Download == 38 39 Download the zipped source from [http://trac-hacks.org/attachment/wiki/IniGetMacro/inigetmacro.zip?format=raw here]. 50 == Examples == 51 52 {{{ 53 [[Welcome]] 54 [[Welcome()]] 55 [[Welcome(This is the,Project)]] 56 [[Welcome(prefix=This is the,suffix=Project)]] 57 [[Welcome(suffix=Super Cool Project)]] 58 [[Welcome(,Super Cool Project)]] 59 60 The [[IniGet(project.name)]] project is designed to track and document software defects... 61 }}} 40 62 41 63 == Source == 42 64 43 Browse the source at: [http://github.com/dwclifton/tracinigetmacro/tree/master GitHub][[BR]]44 Public clone URL:65 * Browse the source at: [http://github.com/dwclifton/tracinigetmacro/tree/master GitHub] 66 * Public clone URL: 45 67 {{{ 46 68 git clone git://github.com/dwclifton/tracinigetmacro.git 47 69 }}} 48 70 49 == Example ==71 == Bugs/Feature Requests == 50 72 51 {{{ 52 [[Welcome]] 73 Existing bugs and feature requests for IniGetMacro are [report:9?COMPONENT=IniGetMacro here]. 53 74 54 The [[IniGet(project.name)]] project consists of a... 55 }}} 75 If you have any issues, create a [http://trac-hacks.org/newticket?component=IniGetMacro&owner=dwclifton new ticket]. 56 76 57 77 == Recent Changes == … … 61 81 == Author/Contributors == 62 82 63 '''Author:''' [wiki:dwclifton][[BR]]64 '''Contributors:''' 83 * '''Author''': [wiki:dwclifton] 84 * '''Contributors''': The Python/Trac development community.