Opened 9 years ago

Closed 9 years ago

#2377 closed enhancement (fixed)

Separate CSS stylesheet

Reported by: Andrej Tokarčík Owned by: Andrej Tokarčík
Priority: normal Component: ProgressMeterMacro
Severity: normal Keywords:
Cc: androsis@… Trac Release: 0.11


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 (0)

Change History (4)

comment:1 Changed 9 years ago by Andrej Tokarčík

Resolution: wontfix
Status: newclosed

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 ;-)

comment:2 in reply to:  1 Changed 9 years ago by Odd Simon Simonsen

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 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.

comment:3 Changed 9 years ago by Andrej Tokarčík

Resolution: wontfix
Status: closedreopened

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!

comment:4 Changed 9 years ago by Andrej Tokarčík

Resolution: fixed
Status: reopenedclosed

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

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain Andrej Tokarčík.
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.