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