Callout Blocks¶
Callout blocks create visually prominent information boxes perfect for highlighting important content, tips, warnings, and notes.
Syntax¶
[callout](Important information goes here)
[callout](Custom message "đĨ")
[callout](Warning message "â ī¸")
Basic Usage¶
Default Callout¶
Custom Emoji¶
[callout](Success message "â
")
[callout](Warning information "â ī¸")
[callout](Error details "â")
[callout](Info note "âšī¸")
[callout](Tip or trick "đĄ")
Rich Text Support¶
[callout](This callout includes **bold text**, _italic text_, and `code` "đ")
[callout](Visit our [documentation](https://docs.example.com) for more details "đ")
Programmatic Usage¶
Creating Callouts¶
from notionary.blocks.callout import CalloutMarkdownNode
# Basic callout
callout = CalloutMarkdownNode(
text="Important information",
emoji="đĄ"
)
# Rich text callout
rich_callout = CalloutMarkdownNode(
text="Check out our **new features** at [example.com](https://example.com)",
emoji="đ"
)
markdown = callout.to_markdown()
Using with Pages¶
import asyncio
from notionary import NotionPage
async def add_callouts():
page = await NotionPage.from_title("My Guide")
# Add tip callout
await page.append_markdown('[callout](đĄ **Pro Tip:** Save time with shortcuts "đĄ")')
# Add warning
await page.append_markdown('[callout](â ī¸ **Warning:** Backup your data first "â ī¸")')
asyncio.run(add_callouts())
With MarkdownBuilder¶
from notionary.markdown import MarkdownBuilder
def create_guide():
builder = MarkdownBuilder()
builder.heading("Setup Guide", level=1)
builder.callout("Before starting, ensure you have admin access", emoji="đ")
builder.paragraph("Follow these steps...")
builder.callout("Remember to test in staging first!", emoji="â ī¸")
return builder.build()
await page.replace_content(create_guide)