Opened 12 years ago

Closed 11 years ago

# Use wiki page to provide global CSS rules

Reported by: Owned by: jens.b@… Martin Scharrer normal Request-a-Hack normal wiki css 0.11

### Description

I patched my trac install to supply a conversion from text/x-trac-wiki to text/css, so I can use a certain wiki page ("SiteStyle?") to give my wiki authors direct control over the site CSS (linked from the templates via <link rel="stylesheet" href="/proj/wiki/SiteStyle?format=css" type="text/css" />).

The Trac developers suggested this should be made an extension instead of a core feature (see http://trac.edgewall.org/ticket/5639), but I don't know how to hook a plugin into the respective code or where to start learning. It would be great if someone could pick this up! Perhaps even the aforementioned link element could be inserted by the plugin automatically.

### comment:1 Changed 11 years ago by Martin Scharrer

Have a look at my new AddHeadersPlugin which can be used (with trac 0.11 or later) to add the needed link tag. I tested this with Firefox 3 under Ubuntu Hardy today and Firebug (a firefox plug-in for web devlopers) tells me that there were no CSS rules found, probably because it is still sent out as text/plain not text/css. This can be fixed e.g. by writing a request provider plug-in.

Would the following be sufficient for you?:

• Trac 0.11 or later is used.
• Trac admin defines in the trac.ini configuration file one (or maybe more) special wiki pages which are used for CSS.
• The plugin provides a local page, e.g. /project/wikicss.css as text/css usable for browsers.
• The plugin also adds a header link tag so this CSS file is used when browsing trac.

### comment:2 Changed 11 years ago by Martin Scharrer

Owner: changed from anybody to Martin Scharrer new → assigned

### comment:3 Changed 11 years ago by Martin Scharrer

Keywords: wiki css added → fixed assigned → closed 0.10 → 0.11

I implemented this now as described in comment:1 as WikiCssPlugin.

### Modify Ticket

Change Properties