#35420 closed New feature (duplicate)
Add support for RSS stylesheets
Reported by: | Baptiste Mispelon | Owned by: | nobody |
---|---|---|---|
Component: | contrib.syndication | Version: | 5.0 |
Severity: | Normal | Keywords: | rss, stylesheet |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Inspired by a blog post I read recently [1] I wanted to see how feasible it would be to add an RSS stylesheet to the feeds that Django's syndication framework generates.
In XML, that means adding a "processing instruction" (<?xml-stylesheet href="/rss.xsl" type="text/xsl"?>
) right after the start of the document (<?xml version="1.0" encoding="utf-8"?>
) but before the root node. It turns out the syndication framework doesn't have the right hooks to make this easy.
I would like to suggest adding support for a new optional argument that would let users specify a path to a stylesheet URL. Or if that's considered too specific/niche of a feature, then at least add a hook to let users add the behavior without rewriting methods (for example by moving handler.startDocument()
out of RssFeed.write()
and into a new method).
Change History (3)
comment:1 by , 7 months ago
comment:2 by , 7 months ago
Resolution: | → duplicate |
---|---|
Status: | new → closed |
comment:3 by , 7 months ago
Hi,
Sorry my mistake. I had searched on trac for an existing ticket but not well enough apparently (I think i just did a keyword search on "rss" in the summary).
This ticket is an exact duplicate, and my PR is even really similar to the 14 year old patch that was already attached 😅
PR here: https://github.com/django/django/pull/18120