Opened 8 months ago

Closed 8 months ago

Last modified 8 months ago

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

[1] https://hyteck.de/post/django-rss/

Change History (3)

comment:2 by Sarah Boyce, 8 months ago

Resolution: duplicate
Status: newclosed

Hi Baptiste, I am not very knowledgeable in RSS feeds, but this feels related to #12978 and certainly the "motivation" behind it feels very similar.
I'm going to mark this as a duplicate of #12978 but if you disagree, please let me know 👍

comment:3 by Baptiste Mispelon, 8 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 😅

Note: See TracTickets for help on using tickets.
Back to Top