Add feed discovery plugin

This commit is contained in:
Anthony Ettinger 2026-06-09 09:34:31 +00:00
parent e47616bf9d
commit 5cfeea6b57
37 changed files with 2432 additions and 5 deletions

View file

@ -0,0 +1,23 @@
import type { FeedDiscoveryResponse, FeedOutputFormat } from "../types.js";
import { renderAtom } from "./atom.js";
import { renderJsonFeed } from "./json-feed.js";
import { renderOpml } from "./opml.js";
import { renderRss } from "./rss.js";
export function renderDiscoveryOutput(response: FeedDiscoveryResponse, format: FeedOutputFormat) {
if (format === "opml") {
return renderOpml(response);
}
if (format === "rss") {
return renderRss(response);
}
if (format === "atom") {
return renderAtom(response);
}
if (format === "json-feed") {
return renderJsonFeed(response);
}
return JSON.stringify(response, null, 2);
}
export { renderAtom, renderJsonFeed, renderOpml, renderRss };