Code

Opened 4 years ago

Last modified 9 months ago

#12978 new New feature

Support in syndication framework for CSS stylesheet links

Reported by: intrepidweb Owned by: yuval_a
Component: contrib.syndication Version: 1.1
Severity: Normal Keywords: syndication css stylesheets
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

It would be very helpful to be able to add CSS stylesheets to feeds produced by the syndication framework. As far as I know, this is not possible now without overriding the write method of the feed class.

Attachments (3)

12968.diff (2.4 KB) - added by yuval_a 4 years ago.
12978.diff (5.3 KB) - added by yuval_a 4 years ago.
Updated proposed patch, with tests and docs
12978.2.diff (5.3 KB) - added by timo 9 months ago.

Download all attachments as: .zip

Change History (19)

comment:1 Changed 4 years ago by russellm

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to wontfix
  • Status changed from new to closed

I'm not aware of any CSS technique that works reliably for RSS or Atom feeds. This is largely because RSS is intended to be machine readable, not human readable.

If I'm mistaken, I'm open to suggestions on what technique we should be supporting.

comment:2 Changed 4 years ago by intrepidweb

  • Resolution wontfix deleted
  • Status changed from closed to reopened

RSS feeds contain CSS and/or XSL stylesheets all the time. Here's a link on how to add an RSS stylesheet:

http://www.oreillynet.com/pub/a/network/2005/07/01/rss.html

I tried to include a list of major websites that use stylesheets in their RSS feeds, but the spam filter blocked it. However, if you check the feeds of CNN, CBS News, Reuters, Newsweek, Time and many more, you'll see XSL and/or CSS stylesheets linked in the source.

comment:3 Changed 4 years ago by jacob

  • Triage Stage changed from Unreviewed to Someday/Maybe

comment:4 Changed 4 years ago by yuval_a

  • milestone set to 1.3
  • Owner changed from nobody to yuval_a
  • Status changed from reopened to new

Changed 4 years ago by yuval_a

comment:5 Changed 4 years ago by yuval_a

  • Has patch set
  • Needs documentation set

Turns out easier than expected. saxutils supports adding XML processing instructions.

Added support for stylesheets, per the W3 spec, in the feedgenerator and in contrib.syndication.

comment:6 Changed 4 years ago by Alex

  • Needs tests set

Changed 4 years ago by yuval_a

Updated proposed patch, with tests and docs

comment:7 Changed 4 years ago by yuval_a

  • Needs documentation unset
  • Needs tests unset
  • Triage Stage changed from Someday/Maybe to Unreviewed

comment:8 Changed 4 years ago by yuval_a

  • Triage Stage changed from Unreviewed to Someday/Maybe

comment:9 Changed 3 years ago by lukeplant

  • Type set to New feature

comment:10 Changed 3 years ago by lukeplant

  • Severity set to Normal

comment:11 Changed 3 years ago by yuval_a

  • Easy pickings unset
  • milestone changed from 1.3 to 1.4
  • Resolution set to fixed
  • Status changed from new to closed
  • Triage Stage changed from Someday/Maybe to Ready for checkin
  • UI/UX unset

comment:12 Changed 3 years ago by aaugustin

  • Resolution fixed deleted
  • Status changed from closed to reopened
  • Triage Stage changed from Ready for checkin to Someday/Maybe

Revert apparent triage error.

comment:13 Changed 3 years ago by jacob

  • milestone 1.4 deleted

Milestone 1.4 deleted

comment:14 Changed 16 months ago by aaugustin

  • Triage Stage changed from Someday/Maybe to Accepted

Accepting based on comment 2.

comment:15 Changed 13 months ago by aaugustin

  • Status changed from reopened to new

Changed 9 months ago by timo

comment:16 Changed 9 months ago by timo

Updated the patch to apply cleanly, but noticed with the current implementation the stylesheets are only added to RSS feeds and not ATOM feeds. Does ATOM not support stylesheets?

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as new
The owner will be changed from yuval_a to anonymous. Next status will be 'assigned'
as The resolution will be set. Next status will be 'closed'
Author


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

 
Note: See TracTickets for help on using tickets.