On Wed, Jul 14, 2010 at 9:36 AM, Olemis Lang <[email protected]> wrote:
> On Wed, Jul 14, 2010 at 8:54 AM, Olemis Lang <[email protected]> wrote:
>> Hi all !
>>
>> I'd like to know if there's a way (plugins ?) to embed the version
>> number of a wiki page as well as previous history (i.e. a list of
>> date, version number, description | comment, author) . Do you know of
>> any such macro ?
>>
>
> ... and other things like project name , etc ...
>
Since I heard no suggestions I implemented this by myself . Macros
look like this
{{{
#!python
class ConfigOptionMacro(WikiMacroBase):
r"""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`)
"""
class WikiHistoryMacro(WikiMacroBase):
r"""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.
"""
}}}
If there's people interested I can publish & share what's been done ;o)
Feedback is welcome !
--
Regards,
Olemis.
Blog ES: http://simelo-es.blogspot.com/
Blog EN: http://simelo-en.blogspot.com/
Featured article:
--
You received this message because you are subscribed to the Google Groups "Trac
Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/trac-users?hl=en.