Platform
Resources
Pricing
Sign in
Get started
Simon Willison
Workspace
Fork
Public
By
Simon Willison
Edited
May 9, 2023
1 star
Insert cell
Insert cell
paste
=
html
`<div contenteditable style="overflow: auto; max-height: 10em; border: 2px dotted red; min-height: 100px">Paste stuff here</div>`
Insert cell
html
`<textarea style="width: 90%; height: 30em">${
markdown
}</textarea>`
Insert cell
Insert cell
Insert cell
markdown
=
{
const
t
=
new
turndown
.
default
(
)
;
return
t
.
turndown
(
innerHtml
)
;
}
Insert cell
html
`<pre>${
paste
.
innerHTML
}</pre>`
Insert cell
innerHtml
=
{
let
current
=
paste
.
innerHTML
;
if
(
!
current
)
{
current
=
""
;
}
yield
current
;
while
(
true
)
{
let
latest
=
paste
.
innerHTML
;
if
(
latest
!=
current
)
{
yield
latest
;
current
=
latest
;
}
await
Promises
.
delay
(
100
)
;
}
}
Insert cell
turndown
=
import
(
"turndown"
)
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
paste
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
markdown
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
innerHtml
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
turndown
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML