|
|
|
@ -50,6 +50,7 @@ const parseXML = (XML) => { |
|
|
|
|
let short = useShowdown( |
|
|
|
|
xmlJs.js2xml(js.elements[0].elements[i].elements[0]) |
|
|
|
|
); |
|
|
|
|
// remove trailing newlines from short
|
|
|
|
|
short = short.replace(/\n+$/, ""); |
|
|
|
|
const dateStr = js.elements[0].elements[i].attributes.date; |
|
|
|
|
const timeStr = js.elements[0].elements[i].attributes.time; |
|
|
|
@ -59,7 +60,6 @@ const parseXML = (XML) => { |
|
|
|
|
const abstract = useShowdown( |
|
|
|
|
xmlJs.js2xml(js.elements[0].elements[i].elements[1]) |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
let registerLink = ""; |
|
|
|
|
// detects a link in markdown
|
|
|
|
|
const markdownLinkDetectRegex = /(?<=\[(.*)\]\(<)(.*)(?=>\))/; |
|
|
|
@ -69,12 +69,10 @@ const parseXML = (XML) => { |
|
|
|
|
registerLink = "no link"; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
console.log(registerLink); |
|
|
|
|
|
|
|
|
|
const mdx = `export const metadata = {\n name: "${title}",\n short: "${short}",\n date: "${date}",\n online: ${online},\n location: "${location}",\n registerLink: "${registerLink}"\n}\n\n${abstract}`; |
|
|
|
|
const mdxTitle = title.replace(/(\s+|:+)/g, "-"); |
|
|
|
|
|
|
|
|
|
fs.writeFile(`${mdxTitle}.mdx`, mdx, function (err) { |
|
|
|
|
fs.writeFile(`./markdown-events/${mdxTitle}.mdx`, mdx, function (err) { |
|
|
|
|
if (err) return console.log(err); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|