Modify

Opened 7 years ago

Closed 6 years ago

#1714 closed enhancement (fixed)

Use wiki page to provide global CSS rules

Reported by: jens.b@… Owned by: martin_s
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 6 years ago by martin_s

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 6 years ago by martin_s

  • Owner changed from anybody to martin_s
  • Status changed from new to assigned

comment:3 Changed 6 years ago by martin_s

  • Keywords wiki css added
  • Resolution set to fixed
  • Status changed from assigned to closed
  • Trac Release changed from 0.10 to 0.11

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

Add Comment

Modify Ticket

Action
as closed .
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from martin_s. Next status will be 'closed'.
The resolution will be deleted. Next status will be 'reopened'.
Author


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

 
Note: See TracTickets for help on using tickets.