Skip to content

Instantly share code, notes, and snippets.

@agoose77
Last active December 18, 2025 13:54
Show Gist options
  • Select an option

  • Save agoose77/677ab3ff098e4511626371fcd7e756dc to your computer and use it in GitHub Desktop.

Select an option

Save agoose77/677ab3ff098e4511626371fcd7e756dc to your computer and use it in GitHub Desktop.
kernelspec
name display_name
python3
Python 3

Markup Generation

:name: demo
:caption: foo

from IPython.display import Image

display(
    Image(url="https://picsum.photos/id/947/800/256/")
)
{
type: 'root',
children: [
{
type: 'block',
kind: 'notebook-code',
children: [
{
type: 'code',
lang: 'python3',
executable: true,
value: 'from IPython.display import Image\n' +
'\n' +
'display(\n' +
' Image(url="https://picsum.photos/id/947/800/256/")\n' +
')'
},
{
type: 'outputs',
id: 'nH_WaJRVzBnQeMRHJgcyP',
children: [
{
type: 'output',
children: [
{
type: 'image',
url: 'https://picsum.photos/id/947/800/256/'
}
],
jupyter_data: {
output_type: 'display_data',
execution_count: undefined,
metadata: {},
data: {
'text/html': {
content: '<img src="https://picsum.photos/id/947/800/256/"/>',
content_type: 'text/html'
},
'text/plain': {
content: '<IPython.core.display.Image object>',
content_type: 'text/plain'
}
}
},
identifier: undefined
}
]
}
],
data: {
caption: [
{
type: 'paragraph',
children: [
{
type: 'text',
value: 'foo',
position: {
start: { line: 11, column: 1 },
end: { line: 11, column: 1 }
}
}
]
}
]
},
label: 'demo',
identifier: 'demo'
}
]
}
{
type: 'root',
children: [
{
type: 'block',
kind: 'notebook-code',
children: [
{
type: 'container',
kind: 'figure',
label: 'demo',
identifier: 'demo',
children: [
{
type: 'paragraph',
children: [
{
type: 'text',
value: 'foo',
position: {
start: { line: 11, column: 1 },
end: { line: 11, column: 1 }
}
}
]
},
{
type: 'code',
lang: 'python3',
executable: true,
value: 'from IPython.display import Image\n' +
'\n' +
'display(\n' +
' Image(url="https://picsum.photos/id/947/800/256/")\n' +
')',
identifier: 'demo-code'
},
{
type: 'outputs',
id: 'nH_WaJRVzBnQeMRHJgcyP',
children: [
{
type: 'output',
children: [
{
type: 'image',
url: 'https://picsum.photos/id/947/800/256/'
}
],
jupyter_data: {
output_type: 'display_data',
execution_count: undefined,
metadata: {},
data: {
'text/html': {
content: '<img src="https://picsum.photos/id/947/800/256/"/>',
content_type: 'text/html'
},
'text/plain': {
content: '<IPython.core.display.Image object>',
content_type: 'text/plain'
}
}
},
identifier: 'demo-outputs-0'
}
],
identifier: 'demo-outputs'
}
],
noSubcontainers: true
}
],
data: {}
}
]
}
{
type: 'root',
children: [
{
type: 'block',
kind: 'notebook-code',
children: [
{
type: 'container',
kind: 'figure',
label: 'demo',
identifier: 'demo',
children: [
{
type: 'code',
lang: 'python3',
executable: true,
value: 'from IPython.display import Image\n' +
'\n' +
'display(\n' +
' Image(url="https://picsum.photos/id/947/800/256/")\n' +
')',
identifier: 'demo-code'
},
{
type: 'caption',
children: [
{
type: 'paragraph',
children: [
{
type: 'text',
value: 'foo',
position: {
start: { line: 11, column: 1 },
end: { line: 11, column: 1 }
}
}
]
}
]
},
{
type: 'legend',
children: [
{
type: 'outputs',
id: 'nH_WaJRVzBnQeMRHJgcyP',
children: [
{
type: 'output',
children: [
{
type: 'image',
url: 'https://picsum.photos/id/947/800/256/'
}
],
jupyter_data: {
output_type: 'display_data',
execution_count: undefined,
metadata: {},
data: {
'text/html': {
content: '<img src="https://picsum.photos/id/947/800/256/"/>',
content_type: 'text/html'
},
'text/plain': {
content: '<IPython.core.display.Image object>',
content_type: 'text/plain'
}
}
},
identifier: 'demo-outputs-0'
}
],
identifier: 'demo-outputs'
}
]
}
],
noSubcontainers: true
}
],
data: {}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment