]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blob - doc/todo/fancypodcast/discussion.mdwn
Move design and code review to discussion subpage.
[git.ikiwiki.info.git] / doc / todo / fancypodcast / discussion.mdwn
1 # Round 1
3 ## Design
5 7. For each fancy podcast episode, write a blog post containing
6    `\[[!meta enclosure="WikiLink/to/media.mp3"]]`. (Don't specify
7    more than one enclosure -- but if you do, last one wins.)
8 7. When rendering to HTML (single-page or inlined), append a link
9    to the media file.
10 7. When rendering to RSS/Atom, the text is the entry's content and
11    the media file is its enclosure.
12 7. Don't break simple podcasts in pursuit of fancy podcasts.
14 ## Implementation
16 ### Completed
18 * Cover the existing simple podcast behavior with tests.
19 * Add an `enclosure` field to [[plugins/meta]] that expands the
20   given [[ikiwiki/WikiLink]] to an absolute URL (feed enclosures
21   pretty much need to be, and the reference feeds I've looked at
22   all do this).
23 * Write failing tests for the desired single-page and inlined
24   HTML behavior, then make them pass by adding enclosure stanzas
25   to `{,inline}page.tmpl`.
26 * Write failing tests for the desired RSS/Atom behavior, then make
27   them pass via changes to `{atom,rss}item.tmpl` and [[plugins/inline]].
28 * Match feature-for-feature with
29   [tru_podcast](http://www.rainskit.com/blog/542/tru_podcast-a-podcasting-plugin-for-textpattern)
30   (what [[schmonz]] will be migrating from).
31 * Enrich [feed metadata](http://cyber.law.harvard.edu/rss/rss.html)
32   by catching up `rsspage.tmpl` to `atompage.tmpl`.
33 * Verify that [[plugins/more]] plays well with fancy podcasts.
34 * Verify that the feeds validate.
35 * Subscribe to a fancy feed in some common podcatchers and verify
36   display details against a reference podcast.
37 * Verify smooth transitions for two common use cases (see testing
38   details below).
39 * Code review: don't add enclosure divs unless we have enclosures.
40 * Code review: genericize download link for more use cases.
41 * Code review: don't confuse old readers with Atom names in RSS.
42 * Code review: instead of hacking back to `$link`, just provide it.
43 * Code review: show author in addition to feedname, if different.
45 ### Code review
47         +                               # XXX better way to compute relative to srcdir?
48         +                               my $file = $absurl;
49         +                               $file =~ s|^$config{url}/||;
51 I don't think ikiwiki offers a better way to do that, because there is
52 normally no reason to do that. Why does it need an url of this form here?
53 --[[Joey]] 
55 > In all the popular, production-quality podcast feeds I've looked
56 > at, enclosure URLs are always absolute (even when they could be
57 > expressed concisely as relative). [Apple's
58 > example](http://www.apple.com/itunes/podcasts/specs.html#example)
59 > does too. So I told \[[!meta]] to call `urlto()` with the third
60 > parameter true, which means the \[[!inline]] code here gets an
61 > absolute URL in `$pagestate{$p}{meta}{enclosure}`. To compute the
62 > enclosure's metadata, though, we of course need it as a local path.
63 > I didn't see a less
64 > [ongepotchket](http://www.jewish-languages.org/jewish-english-lexicon/words/1402)
65 > way at the time. If you have a better idea, I'm happy to hear it;
66 > if not, I'll add an explanatory comment. --[[schmonz]]
68 >> I would be more comfortable with this if two two different forms of url
69 >> you need were both generated by calling urlto. It'd be fine to call
70 >> it more than once. --[[Joey]]
72 >>> Heh, it was even easier than that! (Hooray for tests.) Done.
73 >>> --[[schmonz]]
75         +<TMPL_IF HTML5><section id="inlineenclosure"><TMPL_ELSE><div id="inlineenclosure"></TMPL_IF>
76         +<TMPL_IF ENCLOSURE>
78 Can't we avoid adding this div when there's no enclosure? --[[Joey]]
80 > Sure, I've moved the `<TMPL_IF ENCLOSURE>` check to outside the
81 > section-and-div block for `{,inline}page.tmpl`. --[[schmonz]]
83         +<a href="<TMPL_VAR ENCLOSURE>">Download this episode</a>
85 "Download this episode" is pretty specific to particular use cases.
86 Can this be made more generic, perhaps just "Download"? --[[Joey]] 
88 > Yep, I got a little carried away. Done. --[[schmonz]]
90         -<TMPL_IF AUTHOR>
91         -       <title><TMPL_VAR AUTHOR ESCAPE=HTML>: <TMPL_VAR TITLE></title>
92         -       <dcterms:creator><TMPL_VAR AUTHOR ESCAPE=HTML></dcterms:creator>
94 This change removes the author name from the title of the rss feed, which
95 does not seem necessary for fancy podcasts. And it is a change that
96 could negatively impact eg, Planet style aggregators using ikiwiki. --[[Joey]]
98 > While comparing how feeds render in podcatchers, I noticed that
99 > RSS and Atom were inconsistent in a couple ways, of which this was
100 > one. The way I noticed it: with RSS, valuable title space was being
101 > spent to display the author. I figured Atom's display was the one
102 > worth matching. You're right, of course, that planets using the
103 > default template and somehow relying on the current author-in-the-title
104 > rendering for RSS feeds (but not Atom feeds!) would be broken by
105 > this change. I'm having trouble imagining exactly what would break,
106 > though, since guids and timestamps are unaffected. Would it suffice
107 > to provide a note in the changelog warning people to be careful
108 > upgrading their planets, and to customize `rssitem.tmpl` if they
109 > really prefer the old behavior (or don't want to take any chances)?
110 > --[[schmonz]]
112 >> A specific example I know of is updo.debian.net, when used with
113 >> rss2email. Without the author name there, one cannot see who posted
114 >> an item. It's worth noting that planet.debian.org does the same thing
115 >> with its rss feed. (That's probably what I copied.) Atom feeds may
116 >> not have this problem, don't know. --[[Joey]]
118 >>> Okay, that's easy to reproduce. It looks like this _might_ be
119 >>> a simple matter of getting \[[!aggregate]] to populate author in
120 >>> `add_page()`. I'll see what I can figure out. --[[schmonz]]
122 >>>> Yep, that was mostly it. If the feed entry defines an author,
123 >>>> and the author is distinct from the feed name, we now show `NAME:
124 >>>> AUTHOR`, else just show `NAME` (same as always). In addition,
125 >>>> the W3 feed validator says `<dcterms:creator>` is invalid, so
126 >>>> I replaced it with `<dc:creator>`, and all of a sudden `r2e`
127 >>>> gives me better `From:` headers. With the latest on my branch,
128 >>>> when I generate the same planet as updo and run `r2e` over it,
129 >>>> the names I get in `From:` look like so:
131 *  `"updo: Junio C Hamano"`
132 *  `"updo: Greg Kroah-Hartman"`
133 *  `"updo: Eric Raymond: esr"` (article author != feed name, so we get both)
134 *  `"updo: Jannis Pohlman: Jannis Pohlmann"` (oops! I tweaked the real updo)
136 >>>> --[[schmonz]]
138         +++ b/templates/rsspage.tmpl
139         +       xmlns:atom="http://www.w3.org/2005/Atom"
140         +<atom:link href="<TMPL_VAR FEEDURL>" rel="self" type="application/rss+xml" />
142 Why is it using atom namespace inside an rss feed? What are the chances
143 every crummy rss reader on earth is going to understand this? I'd put it at
144 about 0%; I doubt ikiwiki's own rss reader understands such a mashup.
145 --[[Joey]]
147 > The validator I used (<http://validator.w3.org/feed/>) told me to.
148 > Pretty sure it doesn't make anything work better in the podcatchers
149 > I tried. Hadn't considered that it might break some readers.
150 > Removed. --[[schmonz]]
152         +<generator>ikiwiki</generator>
154 Does this added tag provide any benefits? --[[Joey]]
156 > Consistency with the Atom feed, and of course it trumpets ikiwiki
157 > to software and/or curious humans who inspect their feeds. The tag
158 > arrived only in RSS 2.0, but that's already the version we're
159 > claiming to be, and it's over a decade old. Seems much less risky
160 > than the atom namespace bits. --[[schmonz]]
162 >> Sounds ok then. --[[Joey]]