#35420: Add support for RSS stylesheets
-------------------------------------+-------------------------------------
Reporter: Baptiste | Owner: nobody
Mispelon |
Type: New | Status: new
feature |
Component: | Version: 5.0
contrib.syndication |
Severity: Normal | Keywords: rss, stylesheet
Triage Stage: | Has patch: 1
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
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/
--
Ticket URL: <
https://code.djangoproject.com/ticket/35420>
Django <
https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.