Published
Edited
Sep 11, 2021
1 fork
1 star
Insert cell
Insert cell
Insert cell
Insert cell
doc = await wtf.fetch(page, lang)
Insert cell
text = doc.text()
Insert cell
Insert cell
{
let txt=''
doc.sections().forEach(s =>{
//add a section header
txt+=`\n${'#'.repeat(s.depth)} ${s.title()}\n`
//only put the first sentence
let sentence=s.sentences()[0]
if(sentence){
txt+= ' ' + sentence.text() + '\n'
}
})
return txt.trim()
}
Insert cell
Insert cell
Insert cell
Insert cell
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