Skip to content

Instantly share code, notes, and snippets.

@martinheidegger
Created August 3, 2020 13:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save martinheidegger/83931f8a10248e6bd53f485d095443d6 to your computer and use it in GitHub Desktop.
Save martinheidegger/83931f8a10248e6bd53f485d095443d6 to your computer and use it in GitHub Desktop.
Renders simple talks generated pretalx
<html>
<body>
<style type="text/css">
html {
padding: 1em;
font-family: sans-serif;
}
dt {
font-weight: bold;
margin-top: 1.2em;
margin-bottom: 0.5em;
}
dd {
margin-inline-start: 0em;
}
</style>
<script type="text/javascript">
(async () => {
const talks = await (await fetch('./talks_simple.json')).json()
for (const talk of talks) {
const node = document.createElement('div')
node.innerHTML = `
<div>
<dl>
${Object.entries(talk).map(([key, value]) => `
<dt class="${key}">${key}</dt>
<dd class="${key}-value">${value}</dd>
`).join('')}
</dl>
`
document.body.append(node)
document.body.append(document.createElement('hr'))
}
for (const node of document.querySelectorAll('.timeMS-value')) {
const time = parseInt(node.innerHTML)
node.innerHTML = new Date(time).toString()
}
})()
.catch(err => console.error(err))
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment