Published
Edited
Nov 2, 2018
Importers
Insert cell
Insert cell
hackmd('https://hackmd.io/JBnqvBEaSIe3Y1xVV8AgdA')
Insert cell
Insert cell
hackmd = async (l) => {
const doc = await fetch(`${l}/download`).then(r=>r.text())
return html`${md([replaceEmojis(doc)])}${emojiStyle}`
}
Insert cell
Insert cell
Insert cell
Insert cell
replaceEmojis = (doc) => doc.split('\n').map(line=>{
const match = line.match(emojiRegex)
if(!match) return line;
for(let i = 0; i < match.length;i++) {
const m = match[i];
// if match is emoji
const cleanM = m.replace(/:/g, '')
if(emojis[cleanM]) {
const img = `<img class="hackmd-observable-emoji" src="https://cdnjs.cloudflare.com/ajax/libs/emojify.js/1.1.0/images/basic/${cleanM}.png"></img>`
line = line.replace(m, img)
}
}
return line;
}).join('\n')
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more