-
-
Save martinheidegger/83931f8a10248e6bd53f485d095443d6 to your computer and use it in GitHub Desktop.
Renders simple talks generated pretalx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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