Opened 15 years ago
Closed 5 months ago
#12978 closed New feature (fixed)
Support in syndication framework for CSS stylesheet links
Reported by: | intrepidweb | Owned by: | Baptiste Mispelon |
---|---|---|---|
Component: | contrib.syndication | Version: | 1.1 |
Severity: | Normal | Keywords: | syndication css stylesheets |
Cc: | Triage Stage: | Ready for checkin | |
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 (4)
Change History (28)
comment:1 by , 15 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
comment:2 by , 15 years ago
Resolution: | wontfix |
---|---|
Status: | closed → 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 by , 15 years ago
Triage Stage: | Unreviewed → Someday/Maybe |
---|
comment:4 by , 14 years ago
milestone: | → 1.3 |
---|---|
Owner: | changed from | to
Status: | reopened → new |
by , 14 years ago
Attachment: | 12968.diff added |
---|
comment:5 by , 14 years ago
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 by , 14 years ago
Needs tests: | set |
---|
comment:7 by , 14 years ago
Needs documentation: | unset |
---|---|
Needs tests: | unset |
Triage Stage: | Someday/Maybe → Unreviewed |
comment:8 by , 14 years ago
Triage Stage: | Unreviewed → Someday/Maybe |
---|
comment:9 by , 14 years ago
Type: | → New feature |
---|
comment:10 by , 14 years ago
Severity: | → Normal |
---|
by , 11 years ago
Attachment: | 12978.2.diff added |
---|
comment:16 by , 11 years ago
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:18 by , 10 years ago
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.
by , 10 years ago
Attachment: | 12978.3.diff added |
---|
comment:19 by , 6 months ago
#35420 possible duplicate, with patch: https://github.com/django/django/pull/18120
comment:20 by , 6 months ago
Owner: | changed from | to
---|---|
Patch needs improvement: | unset |
Status: | new → assigned |
comment:21 by , 6 months ago
Patch needs improvement: | set |
---|
Patch is missing support for CSS stylesheets 👍
comment:22 by , 6 months ago
Easy pickings: | unset |
---|---|
Patch needs improvement: | unset |
UI/UX: | unset |
I've added support for CSS stylesheets as well and updated the PR.
comment:23 by , 6 months ago
Patch needs improvement: | set |
---|
Tested using the test project provided by Baptiste and is working well: https://github.com/bmispelon/django-ticket-35420
Have minor comments on the PR but the main change is requesting support can adding multiple stylesheets (then some doc updates around that).
I think this is close 👍
comment:24 by , 6 months ago
Patch needs improvement: | unset |
---|
I've pushed an update with support for both single and multiple stylesheets. I think this is shaping up nicely, I'm enjoying the review process!
comment:25 by , 5 months ago
Patch needs improvement: | set |
---|
comment:26 by , 5 months ago
Patch needs improvement: | unset |
---|
Rebased the PR and targeted 5.2 instead.
comment:27 by , 5 months ago
Triage Stage: | Accepted → Ready for checkin |
---|
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.