@@ -223,6 +223,45 @@ def _(node: nodes.title, *, section_level: int) -> NotionObject[Any]:
223223 return block
224224
225225
226+ @_process_node_to_blocks .register
227+ def _ (node : nodes .note , * , section_level : int ) -> NotionObject [Any ]:
228+ """
229+ Process note admonition nodes by creating Notion Callout blocks.
230+ """
231+ del section_level # Not used for admonitions
232+ rich_text = _create_rich_text_from_children (node = node )
233+
234+ block = UnoCallout (text = "" , icon = Emoji (emoji = "📝" ), color = Color .BLUE )
235+ block .rich_text = rich_text
236+ return block
237+
238+
239+ @_process_node_to_blocks .register
240+ def _ (node : nodes .warning , * , section_level : int ) -> NotionObject [Any ]:
241+ """
242+ Process warning admonition nodes by creating Notion Callout blocks.
243+ """
244+ del section_level # Not used for admonitions
245+ rich_text = _create_rich_text_from_children (node = node )
246+
247+ block = UnoCallout (text = "" , icon = Emoji (emoji = "⚠️" ), color = Color .YELLOW )
248+ block .rich_text = rich_text
249+ return block
250+
251+
252+ @_process_node_to_blocks .register
253+ def _ (node : nodes .tip , * , section_level : int ) -> NotionObject [Any ]:
254+ """
255+ Process tip admonition nodes by creating Notion Callout blocks.
256+ """
257+ del section_level # Not used for admonitions
258+ rich_text = _create_rich_text_from_children (node = node )
259+
260+ block = UnoCallout (text = "" , icon = Emoji (emoji = "💡" ), color = Color .GREEN )
261+ block .rich_text = rich_text
262+ return block
263+
264+
226265def _map_pygments_to_notion_language (* , pygments_lang : str ) -> CodeLang :
227266 """
228267 Map Pygments language names to Notion CodeLang enum values.
@@ -440,10 +479,10 @@ def visit_note(self, node: nodes.Element) -> None:
440479 """
441480 Handle note admonition nodes by creating Notion Callout blocks.
442481 """
443- rich_text = _create_rich_text_from_children ( node = node )
444-
445- block = UnoCallout ( text = "" , icon = Emoji ( emoji = "📝" ), color = Color . BLUE )
446- block . rich_text = rich_text
482+ block = _process_node_to_blocks (
483+ node ,
484+ section_level = self . _section_level ,
485+ )
447486 self ._blocks .append (block )
448487
449488 raise nodes .SkipNode
@@ -452,10 +491,10 @@ def visit_warning(self, node: nodes.Element) -> None:
452491 """
453492 Handle warning admonition nodes by creating Notion Callout blocks.
454493 """
455- rich_text = _create_rich_text_from_children ( node = node )
456-
457- block = UnoCallout ( text = "" , icon = Emoji ( emoji = "⚠️" ), color = Color . YELLOW )
458- block . rich_text = rich_text
494+ block = _process_node_to_blocks (
495+ node ,
496+ section_level = self . _section_level ,
497+ )
459498 self ._blocks .append (block )
460499
461500 raise nodes .SkipNode
@@ -464,10 +503,10 @@ def visit_tip(self, node: nodes.Element) -> None:
464503 """
465504 Handle tip admonition nodes by creating Notion Callout blocks.
466505 """
467- rich_text = _create_rich_text_from_children ( node = node )
468-
469- block = UnoCallout ( text = "" , icon = Emoji ( emoji = "💡" ), color = Color . GREEN )
470- block . rich_text = rich_text
506+ block = _process_node_to_blocks (
507+ node ,
508+ section_level = self . _section_level ,
509+ )
471510 self ._blocks .append (block )
472511
473512 raise nodes .SkipNode
0 commit comments