Platform
Resources
Pricing
Sign in
Get started
spencer kelly
freelance javascripter
Workspace
Fork
Published
wtf_wikipedia
By
spencer kelly
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
2
{
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.
Try it for free
Learn more
Fork
View
Export
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
page
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
lang
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
doc
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
text
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Show 2 comments
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
wtf
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
style
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML