Skip to content

Commit

Permalink
Merge pull request #4 from anna-murphy/feat/markdown-descriptions
Browse files Browse the repository at this point in the history
Feat/markdown descriptions
  • Loading branch information
anna-murphy authored Apr 16, 2024
2 parents 450d288 + 10e0437 commit bc490c2
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 5 deletions.
3 changes: 2 additions & 1 deletion functions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
"dependencies": {
"express": "^4.18.3",
"firebase-admin": "^11.8.0",
"firebase-functions": "^4.3.1"
"firebase-functions": "^4.3.1",
"markdown-it": "^14.1.0"
},
"devDependencies": {
"@rollup/plugin-typescript": "^11.1.5",
Expand Down
7 changes: 5 additions & 2 deletions functions/src/utils/makeRss.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import { Timestamp } from "firebase-admin/firestore";
import MarkdownIt from "markdown-it";

import { PodcastChannel, PodcastEpisode } from "./types";

const Markdown = MarkdownIt();

export function makeRss(feed: PodcastChannel, episodes: PodcastEpisode[]) {
const rssString = `<?xml version="1.0" encoding="UTF-8"?>
<rss
Expand Down Expand Up @@ -58,13 +62,12 @@ function formatCategories(
})
.join("");
}

function makeItem(episodeData: PodcastEpisode) {
return `<item>
<title>${episodeData.title}</title>
<link><![CDATA[${episodeData.fileData.url}]]></link>
<guid isPermaLink="true"><![CDATA[${episodeData.fileData.url}]]></guid>
<description><![CDATA[${episodeData.description}]]></description>
<description><![CDATA[${Markdown.render(episodeData.description)}]]></description>
<pubDate>${new Timestamp(episodeData.publishDate.seconds, episodeData.publishDate.nanoseconds).toDate().toUTCString()}</pubDate>
<itunes:duration>${episodeData.fileData.duration}</itunes:duration>
<itunes:explicit>${episodeData.metadata.explicit}</itunes:explicit>
Expand Down
39 changes: 39 additions & 0 deletions functions/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -743,6 +743,11 @@ ent@^2.2.0:
resolved "https://registry.yarnpkg.com/ent/-/ent-2.2.0.tgz#e964219325a21d05f44466a2f686ed6ce5f5dd1d"
integrity sha512-GHrMyVZQWvTIdDtpiEXdHZnFQKzeO09apj8Cbl4pKWy4i0Oprcq17usfDt5aO63swf0JOeMWjWQE/LzgSRuWpA==

entities@^4.4.0:
version "4.5.0"
resolved "https://registry.yarnpkg.com/entities/-/entities-4.5.0.tgz#5d268ea5e7113ec74c4d033b79ea5a35a488fb48"
integrity sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==

entities@~2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/entities/-/entities-2.1.0.tgz#992d3129cf7df6870b96c57858c249a120f8b8b5"
Expand Down Expand Up @@ -1335,6 +1340,13 @@ linkify-it@^3.0.1:
dependencies:
uc.micro "^1.0.1"

linkify-it@^5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/linkify-it/-/linkify-it-5.0.0.tgz#9ef238bfa6dc70bd8e7f9572b52d369af569b421"
integrity sha512-5aHCbzQRADcdP+ATqnDuhhJ/MRIqDkZX5pyjFHRRysS8vZ5AbqGEoFIb6pYHPZ+L/OC2Lc+xT8uHVVR5CAK/wQ==
dependencies:
uc.micro "^2.0.0"

lodash.camelcase@^4.3.0:
version "4.3.0"
resolved "https://registry.yarnpkg.com/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz#b28aa6288a2b9fc651035c7711f65ab6190331a6"
Expand Down Expand Up @@ -1429,6 +1441,18 @@ markdown-it@^12.3.2:
mdurl "^1.0.1"
uc.micro "^1.0.5"

markdown-it@^14.1.0:
version "14.1.0"
resolved "https://registry.yarnpkg.com/markdown-it/-/markdown-it-14.1.0.tgz#3c3c5992883c633db4714ccb4d7b5935d98b7d45"
integrity sha512-a54IwgWPaeBCAAsv13YgmALOF1elABB08FxO9i+r4VFk5Vl4pKokRPeX8u5TCgSsPi6ec1otfLjdOpVcgbpshg==
dependencies:
argparse "^2.0.1"
entities "^4.4.0"
linkify-it "^5.0.0"
mdurl "^2.0.0"
punycode.js "^2.3.1"
uc.micro "^2.1.0"

marked@^4.0.10:
version "4.3.0"
resolved "https://registry.yarnpkg.com/marked/-/marked-4.3.0.tgz#796362821b019f734054582038b116481b456cf3"
Expand All @@ -1439,6 +1463,11 @@ mdurl@^1.0.1:
resolved "https://registry.yarnpkg.com/mdurl/-/mdurl-1.0.1.tgz#fe85b2ec75a59037f2adfec100fd6c601761152e"
integrity sha512-/sKlQJCBYVY9Ers9hqzKou4H6V5UWc/M59TH2dvkt+84itfnq7uFOMLpOiOS4ujvHP4etln18fmIxA5R5fll0g==

mdurl@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/mdurl/-/mdurl-2.0.0.tgz#80676ec0433025dd3e17ee983d0fe8de5a2237e0"
integrity sha512-Lf+9+2r+Tdp5wXDXC4PcIBjTDtq4UKjCPMQhKIuzpJNW0b96kVqSwW0bT7FhRSfmAiFYgP+SCRvdrDozfh0U5w==

[email protected]:
version "0.3.0"
resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748"
Expand Down Expand Up @@ -1670,6 +1699,11 @@ pseudomap@^1.0.1:
resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3"
integrity sha512-b/YwNhb8lk1Zz2+bXXpS/LK9OisiZZ1SNsSLxN1x2OXVEhW2Ckr/7mWE5vrC1ZTiJlD9g19jWszTmJsB+oEpFQ==

punycode.js@^2.3.1:
version "2.3.1"
resolved "https://registry.yarnpkg.com/punycode.js/-/punycode.js-2.3.1.tgz#6b53e56ad75588234e79f4affa90972c7dd8cdb7"
integrity sha512-uxFIHU0YlHYhDQtV4R9J6a52SLx28BCjT+4ieh7IGbgwVJWO+km431c4yRlREUAsAmt/uMjQUyQHNEPf0M39CA==

[email protected]:
version "6.11.0"
resolved "https://registry.yarnpkg.com/qs/-/qs-6.11.0.tgz#fd0d963446f7a65e1367e01abd85429453f0c37a"
Expand Down Expand Up @@ -1968,6 +2002,11 @@ uc.micro@^1.0.1, uc.micro@^1.0.5:
resolved "https://registry.yarnpkg.com/uc.micro/-/uc.micro-1.0.6.tgz#9c411a802a409a91fc6cf74081baba34b24499ac"
integrity sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA==

uc.micro@^2.0.0, uc.micro@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/uc.micro/-/uc.micro-2.1.0.tgz#f8d3f7d0ec4c3dea35a7e3c8efa4cb8b45c9e7ee"
integrity sha512-ARDJmphmdvUk6Glw7y9DQ2bFkKBHwQHLi2lsaH6PPmz/Ka9sFOBsBluozhDltWmnv9u/cF6Rt87znRTPV+yp/A==

uglify-js@^3.7.7:
version "3.17.4"
resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.17.4.tgz#61678cf5fa3f5b7eb789bb345df29afb8257c22c"
Expand Down
6 changes: 4 additions & 2 deletions src/admin-portal/views/Upload.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,9 @@ export function Upload(): JSX.Element {
<TextInput label="Episode Title" value={title} setValue={setTitle} />
<SeasonSelect
value={seasonNumber}
setValue={(season) => {setSeasonNumber(Number(season.toString()))}}
setValue={(season) => {
setSeasonNumber(Number(season.toString()));
}}
/>
<NumberInput
label="Episode"
Expand All @@ -204,7 +206,7 @@ export function Upload(): JSX.Element {
label="Episode Type"
values={["full", "trailer", "bonus"]}
value={episodeType}
setValue={(value: string|number) => {
setValue={(value: string | number) => {
setEpisodeType(value as EpisodeType);
}}
/>
Expand Down

0 comments on commit bc490c2

Please sign in to comment.