| 11 | == Installation |
| 12 | |
| 13 | Prerequisites: |
| 14 | * Python 2.3-2.6 |
| 15 | * pypi:pycerberus |
| 16 | * Trac 0.11+ |
| 17 | |
| 18 | Enable the macro in your `trac.ini`: |
| 19 | |
| 20 | {{{#!ini |
| 21 | [components] |
| 22 | ohloh_widgets.macro = enabled |
| 23 | # if you want to have better display of certain macros, enable also widget modificators: |
| 24 | ohloh_widgets.* = enabled |
| 25 | }}} |
| 26 | |
| 27 | == Configuration |
| 28 | |
| 29 | Some Ohloh widgets do not look nice on a Trac page, because some elements do not respect Trac's layout, eg they use different colors for links. This macro already includes some modifiers which can change the appearance of some Ohloh macros with Javascript (jQuery) and CSS, but you can easily add your own by writing a small plugin which implements this interface: |
| 30 | |
| 31 | {{{#!python |
| 32 | # This class is in ohloh_widgets.api |
| 33 | class IOhlohWidgetModifier(Interface): |
| 34 | def widget_name(self): |
| 35 | """Return the name of the widget which this modifier can modify. |
| 36 | |
| 37 | The widget name is the name of the JS file (e.g. 'project_factoids.js') |
| 38 | without the '.js' suffix (=> 'project_factoids'). |
| 39 | """ |
| 40 | |
| 41 | def widget_fix(self): |
| 42 | """Return a Genshi tag which is inserted directly after the widget's script |
| 43 | tag. Use this to add custom CSS/Javascript which whips the widget into shape |
| 44 | (again).""" |
| 45 | }}} |
| 46 | |