Opened 7 years ago

Last modified 2 years ago

#12978 new New feature

Support in syndication framework for CSS stylesheet links

Reported by: intrepidweb Owned by: Yuval Adam
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: yes
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 (4)

12968.diff (2.4 KB) - added by Yuval Adam 6 years ago.
12978.diff (5.3 KB) - added by Yuval Adam 6 years ago.
Updated proposed patch, with tests and docs
12978.2.diff (5.3 KB) - added by Tim Graham 3 years ago.
12978.3.diff (5.4 KB) - added by Tim Graham 2 years ago.

Download all attachments as: .zip

Change History (22)

comment:1 Changed 7 years ago by Russell Keith-Magee

Resolution: wontfix
Status: newclosed

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 7 years ago by intrepidweb

Resolution: wontfix
Status: closedreopened

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 7 years ago by Jacob

Triage Stage: UnreviewedSomeday/Maybe

comment:4 Changed 6 years ago by Yuval Adam

milestone: 1.3
Owner: changed from nobody to Yuval Adam
Status: reopenednew

Changed 6 years ago by Yuval Adam

Attachment: 12968.diff added

comment:5 Changed 6 years ago by Yuval Adam

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

Needs tests: set

Changed 6 years ago by Yuval Adam

Attachment: 12978.diff added

Updated proposed patch, with tests and docs

comment:7 Changed 6 years ago by Yuval Adam

Needs documentation: unset
Needs tests: unset
Triage Stage: Someday/MaybeUnreviewed

comment:8 Changed 6 years ago by Yuval Adam

Triage Stage: UnreviewedSomeday/Maybe

comment:9 Changed 6 years ago by Luke Plant

Type: New feature

comment:10 Changed 6 years ago by Luke Plant

Severity: Normal

comment:11 Changed 5 years ago by Yuval Adam

Easy pickings: unset
milestone: 1.31.4
Resolution: fixed
Status: newclosed
Triage Stage: Someday/MaybeReady for checkin
UI/UX: unset

comment:12 Changed 5 years ago by Aymeric Augustin

Resolution: fixed
Status: closedreopened
Triage Stage: Ready for checkinSomeday/Maybe

Revert apparent triage error.

comment:13 Changed 5 years ago by Jacob

milestone: 1.4

Milestone 1.4 deleted

comment:14 Changed 4 years ago by Aymeric Augustin

Triage Stage: Someday/MaybeAccepted

Accepting based on comment 2.

comment:15 Changed 4 years ago by Aymeric Augustin

Status: reopenednew

Changed 3 years ago by Tim Graham

Attachment: 12978.2.diff added

comment:16 Changed 3 years ago by Tim Graham

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?

comment:17 Changed 2 years ago by Collin Anderson

Is this still useful now that browsers have dropped the RSS button?

comment:18 Changed 2 years ago by Tim Graham

Patch needs improvement: set

I think it's still relevant. feedburner styles their feeds for example. I updated the patch to apply cleanly again, but we do need to add support for stylesheets in the ATOM feedgenerator (I started this, but didn't make the test updates). Also, I think we should avoid hardcoding text/css since stylesheets could also be xsl. Maybe extracting the stylesheet extension is enough or maybe the stylehseets attribute should be tuples of ('stylesheet', 'type'). Finally, the patch is also missing release notes.

Changed 2 years ago by Tim Graham

Attachment: 12978.3.diff added
Note: See TracTickets for help on using tickets.
Back to Top