Modify

Opened 17 years ago

Closed 16 years ago

Last modified 20 months ago

#1714 closed enhancement (fixed)

Use wiki page to provide global CSS rules

Reported by: jens.b@… Owned by: Martin Scharrer
Priority: normal Component: Request-a-Hack
Severity: normal Keywords: wiki css
Cc: Trac Release: 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.

Attachments (0)

Change History (3)

comment:1 Changed 16 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 16 years ago by Martin Scharrer

Owner: changed from anybody to Martin Scharrer
Status: newassigned

comment:3 Changed 16 years ago by Martin Scharrer

Keywords: wiki css added
Resolution: fixed
Status: assignedclosed
Trac Release: 0.100.11

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

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Martin Scharrer.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.