<aside> 💡 This page is documentation for repository below. https://github.com/sota1235/notion-sdk-js-helper
</aside>
await client.pages.create({
// ...
children: [
paragraph('paragraph'),
paragraph('colored paragraph', {
blockColor: 'blue',
}),
paragraph('annotated paragraph', {
textAnnotation: {
bold: true,
},
}),
paragraph('parent paragraph', {
children: [
paragraph('child paragraph'),
],
}),
],
});
paragraph
colored paragraph
annotated paragraph
parent paragraph
child paragraph
await client.pages.create({
// ...
children: [
heading1('Heading1'),
heading2('Heading2'),
heading3('Heading3'),
heading1('Toggleable heading1', {
isToggleable: true,
children: [
heading2('Decorated header', {
blockColor: 'red_background',
textAnnotation: {
italic: true,
},
}),
],
}),
],
});
await client.pages.create({
// ...
children: [
callout('Callout', '🥴'),
callout('Change color as you like', '🎨', {
blockColor: 'red_background',
}),
],
});
<aside> 🥴 Callout
</aside>
<aside> 🎨 Change color as you like
</aside>
await client.pages.create({
// ...
children: [
quote('Some great articles.'),
quote('Some great articles with greate background color.', {
blockColor: 'yellow_background',
}),
],
});
Some great articles.
Some great articles with greate background color.
await client.pages.create({
// ...
children: [
bulletedListItem('Bulleted list item 1'),
bulletedListItem('Bulleted list item 2', {
children: [
bulletedListItem('Child bulleted list item'),
],
}),
numberedListItem('Numbered list item 1'),
numberedListItem('Numbered list item 2', {
children: [
numberedListItem('Child numbered list item'),
],
}),
],
});
await client.pages.create({
// ...
children: [
todo('TODO 1'),
todo('TODO 2', {
checked: true,
children: [
todo('Child TODO'),
],
}),
],
});
await client.pages.create({
// ...
children: [
toggle('Toggle block', {
children: [
paragraph('Child paragraph'),
],
}),
],
});
await client.pages.create({
// ...
children: [
code("console.log('Code block is here!');", 'typescript'),
],
});
console.log('Code block is here!');
await client.pages.create({
// ...
children: [
embed('<https://example.com/>', {
captions: [richText('example caption', undefined, undefined)],
}),
image(
'<https://upload.wikimedia.org/wikipedia/commons/thumb/e/e9/Notion-logo.svg/1200px-Notion-logo.svg.png>',
{
captions: [richText('image caption', undefined, undefined)],
},
),
],
});
example caption
image caption