Ticket #2377 (closed enhancement: fixed)

Opened 11 months ago

Last modified 9 months ago

Separate CSS stylesheet

Reported by: qwp0 Assigned to: qwp0
Priority: normal Component: ProgressMeterMacro
Severity: normal Keywords:
Cc: androsis@gmail.com Trac Release: 0.11

Description

Actually, ProgressMeterMacro puts the required CSS styles into a wiki page every time the macro is called. Solve this by importing separate stylesheet for CSS styles used by macro.

Attachments

Change History

(follow-up: ↓ 2 ) 02/29/08 03:00:11 changed by qwp0

  • status changed from new to closed.
  • resolution set to wontfix.

This enhancement can't be done, AFAIK, because importing of separate CSS styles is possible just for plugins which define new URL handlers. And because this is _macro_ plugin, it is used within wiki pages -- but they (the wiki pages) have predefined handler (the wiki handler handle all '/wiki/*' requests) so we don't define new handler and because of that we can't import the separate CSS stylesheets.

If you know any other way how to solve this, let me know ;-)

(in reply to: ↑ 1 ) 02/29/08 05:02:18 changed by osimons

Replying to qwp0:

If you know any other way how to solve this, let me know ;-)

I know nothing about this plugin, just wanting to mention that adding a stylesheet from a macro is doable and supported - Trac does this itself for many purposes. Like if you add a {{{#!diff}}} processor (=macro), it will also add the stylesheet needed to support inline viewing of patches regardless of what handler it is in.

from trac.web.chrome import add_stylesheet 
add_stylesheet(formatter.req, 'myplugin/css/mysheet.css')

You also need to extend the ITemplateProvider interface to make a named htdocs location available so your sheet can be located (if not done already).

As an example, I also add a stylesheet in a macro that is part of the fullblogplugin.

02/29/08 12:46:24 changed by qwp0

  • status changed from closed to reopened.
  • resolution deleted.

Thanks for information and pointing at your plugin -- I have looked for a macro which includes separate stylesheets! I will look at this problem again, trying to get it done using your solution. Thanks!

02/29/08 15:07:25 changed by qwp0

  • status changed from reopened to closed.
  • resolution set to fixed.

(In [3298]) ProgressMeterMacro: Using separate CSS, fixes #2377 (v0.1)


Add/Change #2377 (Separate CSS stylesheet)




Change Properties
Action